Bug 931794 - startup crash in mozilla::dom::WindowBinding::get_content with Twitter Disconnect, Facebook Disconnect, or Google Disconnect on 2013-10-28 nightly. r=bz.
authorPeter Van der Beken <peterv@propagandism.org>
Mon, 28 Oct 2013 22:03:07 +0100
changeset 152617 a4455e4749a006bffcdf22941a9a5427741111c7
parent 152616 54930beea3298c97e585e363ebd2f91c0903d317
child 152618 bcda05da19cd1a9cb641d9f9cb22ed3bd6b98ff1
push id35596
push userpvanderbeken@mozilla.com
push dateTue, 29 Oct 2013 11:59:26 +0000
treeherdermozilla-inbound@bcda05da19cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs931794
milestone28.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 931794 - startup crash in mozilla::dom::WindowBinding::get_content with Twitter Disconnect, Facebook Disconnect, or Google Disconnect on 2013-10-28 nightly. r=bz.
dom/base/nsGlobalWindow.cpp
dom/webidl/Window.webidl
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -3683,23 +3683,23 @@ nsGlobalWindow::GetContent(JSContext* aC
 
   // Something tries to get .content on a ChromeWindow, try to fetch the CPOW.
   nsCOMPtr<nsIDocShellTreeOwner> treeOwner = GetTreeOwner();
   if (!treeOwner) {
     aError.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
-  JS::Rooted<JS::Value> val(aCx);
+  JS::Rooted<JS::Value> val(aCx, JS::NullValue());
   aError = treeOwner->GetContentWindow(aCx, val.address());
   if (aError.Failed()) {
     return nullptr;
   }
 
-  return &val.toObject();
+  return val.toObjectOrNull();
 }
 
 already_AddRefed<nsIDOMWindow>
 nsGlobalWindow::GetContentInternal(ErrorResult& aError)
 {
   // First check for a named frame named "content"
   nsCOMPtr<nsIDOMWindow> domWindow =
     GetChildWindow(NS_LITERAL_STRING("content"));
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -327,14 +327,14 @@ partial interface Window {
    * arguments, plus any additional arguments are passed on as
    * arguments on the dialog's window object (window.arguments).
    */
   [Throws] WindowProxy? openDialog(optional DOMString url = "",
                                    optional DOMString name = "",
                                    optional DOMString options = "",
                                    any... extraArguments);
 
-  [Replaceable, Throws] readonly attribute object content;
+  [Replaceable, Throws] readonly attribute object? content;
 };
 
 Window implements TouchEventHandlers;
 
 Window implements OnErrorEventHandlerForWindow;