Bug 1814798 - pt 2. Add a PHCManager component to control PHC r=glandium,emilio
[gecko.git] / netwerk / protocol / http / AltServiceParent.cpp
blob468925c2ad7f98bf5210a803ea600adc886af23f
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/. */
7 // HttpLog.h should generally be included first
8 #include "HttpLog.h"
10 #include "AltServiceParent.h"
11 #include "AlternateServices.h"
12 #include "nsHttpHandler.h"
14 namespace mozilla {
15 namespace net {
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);
25 return IPC_OK();
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 LOG(("AltServiceParent::RecvProcessHeader [this=%p]\n", this));
35 nsProxyInfo* pi = aProxyInfo.IsEmpty()
36 ? nullptr
37 : nsProxyInfo::DeserializeProxyInfo(aProxyInfo);
38 AltSvcMapping::ProcessHeader(aBuf, aOriginScheme, aOriginHost, aOriginPort,
39 aUsername, aPrivateBrowsing, nullptr, pi, aCaps,
40 aOriginAttributes);
41 return IPC_OK();
44 void AltServiceParent::ActorDestroy(ActorDestroyReason aWhy) {
45 LOG(("AltServiceParent::ActorDestroy [this=%p]\n", this));
48 } // namespace net
49 } // namespace mozilla