AltServiceParent.cpp (2089B)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* vim:set ts=4 sw=4 sts=4 et cin: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 // HttpLog.h should generally be included first 8 #include "HttpLog.h" 9 10 #include "AltServiceParent.h" 11 #include "AlternateServices.h" 12 #include "nsHttpHandler.h" 13 14 namespace mozilla { 15 namespace net { 16 17 mozilla::ipc::IPCResult AltServiceParent::RecvClearHostMapping( 18 const nsCString& aHost, const int32_t& aPort, 19 const OriginAttributes& aOriginAttributes) { 20 LOG(("AltServiceParent::RecvClearHostMapping [this=%p]\n", this)); 21 if (gHttpHandler) { 22 gHttpHandler->AltServiceCache()->ClearHostMapping(aHost, aPort, 23 aOriginAttributes); 24 } 25 return IPC_OK(); 26 } 27 28 mozilla::ipc::IPCResult AltServiceParent::RecvProcessHeader( 29 const nsCString& aBuf, const nsCString& aOriginScheme, 30 const nsCString& aOriginHost, const int32_t& aOriginPort, 31 const nsACString& aUsername, const bool& aPrivateBrowsing, 32 nsTArray<ProxyInfoCloneArgs>&& aProxyInfo, const uint32_t& aCaps, 33 const OriginAttributes& aOriginAttributes, 34 const HttpConnectionInfoCloneArgs& aArgs) { 35 LOG(("AltServiceParent::RecvProcessHeader [this=%p]\n", this)); 36 nsProxyInfo* pi = aProxyInfo.IsEmpty() 37 ? nullptr 38 : nsProxyInfo::DeserializeProxyInfo(aProxyInfo); 39 RefPtr<nsHttpConnectionInfo> cinfo = 40 nsHttpConnectionInfo::DeserializeHttpConnectionInfoCloneArgs(aArgs); 41 AltSvcMapping::ProcessHeader(aBuf, aOriginScheme, aOriginHost, aOriginPort, 42 aUsername, aPrivateBrowsing, nullptr, pi, aCaps, 43 aOriginAttributes, cinfo); 44 return IPC_OK(); 45 } 46 47 void AltServiceParent::ActorDestroy(ActorDestroyReason aWhy) { 48 LOG(("AltServiceParent::ActorDestroy [this=%p]\n", this)); 49 } 50 51 } // namespace net 52 } // namespace mozilla