зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1687618 - Remove implementation of IsIsolated and TopWindowOrigin r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D102715
This commit is contained in:
Родитель
53b6dbb8ec
Коммит
2d8c4e4c26
|
@ -88,7 +88,6 @@ NS_INTERFACE_MAP_END_INHERITING(HttpBaseChannel)
|
|||
|
||||
TRRServiceChannel::TRRServiceChannel()
|
||||
: HttpAsyncAborter<TRRServiceChannel>(this),
|
||||
mTopWindowOriginComputed(false),
|
||||
mPushedStreamId(0),
|
||||
mProxyRequest(nullptr, "TRRServiceChannel::mProxyRequest"),
|
||||
mCurrentEventTarget(GetCurrentEventTarget()) {
|
||||
|
@ -343,18 +342,6 @@ TRRServiceChannel::OnProxyAvailable(nsICancelable* request, nsIChannel* channel,
|
|||
return rv;
|
||||
}
|
||||
|
||||
const nsCString& TRRServiceChannel::GetTopWindowOrigin() {
|
||||
if (mTopWindowOriginComputed) {
|
||||
return mTopWindowOrigin;
|
||||
}
|
||||
|
||||
nsresult rv = nsContentUtils::GetASCIIOrigin(mURI, mTopWindowOrigin);
|
||||
NS_ENSURE_SUCCESS(rv, mTopWindowOrigin);
|
||||
|
||||
mTopWindowOriginComputed = true;
|
||||
return mTopWindowOrigin;
|
||||
}
|
||||
|
||||
nsresult TRRServiceChannel::BeginConnect() {
|
||||
LOG(("TRRServiceChannel::BeginConnect [this=%p]\n", this));
|
||||
nsresult rv;
|
||||
|
|
|
@ -113,7 +113,6 @@ class TRRServiceChannel : public HttpBaseChannel,
|
|||
virtual ~TRRServiceChannel();
|
||||
|
||||
void CancelNetworkRequest(nsresult aStatus);
|
||||
const nsCString& GetTopWindowOrigin();
|
||||
nsresult BeginConnect();
|
||||
nsresult ContinueOnBeforeConnect();
|
||||
nsresult Connect();
|
||||
|
@ -139,13 +138,7 @@ class TRRServiceChannel : public HttpBaseChannel,
|
|||
virtual bool SameOriginWithOriginalUri(nsIURI* aURI) override;
|
||||
bool DispatchRelease();
|
||||
|
||||
// True only when we have computed the value of the top window origin.
|
||||
bool mTopWindowOriginComputed;
|
||||
|
||||
nsCString mUsername;
|
||||
// The origin of the top window, only valid when mTopWindowOriginComputed is
|
||||
// true.
|
||||
nsCString mTopWindowOrigin;
|
||||
|
||||
// Needed for accurate DNS timing
|
||||
RefPtr<nsDNSPrefetch> mDNSPrefetch;
|
||||
|
|
|
@ -3654,44 +3654,6 @@ nsresult nsHttpChannel::OpenCacheEntry(bool isHttps) {
|
|||
return OpenCacheEntryInternal(isHttps, mApplicationCache, true);
|
||||
}
|
||||
|
||||
bool nsHttpChannel::IsIsolated() {
|
||||
return false;
|
||||
// if (LoadHasBeenIsolatedChecked()) {
|
||||
// return LoadIsIsolated();
|
||||
// }
|
||||
// StoreIsIsolated(
|
||||
// StaticPrefs::browser_cache_cache_isolation() ||
|
||||
// (IsThirdPartyTrackingResource() &&
|
||||
// !ContentBlocking::ShouldAllowAccessFor(this, mURI, nullptr)));
|
||||
// StoreHasBeenIsolatedChecked(true);
|
||||
// return LoadIsIsolated();
|
||||
}
|
||||
|
||||
const nsCString& nsHttpChannel::GetTopWindowOrigin() {
|
||||
if (LoadTopWindowOriginComputed()) {
|
||||
return mTopWindowOrigin;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> topWindowURI;
|
||||
nsresult rv = GetTopWindowURI(getter_AddRefs(topWindowURI));
|
||||
bool isDocument = false;
|
||||
if (NS_FAILED(rv) && NS_SUCCEEDED(GetIsMainDocumentChannel(&isDocument)) &&
|
||||
isDocument) {
|
||||
// For top-level documents, use the document channel's origin to compute
|
||||
// the unique storage space identifier instead of the top Window URI.
|
||||
rv = NS_GetFinalChannelURI(this, getter_AddRefs(topWindowURI));
|
||||
NS_ENSURE_SUCCESS(rv, mTopWindowOrigin);
|
||||
}
|
||||
|
||||
rv = nsContentUtils::GetASCIIOrigin(topWindowURI ? topWindowURI : mURI,
|
||||
mTopWindowOrigin);
|
||||
NS_ENSURE_SUCCESS(rv, mTopWindowOrigin);
|
||||
|
||||
StoreTopWindowOriginComputed(true);
|
||||
|
||||
return mTopWindowOrigin;
|
||||
}
|
||||
|
||||
nsresult nsHttpChannel::OpenCacheEntryInternal(
|
||||
bool isHttps, nsIApplicationCache* applicationCache,
|
||||
bool allowApplicationCache) {
|
||||
|
|
|
@ -544,10 +544,6 @@ class nsHttpChannel final : public HttpBaseChannel,
|
|||
void SetOriginHeader();
|
||||
void SetDoNotTrack();
|
||||
|
||||
bool IsIsolated();
|
||||
|
||||
const nsCString& GetTopWindowOrigin();
|
||||
|
||||
already_AddRefed<nsChannelClassifier> GetOrCreateChannelClassifier();
|
||||
|
||||
// Start an internal redirect to a new InterceptedHttpChannel which will
|
||||
|
@ -720,9 +716,6 @@ class nsHttpChannel final : public HttpBaseChannel,
|
|||
// Used to suspend any newly created pumps in mCallOnResume handler.
|
||||
(uint32_t, AsyncResumePending, 1),
|
||||
|
||||
// True only when we have computed the value of the top window origin.
|
||||
(uint32_t, TopWindowOriginComputed, 1),
|
||||
|
||||
// True if the data will be sent from the socket process to the
|
||||
// content process directly.
|
||||
(uint32_t, DataSentToChildProcess, 1),
|
||||
|
@ -741,10 +734,6 @@ class nsHttpChannel final : public HttpBaseChannel,
|
|||
))
|
||||
// clang-format on
|
||||
|
||||
// The origin of the top window, only valid when TopWindowOriginComputed is
|
||||
// true.
|
||||
nsCString mTopWindowOrigin;
|
||||
|
||||
nsTArray<nsContinueRedirectionFunc> mRedirectFuncStack;
|
||||
|
||||
// Needed for accurate DNS timing
|
||||
|
|
|
@ -2634,10 +2634,6 @@ nsresult nsHttpHandler::SpeculativeConnectInternal(
|
|||
nsAutoCString username;
|
||||
aURI->GetUsername(username);
|
||||
|
||||
// TODO For now pass ""_ns for topWindowOrigin for all speculative
|
||||
// connection attempts, but ideally we should pass the accurate top window
|
||||
// origin here. This would require updating the nsISpeculativeConnect API
|
||||
// and all of its consumers.
|
||||
RefPtr<nsHttpConnectionInfo> ci =
|
||||
new nsHttpConnectionInfo(host, port, ""_ns, username, nullptr,
|
||||
originAttributes, aURI->SchemeIs("https"));
|
||||
|
|
Загрузка…
Ссылка в новой задаче