diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp index 956bb7bc6cea..bf9a86a1c54f 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -5145,7 +5145,7 @@ void nsGlobalWindowOuter::NotifyContentBlockingState(unsigned aState, return; } - eventSink->OnSecurityChange(aChannel, state); + eventSink->OnContentBlockingEvent(aChannel, state); } // static diff --git a/netwerk/base/nsISecurityEventSink.idl b/netwerk/base/nsISecurityEventSink.idl index d824fe5a7f0b..fdefded1e79c 100644 --- a/netwerk/base/nsISecurityEventSink.idl +++ b/netwerk/base/nsISecurityEventSink.idl @@ -19,6 +19,15 @@ interface nsISecurityEventSink : nsISupports */ 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); }; diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index 28a5150259fc..40e87c23f20c 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -1412,6 +1412,25 @@ NS_IMETHODIMP nsDocLoader::OnSecurityChange(nsISupports* aContext, return NS_OK; } +NS_IMETHODIMP nsDocLoader::OnContentBlockingEvent(nsISupports* aContext, + uint32_t aEvent) { + // + // Fire progress notifications out to any registered nsIWebProgressListeners. + // + + nsCOMPtr request = do_QueryInterface(aContext); + nsIWebProgress* webProgress = static_cast(this); + + NOTIFY_LISTENERS(nsIWebProgress::NOTIFY_SECURITY, + listener->OnSecurityChange(webProgress, request, aEvent);); + + // Pass the notification up to the parent... + if (mParent) { + mParent->OnContentBlockingEvent(aContext, aEvent); + } + return NS_OK; +} + /* * Implementation of nsISupportsPriority methods... *