Bug 758401 - Add a way to get message manager from docshell, r=jst
This commit is contained in:
@@ -190,6 +190,7 @@
|
||||
#include "nsDOMNavigationTiming.h"
|
||||
#include "nsITimedChannel.h"
|
||||
#include "mozilla/StartupTimeline.h"
|
||||
#include "nsIFrameMessageManager.h"
|
||||
|
||||
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID,
|
||||
NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
|
||||
@@ -1057,6 +1058,22 @@ NS_IMETHODIMP nsDocShell::GetInterface(const nsIID & aIID, void **aSink)
|
||||
return ir->GetInterface(aIID, aSink);
|
||||
}
|
||||
}
|
||||
else if (aIID.Equals(NS_GET_IID(nsIContentFrameMessageManager))) {
|
||||
nsCOMPtr<nsITabChild> tabChild =
|
||||
do_GetInterface(static_cast<nsIDocShell*>(this));
|
||||
nsCOMPtr<nsIContentFrameMessageManager> mm;
|
||||
if (tabChild) {
|
||||
tabChild->
|
||||
GetMessageManager(getter_AddRefs(mm));
|
||||
} else {
|
||||
nsCOMPtr<nsPIDOMWindow> win =
|
||||
do_GetInterface(static_cast<nsIDocShell*>(this));
|
||||
if (win) {
|
||||
mm = do_QueryInterface(win->GetParentTarget());
|
||||
}
|
||||
}
|
||||
*aSink = mm.get();
|
||||
}
|
||||
else {
|
||||
return nsDocLoader::GetInterface(aIID, aSink);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user