mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 1514340
- Part 1: Add the nsISecurityEventSink::OnContentBlockingEvent() helper method; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D16051
This commit is contained in:
parent
46e587fc36
commit
5d7e383969
@ -5145,7 +5145,7 @@ void nsGlobalWindowOuter::NotifyContentBlockingState(unsigned aState,
|
||||
return;
|
||||
}
|
||||
|
||||
eventSink->OnSecurityChange(aChannel, state);
|
||||
eventSink->OnContentBlockingEvent(aChannel, state);
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
@ -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<nsIRequest> request = do_QueryInterface(aContext);
|
||||
nsIWebProgress* webProgress = static_cast<nsIWebProgress*>(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...
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user