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 469533 ca2c4053e33c353f361daa7036ebf7a9a960c50a
parent 469532 7d6cd4e207055a667e1136ba200603f2420c671c
child 469534 fdbd2c02f391e03ca2e12438defedbb7828966b9
push id112801
push userccoroiu@mozilla.com
push dateMon, 15 Apr 2019 21:40:09 +0000
treeherdermozilla-inbound@afb20612c0e5 [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);