diff --git a/dom/security/moz.build b/dom/security/moz.build index e57c0f0cc9..224b7a4a9a 100644 --- a/dom/security/moz.build +++ b/dom/security/moz.build @@ -13,7 +13,6 @@ EXPORTS.mozilla.dom += [ 'nsCSPService.h', 'nsCSPUtils.h', 'nsMixedContentBlocker.h', - 'SecFetch.h', 'SRICheck.h', 'SRILogHelper.h', 'SRIMetadata.h', @@ -33,7 +32,6 @@ UNIFIED_SOURCES += [ 'nsCSPService.cpp', 'nsCSPUtils.cpp', 'nsMixedContentBlocker.cpp', - 'SecFetch.cpp', 'SRICheck.cpp', 'SRIMetadata.cpp', ] diff --git a/dom/security/SecFetch.cpp b/netwerk/protocol/http/SecFetch.cpp similarity index 98% rename from dom/security/SecFetch.cpp rename to netwerk/protocol/http/SecFetch.cpp index fec82c13e4..cd6ce30bbb 100644 --- a/dom/security/SecFetch.cpp +++ b/netwerk/protocol/http/SecFetch.cpp @@ -6,9 +6,16 @@ #include "SecFetch.h" #include "nsIHttpChannel.h" +#include "nsIURI.h" #include "mozIThirdPartyUtil.h" +#include "nsContentUtils.h" #include "nsMixedContentBlocker.h" #include "nsNetUtil.h" +#include "mozilla/Preferences.h" +#include "mozilla/Unused.h" + +using namespace mozilla; +using namespace mozilla::net; // Helper function which maps an internal content policy type // to the corresponding destination for the context of SecFetch. diff --git a/dom/security/SecFetch.h b/netwerk/protocol/http/SecFetch.h similarity index 98% rename from dom/security/SecFetch.h rename to netwerk/protocol/http/SecFetch.h index 9ebec60de5..7917fddcb7 100644 --- a/dom/security/SecFetch.h +++ b/netwerk/protocol/http/SecFetch.h @@ -10,7 +10,7 @@ class nsIHttpChannel; namespace mozilla { -namespace dom { +namespace net { class SecFetch final { public: diff --git a/netwerk/protocol/http/moz.build b/netwerk/protocol/http/moz.build index 91fc897224..7f7345161e 100644 --- a/netwerk/protocol/http/moz.build +++ b/netwerk/protocol/http/moz.build @@ -39,6 +39,7 @@ EXPORTS.mozilla.net += [ 'NullHttpChannel.h', 'PHttpChannelParams.h', 'PSpdyPush.h', + 'SecFetch.h', 'TimingStruct.h', ] @@ -85,6 +86,7 @@ UNIFIED_SOURCES += [ 'nsHttpTransaction.cpp', 'NullHttpChannel.cpp', 'NullHttpTransaction.cpp', + 'SecFetch.cpp', 'TunnelUtils.cpp', ] diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index d00cf377cc..f83c2ef90b 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -99,7 +99,7 @@ #include "CacheControlParser.h" #include "nsMixedContentBlocker.h" #include "CacheStorageService.h" -#include "mozilla/dom/SecFetch.h" +#include "mozilla/net/SecFetch.h" namespace mozilla { namespace net { @@ -382,7 +382,7 @@ nsHttpChannel::Connect() NS_ENSURE_SUCCESS(rv, rv); } - mozilla::dom::SecFetch::AddSecFetchHeader(this); + mozilla::net::SecFetch::AddSecFetchHeader(this); bool isHttps = false; rv = mURI->SchemeIs("https", &isHttps);