author | Ehsan Akhgari <ehsan@mozilla.com> |
Mon, 28 Jan 2019 16:40:21 +0000 (2019-01-28) | |
changeset 455676 | 9f7b93f5c4f86ed732d2fe87dd96f0121e6801d1 |
parent 455639 | d650090f08b8a7e29e74d607d11c10a346de5b0d |
child 455677 | 8abb91d7d1b7ac177a938afb4d45f56e4f30d690 |
push id | 35457 |
push user | csabou@mozilla.com |
push date | Tue, 29 Jan 2019 09:20:40 +0000 (2019-01-29) |
treeherder | mozilla-central@84104c5031c3 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | baku |
bugs | 1523106 |
milestone | 66.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -194,20 +194,16 @@ class nsDocShell final : public nsDocLoa NS_DECL_NSIREFRESHURI NS_DECL_NSIWEBPAGEDESCRIPTOR NS_DECL_NSIAUTHPROMPTPROVIDER NS_DECL_NSINETWORKINTERCEPTCONTROLLER NS_DECL_NSIDEPRECATIONWARNER NS_FORWARD_SAFE_NSIDOMSTORAGEMANAGER(TopSessionStorageManager()) - // Need to implement (and forward) nsISecurityEventSink, because - // nsIWebProgressListener has methods with identical names... - NS_FORWARD_NSISECURITYEVENTSINK(nsDocLoader::) - // Create a new nsDocShell object, initializing it. static already_AddRefed<nsDocShell> Create( mozilla::dom::BrowsingContext* aBrowsingContext); NS_IMETHOD Stop() override { // Need this here because otherwise nsIWebNavigation::Stop // overrides the docloader's Stop() return nsDocLoader::Stop();
--- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -1042,17 +1042,16 @@ NS_IMPL_ISUPPORTS(ExternalResourceMap::L nsIInterfaceRequestor) #define IMPL_SHIM(_i) \ NS_IMPL_ISUPPORTS(ExternalResourceMap::LoadgroupCallbacks::_i##Shim, _i) IMPL_SHIM(nsILoadContext) IMPL_SHIM(nsIProgressEventSink) IMPL_SHIM(nsIChannelEventSink) -IMPL_SHIM(nsISecurityEventSink) IMPL_SHIM(nsIApplicationCacheContainer) #undef IMPL_SHIM #define IID_IS(_i) aIID.Equals(NS_GET_IID(_i)) #define TRY_SHIM(_i) \ PR_BEGIN_MACRO \ @@ -1075,17 +1074,16 @@ ExternalResourceMap::LoadgroupCallbacks: return mCallbacks->GetInterface(aIID, aSink); } *aSink = nullptr; TRY_SHIM(nsILoadContext); TRY_SHIM(nsIProgressEventSink); TRY_SHIM(nsIChannelEventSink); - TRY_SHIM(nsISecurityEventSink); TRY_SHIM(nsIApplicationCacheContainer); return NS_NOINTERFACE; } #undef TRY_SHIM #undef IID_IS
--- a/dom/base/Document.h +++ b/dom/base/Document.h @@ -22,17 +22,16 @@ #include "nsILoadGroup.h" // for member (in nsCOMPtr) #include "nsINode.h" // for base class #include "nsIParser.h" #include "nsIPresShell.h" #include "nsIChannelEventSink.h" #include "nsIProgressEventSink.h" #include "nsIRadioGroupContainer.h" #include "nsIScriptObjectPrincipal.h" -#include "nsISecurityEventSink.h" #include "nsIScriptGlobalObject.h" // for member (in nsCOMPtr) #include "nsIServiceManager.h" #include "nsIURI.h" // for use in inline functions #include "nsIUUIDGenerator.h" #include "nsIWebProgressListener.h" // for nsIWebProgressListener #include "nsIWeakReferenceUtils.h" // for nsWeakPtr #include "nsPIDOMWindow.h" // for use in inline functions #include "nsPropertyTable.h" // for member @@ -403,17 +402,16 @@ class ExternalResourceMap { NS_FORWARD_##_allcaps(mRealPtr->) private \ : nsCOMPtr<nsIInterfaceRequestor> mIfReq; \ nsCOMPtr<_i> mRealPtr; \ }; DECL_SHIM(nsILoadContext, NSILOADCONTEXT) DECL_SHIM(nsIProgressEventSink, NSIPROGRESSEVENTSINK) DECL_SHIM(nsIChannelEventSink, NSICHANNELEVENTSINK) - DECL_SHIM(nsISecurityEventSink, NSISECURITYEVENTSINK) DECL_SHIM(nsIApplicationCacheContainer, NSIAPPLICATIONCACHECONTAINER) #undef DECL_SHIM }; /** * Add an ExternalResource for aURI. aViewer and aLoadGroup might be null * when this is called if the URI didn't result in an XML document. This * function makes sure to remove the pending load for aURI, if any, from our
--- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -5367,19 +5367,16 @@ void nsGlobalWindowOuter::NotifyContentB // loaded in the document. if (!SameLoadingURI(doc, aChannel) && aEvent == nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT) { return; } // Notify nsIWebProgressListeners of this content blocking event. // Can be used to change the UI state. - nsresult rv = NS_OK; - nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell, &rv); - NS_ENSURE_SUCCESS_VOID(rv); uint32_t event = 0; nsCOMPtr<nsISecureBrowserUI> securityUI; docShell->GetSecurityUI(getter_AddRefs(securityUI)); if (!securityUI) { return; } securityUI->GetContentBlockingEvent(&event); nsAutoCString origin; @@ -5449,17 +5446,18 @@ void nsGlobalWindowOuter::NotifyContentB // a big performance cost. && aEvent != nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT #endif ) { // Avoid dispatching repeated notifications when nothing has changed return; } - eventSink->OnContentBlockingEvent(aChannel, event); + nsDocShell::Cast(docShell)->nsDocLoader::OnContentBlockingEvent(aChannel, + event); } // static bool nsGlobalWindowOuter::SameLoadingURI(Document* aDoc, nsIChannel* aChannel) { nsCOMPtr<nsIURI> docURI = aDoc->GetDocumentURI(); nsCOMPtr<nsILoadInfo> channelLoadInfo = aChannel->GetLoadInfo(); if (!channelLoadInfo || !docURI) { return false;
--- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -6,18 +6,17 @@ #include "nsMixedContentBlocker.h" #include "nsContentPolicyUtils.h" #include "nsCSPContext.h" #include "nsThreadUtils.h" #include "nsINode.h" #include "nsCOMPtr.h" -#include "nsIDocShell.h" -#include "nsISecurityEventSink.h" +#include "nsDocShell.h" #include "nsIWebProgressListener.h" #include "nsContentUtils.h" #include "nsIRequest.h" #include "mozilla/dom/Document.h" #include "nsIContentViewer.h" #include "nsIChannel.h" #include "nsIHttpChannel.h" #include "nsIParentChannel.h" @@ -76,19 +75,17 @@ class nsMixedContentEvent : public Runna mType(aType), mRootHasSecureConnection(aRootHasSecureConnection) {} NS_IMETHOD Run() override { NS_ASSERTION(mContext, "You can't call this runnable without a requesting context"); // To update the security UI in the tab with the blocked mixed content, call - // nsISecurityEventSink::OnSecurityChange. You can get to the event sink by - // calling NS_CP_GetDocShellFromContext on the context, and QI'ing to - // nsISecurityEventSink. + // nsDocLoader::OnSecurityChange. // Mixed content was allowed and is about to load; get the document and // set the approriate flag to true if we are about to load Mixed Active // Content. nsCOMPtr<nsIDocShell> docShell = NS_CP_GetDocShellFromContext(mContext); if (!docShell) { return NS_OK; } @@ -98,19 +95,17 @@ class nsMixedContentEvent : public Runna sameTypeRoot, "No document shell root tree item from document shell tree item!"); // now get the document from sameTypeRoot nsCOMPtr<Document> rootDoc = sameTypeRoot->GetDocument(); NS_ASSERTION(rootDoc, "No root document from document shell root tree item."); - // Get eventSink and the current security state from the docShell - nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell); - NS_ASSERTION(eventSink, "No eventSink from docShell."); + nsDocShell* nativeDocShell = nsDocShell::Cast(docShell); nsCOMPtr<nsIDocShell> rootShell = do_GetInterface(sameTypeRoot); NS_ASSERTION(rootShell, "No root docshell from document shell root tree item."); uint32_t state = nsIWebProgressListener::STATE_IS_BROKEN; nsCOMPtr<nsISecureBrowserUI> securityUI; rootShell->GetSecurityUI(getter_AddRefs(securityUI)); // If there is no securityUI, document doesn't have a security state to // update. But we still want to set the document flags, so we don't return @@ -139,24 +134,24 @@ class nsMixedContentEvent : public Runna state |= nsIWebProgressListener::STATE_IS_BROKEN; // If mixed display content is loaded, make sure to include that in // the state. if (rootDoc->GetHasMixedDisplayContentLoaded()) { state |= nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT; } - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( mContext, (state | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT)); } else { // root not secure, mixed active content loaded in an https subframe if (NS_SUCCEEDED(stateRV)) { - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( mContext, (state | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT)); } } } } else if (mType == eMixedDisplay) { @@ -179,24 +174,24 @@ class nsMixedContentEvent : public Runna state |= nsIWebProgressListener::STATE_IS_BROKEN; // If mixed active content is loaded, make sure to include that in the // state. if (rootDoc->GetHasMixedActiveContentLoaded()) { state |= nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT; } - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( mContext, (state | nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT)); } else { // root not secure, mixed display content loaded in an https subframe if (NS_SUCCEEDED(stateRV)) { - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( mContext, (state | nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT)); } } } } @@ -891,19 +886,17 @@ nsresult nsMixedContentBlocker::ShouldLo return NS_OK; } } // Get the root document from the sameTypeRoot nsCOMPtr<Document> rootDoc = sameTypeRoot->GetDocument(); NS_ASSERTION(rootDoc, "No root document from document shell root tree item."); - // Get eventSink and the current security state from the docShell - nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell); - NS_ASSERTION(eventSink, "No eventSink from docShell."); + nsDocShell* nativeDocShell = nsDocShell::Cast(docShell); nsCOMPtr<nsIDocShell> rootShell = do_GetInterface(sameTypeRoot); NS_ASSERTION(rootShell, "No root docshell from document shell root tree item."); uint32_t state = nsIWebProgressListener::STATE_IS_BROKEN; nsCOMPtr<nsISecureBrowserUI> securityUI; rootShell->GetSecurityUI(getter_AddRefs(securityUI)); // If there is no securityUI, document doesn't have a security state. // Allow load and return early. @@ -979,38 +972,38 @@ nsresult nsMixedContentBlocker::ShouldLo state |= nsIWebProgressListener::STATE_IS_BROKEN; // If mixed active content is loaded, make sure to include that in the // state. if (rootDoc->GetHasMixedActiveContentLoaded()) { state |= nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT; } - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( aRequestingContext, (state | nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT)); } else { // User has overriden the pref and the root is not https; // mixed display content was allowed on an https subframe. if (NS_SUCCEEDED(stateRV)) { - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( aRequestingContext, (state | nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT)); } } } else { *aDecision = nsIContentPolicy::REJECT_REQUEST; LogMixedContentMessage(classification, aContentLocation, rootDoc, eBlocked); if (!rootDoc->GetHasMixedDisplayContentBlocked() && NS_SUCCEEDED(stateRV)) { rootDoc->SetHasMixedDisplayContentBlocked(true); - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( aRequestingContext, (state | nsIWebProgressListener::STATE_BLOCKED_MIXED_DISPLAY_CONTENT)); } } return NS_OK; } else if (sBlockMixedScript && classification == eMixedScript) { @@ -1034,27 +1027,27 @@ nsresult nsMixedContentBlocker::ShouldLo state |= nsIWebProgressListener::STATE_IS_BROKEN; // If mixed display content is loaded, make sure to include that in the // state. if (rootDoc->GetHasMixedDisplayContentLoaded()) { state |= nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT; } - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( aRequestingContext, (state | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT)); return NS_OK; } else { // User has already overriden the pref and the root is not https; // mixed active content was allowed on an https subframe. if (NS_SUCCEEDED(stateRV)) { - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( aRequestingContext, (state | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT)); } return NS_OK; } } else { // User has not overriden the pref by Disabling protection. Reject the @@ -1065,19 +1058,19 @@ nsresult nsMixedContentBlocker::ShouldLo // See if the pref will change here. If it will, only then do we need to // call OnSecurityChange() to update the UI. if (rootDoc->GetHasMixedActiveContentBlocked()) { return NS_OK; } rootDoc->SetHasMixedActiveContentBlocked(true); // The user has not overriden the pref, so make sure they still have an - // option by calling eventSink which will invoke the doorhanger + // option by calling nativeDocShell which will invoke the doorhanger if (NS_SUCCEEDED(stateRV)) { - eventSink->OnSecurityChange( + nativeDocShell->nsDocLoader::OnSecurityChange( aRequestingContext, (state | nsIWebProgressListener::STATE_BLOCKED_MIXED_ACTIVE_CONTENT)); } return NS_OK; } } else { // The content is not blocked by the mixed content prefs.
--- a/netwerk/base/moz.build +++ b/netwerk/base/moz.build @@ -91,17 +91,16 @@ XPIDL_SOURCES += [ 'nsIRedirectResultListener.idl', 'nsIRequest.idl', 'nsIRequestContext.idl', 'nsIRequestObserver.idl', 'nsIRequestObserverProxy.idl', 'nsIResumableChannel.idl', 'nsISecCheckWrapChannel.idl', 'nsISecureBrowserUI.idl', - 'nsISecurityEventSink.idl', 'nsISensitiveInfoHiddenURI.idl', 'nsISerializationHelper.idl', 'nsIServerSocket.idl', 'nsISimpleStreamListener.idl', 'nsISocketFilter.idl', 'nsISocketTransport.idl', 'nsISocketTransportService.idl', 'nsISpeculativeConnect.idl',
deleted file mode 100644 --- a/netwerk/base/nsISecurityEventSink.idl +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsISupports.idl" -interface nsIURI; - -[builtinclass, uuid(a71aee68-dd38-4736-bd79-035fea1a1ec6)] -interface nsISecurityEventSink : nsISupports -{ - - /** - * Fired when a security change occurs due to page transitions, - * or end document load. This interface should be called by - * a security package (eg Netscape Personal Security Manager) - * to notify nsIWebProgressListeners that security state has - * changed. State flags are in nsIWebProgressListener.idl - */ - - void onSecurityChange(in nsISupports i_Context, in unsigned long state); - - /** - * Fired when a content blocking event occurs during the time - * when a document is alive. This interface should be called - * by Gecko to notify nsIWebProgressListeners that there is a - * new content blocking event. Content blocking events are in - * nsIWebProgressListeners.idl. - */ - void onContentBlockingEvent(in nsISupports i_Context, in unsigned long event); -}; - - - -
--- a/netwerk/url-classifier/nsChannelClassifier.cpp +++ b/netwerk/url-classifier/nsChannelClassifier.cpp @@ -11,17 +11,16 @@ #include "nsICachingChannel.h" #include "nsIChannel.h" #include "nsIIOService.h" #include "nsIObserverService.h" #include "nsIPermissionManager.h" #include "nsIProtocolHandler.h" #include "nsIScriptSecurityManager.h" #include "nsISecureBrowserUI.h" -#include "nsISecurityEventSink.h" #include "nsISupportsPriority.h" #include "nsNetUtil.h" #include "nsXULAppAPI.h" #include "nsQueryObject.h" #include "nsIUrlClassifierDBService.h" #include "nsIUrlClassifierFeature.h" #include "nsPrintfCString.h"
--- a/netwerk/url-classifier/nsChannelClassifier.h +++ b/netwerk/url-classifier/nsChannelClassifier.h @@ -52,17 +52,17 @@ class nsChannelClassifier final : public void RemoveShutdownObserver(); static nsresult SendThreatHitReport(nsIChannel* aChannel, const nsACString& aProvider, const nsACString& aList, const nsACString& aFullHash); public: // If we are blocking content, update the corresponding flag in the respective - // docshell and call nsISecurityEventSink::onSecurityChange. + // docshell and call nsDocLoader::OnSecurityChange. static nsresult SetBlockedContent(nsIChannel* channel, nsresult aErrorCode, const nsACString& aList, const nsACString& aProvider, const nsACString& aFullHash); }; } // namespace net } // namespace mozilla
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp +++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp @@ -6,20 +6,19 @@ #include "nsSecureBrowserUIImpl.h" #include "mozilla/Assertions.h" #include "mozilla/Logging.h" #include "mozilla/Unused.h" #include "mozilla/dom/Document.h" #include "nsContentUtils.h" #include "nsIChannel.h" -#include "nsIDocShell.h" +#include "nsDocShell.h" #include "nsIDocShellTreeItem.h" #include "nsIInterfaceRequestorUtils.h" -#include "nsISecurityEventSink.h" #include "nsITransportSecurityInfo.h" #include "nsIWebProgress.h" using namespace mozilla; LazyLogModule gSecureBrowserUILog("nsSecureBrowserUI"); nsSecureBrowserUIImpl::nsSecureBrowserUIImpl() : mState(0), mEvent(0) { @@ -411,24 +410,22 @@ nsSecureBrowserUIImpl::OnLocationChange( "Setting everything to 'not secure' to be safe.")); mState = STATE_IS_INSECURE; mTopLevelSecurityInfo = nullptr; } } } nsCOMPtr<nsIDocShell> docShell = do_QueryReferent(mDocShell); - nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell); - if (eventSink) { + if (docShell) { MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, (" calling OnSecurityChange %p %x", aRequest, mState)); - Unused << eventSink->OnSecurityChange(aRequest, mState); + nsDocShell::Cast(docShell)->nsDocLoader::OnSecurityChange(aRequest, mState); } else { - MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, - (" no docShell or couldn't QI it to nsISecurityEventSink?")); + MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, (" no docShell?")); } return NS_OK; } NS_IMETHODIMP nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress*, nsIRequest*, uint32_t, nsresult) {
--- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -159,17 +159,16 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION( NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDocumentLoader) NS_INTERFACE_MAP_ENTRY(nsIRequestObserver) NS_INTERFACE_MAP_ENTRY(nsIDocumentLoader) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) NS_INTERFACE_MAP_ENTRY(nsIWebProgress) NS_INTERFACE_MAP_ENTRY(nsIProgressEventSink) NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink) - NS_INTERFACE_MAP_ENTRY(nsISecurityEventSink) NS_INTERFACE_MAP_ENTRY(nsISupportsPriority) NS_INTERFACE_MAP_ENTRY_CONCRETE(nsDocLoader) NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTION(nsDocLoader, mChildrenInOnload) /* * Implementation of nsIInterfaceRequestor methods... @@ -1393,57 +1392,50 @@ NS_IMETHODIMP nsDocLoader::AsyncOnChanne OnRedirectStateChange(aOldChannel, aNewChannel, aFlags, stateFlags); FireOnStateChange(this, aOldChannel, stateFlags, NS_OK); } cb->OnRedirectVerifyCallback(NS_OK); return NS_OK; } -/* - * Implementation of nsISecurityEventSink method... - */ - -NS_IMETHODIMP nsDocLoader::OnSecurityChange(nsISupports* aContext, - uint32_t aState) { +void nsDocLoader::OnSecurityChange(nsISupports* aContext, uint32_t aState) { // // Fire progress notifications out to any registered nsIWebProgressListeners. // nsCOMPtr<nsIRequest> request = do_QueryInterface(aContext); nsIWebProgress* webProgress = static_cast<nsIWebProgress*>(this); NOTIFY_LISTENERS(nsIWebProgress::NOTIFY_SECURITY, listener->OnSecurityChange(webProgress, request, aState);); // Pass the notification up to the parent... if (mParent) { mParent->OnSecurityChange(aContext, aState); } - return NS_OK; } -NS_IMETHODIMP nsDocLoader::OnContentBlockingEvent(nsISupports* aContext, - uint32_t aEvent) { +void nsDocLoader::OnContentBlockingEvent(nsISupports* aContext, + uint32_t aEvent) { // // Fire progress notifications out to any registered nsIWebProgressListeners. // nsCOMPtr<nsIRequest> request = do_QueryInterface(aContext); nsIWebProgress* webProgress = static_cast<nsIWebProgress*>(this); NOTIFY_LISTENERS( nsIWebProgress::NOTIFY_CONTENT_BLOCKING, listener->OnContentBlockingEvent(webProgress, request, aEvent);); // Pass the notification up to the parent... if (mParent) { mParent->OnContentBlockingEvent(aContext, aEvent); } - return NS_OK; } /* * Implementation of nsISupportsPriority methods... * * The priority of the DocLoader _is_ the priority of its LoadGroup. * * XXX(darin): Once we start storing loadgroups in loadgroups, this code will
--- a/uriloader/base/nsDocLoader.h +++ b/uriloader/base/nsDocLoader.h @@ -18,17 +18,16 @@ #include "nsCOMArray.h" #include "nsTObserverArray.h" #include "nsString.h" #include "nsIChannel.h" #include "nsIProgressEventSink.h" #include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIChannelEventSink.h" -#include "nsISecurityEventSink.h" #include "nsISupportsPriority.h" #include "nsCOMPtr.h" #include "PLDHashTable.h" #include "nsAutoPtr.h" #include "nsCycleCollectionParticipant.h" #include "mozilla/LinkedList.h" @@ -45,17 +44,16 @@ class nsDocLoader : public nsIDocumentLoader, public nsIRequestObserver, public nsSupportsWeakReference, public nsIProgressEventSink, public nsIWebProgress, public nsIInterfaceRequestor, public nsIChannelEventSink, - public nsISecurityEventSink, public nsISupportsPriority { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_THIS_DOCLOADER_IMPL_CID) nsDocLoader(); virtual MOZ_MUST_USE nsresult Init(); @@ -72,18 +70,16 @@ class nsDocLoader : public nsIDocumentLo NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDocLoader, nsIDocumentLoader) NS_DECL_NSIDOCUMENTLOADER // nsIProgressEventSink NS_DECL_NSIPROGRESSEVENTSINK - NS_DECL_NSISECURITYEVENTSINK - // nsIRequestObserver methods: (for observing the load group) NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSIWEBPROGRESS NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSICHANNELEVENTSINK NS_DECL_NSISUPPORTSPRIORITY @@ -103,16 +99,33 @@ class nsDocLoader : public nsIDocumentLo // Weak pointer for the nsIWebProgressListener... nsWeakPtr mWeakListener; // Mask indicating which notifications the listener wants to receive. unsigned long mNotifyMask; }; + /** + * Fired when a security change occurs due to page transitions, + * or end document load. This interface should be called by + * a security package (eg Netscape Personal Security Manager) + * to notify nsIWebProgressListeners that security state has + * changed. State flags are in nsIWebProgressListener.idl + */ + void OnSecurityChange(nsISupports* aContext, uint32_t aState); + /** + * Fired when a content blocking event occurs during the time + * when a document is alive. This interface should be called + * by Gecko to notify nsIWebProgressListeners that there is a + * new content blocking event. Content blocking events are in + * nsIWebProgressListeners.idl. + */ + void OnContentBlockingEvent(nsISupports* aContext, uint32_t aEvent); + protected: virtual ~nsDocLoader(); virtual MOZ_MUST_USE nsresult SetDocLoaderParent(nsDocLoader* aLoader); bool IsBusy(); void Destroy();