Bug 1542787 - Support getting contentWindow on out-of-process frames, r=peterv
authorNika Layzell <nika@thelayzells.com>
Thu, 11 Apr 2019 18:56:48 +0000
changeset 469521 ca2c4053e33c
parent 469520 7d6cd4e20705
child 469522 fdbd2c02f391
push id35873
push userccoroiu@mozilla.com
push dateMon, 15 Apr 2019 21:36:26 +0000
treeherdermozilla-central@b8f49a14c458 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1542787
milestone68.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
Bug 1542787 - Support getting contentWindow on out-of-process frames, r=peterv Differential Revision: https://phabricator.services.mozilla.com/D26556
dom/html/nsGenericHTMLFrameElement.cpp
--- a/dom/html/nsGenericHTMLFrameElement.cpp
+++ b/dom/html/nsGenericHTMLFrameElement.cpp
@@ -104,22 +104,18 @@ BrowsingContext* nsGenericHTMLFrameEleme
     return nullptr;
   }
 
   if (mFrameLoader->DepthTooGreat()) {
     // Claim to have no contentWindow
     return nullptr;
   }
 
-  RefPtr<nsDocShell> doc_shell = mFrameLoader->GetDocShell(IgnoreErrors());
-  if (!doc_shell) {
-    return nullptr;
-  }
-
-  return doc_shell->GetBrowsingContext();
+  RefPtr<BrowsingContext> bc = mFrameLoader->GetBrowsingContext();
+  return bc;
 }
 
 Nullable<WindowProxyHolder> nsGenericHTMLFrameElement::GetContentWindow() {
   RefPtr<BrowsingContext> bc = GetContentWindowInternal();
   if (!bc) {
     return nullptr;
   }
   return WindowProxyHolder(bc);