Merge mozilla-inbound to mozilla-central a=merge
authorDaniel Varga <dvarga@mozilla.com>
Mon, 10 Sep 2018 12:41:41 +0300
changeset 491089 75cc42919ab2
parent 491085 bda5c062ad28 (current diff)
parent 491088 f33e65ea17cf (diff)
child 491093 0fc2c58dd7ae
child 491112 edac97821b08
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone64.0a1
first release with
nightly linux32
75cc42919ab2 / 64.0a1 / 20180910100056 / files
nightly linux64
75cc42919ab2 / 64.0a1 / 20180910100056 / files
nightly mac
75cc42919ab2 / 64.0a1 / 20180910100056 / files
nightly win32
75cc42919ab2 / 64.0a1 / 20180910100056 / files
nightly win64
75cc42919ab2 / 64.0a1 / 20180910100056 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-inbound to mozilla-central a=merge
--- a/docshell/base/nsDocShellEditorData.cpp
+++ b/docshell/base/nsDocShellEditorData.cpp
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDocShellEditorData.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsPIDOMWindow.h"
 #include "nsIEditor.h"
-#include "nsIEditingSession.h"
+#include "nsEditingSession.h"
 #include "nsIDocShell.h"
 
 using namespace mozilla;
 
 nsDocShellEditorData::nsDocShellEditorData(nsIDocShell* aOwningDocShell)
   : mDocShell(aOwningDocShell)
   , mDetachedEditingState(nsIHTMLDocument::eOff)
   , mMakeEditable(false)
@@ -85,18 +85,17 @@ nsDocShellEditorData::CreateEditor()
   }
 
   return NS_OK;
 }
 
 nsresult
 nsDocShellEditorData::GetEditingSession(nsIEditingSession** aResult)
 {
-  nsresult rv = EnsureEditingSession();
-  NS_ENSURE_SUCCESS(rv, rv);
+  EnsureEditingSession();
 
   NS_ADDREF(*aResult = mEditingSession);
 
   return NS_OK;
 }
 
 nsresult
 nsDocShellEditorData::SetHTMLEditor(HTMLEditor* aHTMLEditor)
@@ -119,30 +118,25 @@ nsDocShellEditorData::SetHTMLEditor(HTML
   if (!mHTMLEditor) {
     mMakeEditable = false;
   }
 
   return NS_OK;
 }
 
 // This creates the editing session on the content docShell that owns 'this'.
-nsresult
+void
 nsDocShellEditorData::EnsureEditingSession()
 {
   NS_ASSERTION(mDocShell, "Should have docShell here");
   NS_ASSERTION(!mIsDetached, "This will stomp editing session!");
 
-  nsresult rv = NS_OK;
-
   if (!mEditingSession) {
-    mEditingSession =
-      do_CreateInstance("@mozilla.org/editor/editingsession;1", &rv);
+    mEditingSession = new nsEditingSession();
   }
-
-  return rv;
 }
 
 nsresult
 nsDocShellEditorData::DetachFromWindow()
 {
   NS_ASSERTION(mEditingSession,
                "Can't detach when we don't have a session to detach!");
 
--- a/docshell/base/nsDocShellEditorData.h
+++ b/docshell/base/nsDocShellEditorData.h
@@ -33,17 +33,17 @@ public:
   }
   nsresult SetHTMLEditor(mozilla::HTMLEditor* aHTMLEditor);
   void TearDownEditor();
   nsresult DetachFromWindow();
   nsresult ReattachToWindow(nsIDocShell* aDocShell);
   bool WaitingForLoad() const { return mMakeEditable; }
 
 protected:
-  nsresult EnsureEditingSession();
+  void EnsureEditingSession();
 
   // The doc shell that owns us. Weak ref, since it always outlives us.
   nsIDocShell* mDocShell;
 
   // Only present for the content root docShell. Session is owned here.
   nsCOMPtr<nsIEditingSession> mEditingSession;
 
   // If this frame is editable, store HTML editor here. It's owned here.
--- a/editor/composer/moz.build
+++ b/editor/composer/moz.build
@@ -15,16 +15,20 @@ XPIDL_SOURCES += [
 XPIDL_MODULE = 'composer'
 
 UNIFIED_SOURCES += [
     'ComposerCommandsUpdater.cpp',
     'nsComposerRegistration.cpp',
     'nsEditingSession.cpp',
 ]
 
+EXPORTS += [
+    'nsEditingSession.h',
+]
+
 EXPORTS.mozilla += [
     'ComposerCommandsUpdater.h',
 ]
 
 # Needed because we include HTMLEditor.h which indirectly includes nsDocument.h
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/html',  # For nsHTMLDocument
--- a/editor/composer/nsComposerRegistration.cpp
+++ b/editor/composer/nsComposerRegistration.cpp
@@ -8,17 +8,16 @@
 #include "mozilla/Module.h"             // for Module, Module::CIDEntry, etc
 #include "mozilla/ModuleUtils.h"
 #include "mozilla/mozalloc.h"           // for operator new
 #include "nsCOMPtr.h"                   // for nsCOMPtr, getter_AddRefs, etc
 #include "nsBaseCommandController.h"    // for nsBaseCommandController
 #include "nsComponentManagerUtils.h"    // for do_CreateInstance
 #include "nsComposeTxtSrvFilter.h"      // for nsComposeTxtSrvFilter, etc
 #include "nsDebug.h"                    // for NS_ENSURE_SUCCESS
-#include "nsEditingSession.h"           // for NS_EDITINGSESSION_CID, etc
 #include "nsError.h"                    // for NS_ERROR_NO_AGGREGATION, etc
 #include "nsIController.h"              // for nsIController
 #include "nsIControllerCommandTable.h"  // for nsIControllerCommandTable, etc
 #include "nsIControllerContext.h"       // for nsIControllerContext
 #include "nsID.h"                       // for NS_DEFINE_NAMED_CID, etc
 #include "nsISupportsImpl.h"
 #include "nsISupportsUtils.h"           // for NS_ADDREF, NS_RELEASE
 #include "nsServiceManagerUtils.h"      // for do_GetService
@@ -40,17 +39,16 @@ static NS_DEFINE_CID(kHTMLEditorDocState
 
 
 ////////////////////////////////////////////////////////////////////////
 // Define the contructor function for the objects
 //
 // NOTE: This creates an instance of objects by using the default constructor
 //
 
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditingSession)
 NS_GENERIC_FACTORY_CONSTRUCTOR(EditorSpellCheck)
 
 // There are no macros that enable us to have 2 constructors
 // for the same object
 //
 // Here we are creating the same object with two different contract IDs
 // and then initializing it different.
 // Basically, we need to tell the filter whether it is doing mail or not
@@ -185,38 +183,35 @@ nsHTMLEditorDocStateCommandTableConstruc
 
   return commandTable->QueryInterface(aIID, aResult);
 }
 
 NS_DEFINE_NAMED_CID(NS_HTMLEDITORCONTROLLER_CID);
 NS_DEFINE_NAMED_CID(NS_EDITORDOCSTATECONTROLLER_CID);
 NS_DEFINE_NAMED_CID(NS_HTMLEDITOR_COMMANDTABLE_CID);
 NS_DEFINE_NAMED_CID(NS_HTMLEDITOR_DOCSTATE_COMMANDTABLE_CID);
-NS_DEFINE_NAMED_CID(NS_EDITINGSESSION_CID);
 NS_DEFINE_NAMED_CID(NS_EDITORSPELLCHECK_CID);
 NS_DEFINE_NAMED_CID(NS_COMPOSERTXTSRVFILTER_CID);
 NS_DEFINE_NAMED_CID(NS_COMPOSERTXTSRVFILTERMAIL_CID);
 
 
 static const mozilla::Module::CIDEntry kComposerCIDs[] = {
   { &kNS_HTMLEDITORCONTROLLER_CID, false, nullptr, nsHTMLEditorControllerConstructor },
   { &kNS_EDITORDOCSTATECONTROLLER_CID, false, nullptr, nsHTMLEditorDocStateControllerConstructor },
   { &kNS_HTMLEDITOR_COMMANDTABLE_CID, false, nullptr, nsHTMLEditorCommandTableConstructor },
   { &kNS_HTMLEDITOR_DOCSTATE_COMMANDTABLE_CID, false, nullptr, nsHTMLEditorDocStateCommandTableConstructor },
-  { &kNS_EDITINGSESSION_CID, false, nullptr, nsEditingSessionConstructor },
   { &kNS_EDITORSPELLCHECK_CID, false, nullptr, EditorSpellCheckConstructor },
   { &kNS_COMPOSERTXTSRVFILTER_CID, false, nullptr, nsComposeTxtSrvFilterConstructorForComposer },
   { &kNS_COMPOSERTXTSRVFILTERMAIL_CID, false, nullptr, nsComposeTxtSrvFilterConstructorForMail },
   { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kComposerContracts[] = {
   { "@mozilla.org/editor/htmleditorcontroller;1", &kNS_HTMLEDITORCONTROLLER_CID },
   { "@mozilla.org/editor/editordocstatecontroller;1", &kNS_EDITORDOCSTATECONTROLLER_CID },
-  { "@mozilla.org/editor/editingsession;1", &kNS_EDITINGSESSION_CID },
   { "@mozilla.org/editor/editorspellchecker;1", &kNS_EDITORSPELLCHECK_CID },
   { COMPOSER_TXTSRVFILTER_CONTRACTID, &kNS_COMPOSERTXTSRVFILTER_CID },
   { COMPOSER_TXTSRVFILTERMAIL_CONTRACTID, &kNS_COMPOSERTXTSRVFILTERMAIL_CID },
   { nullptr }
 };
 
 static const mozilla::Module kComposerModule = {
   mozilla::Module::kVersion,
--- a/editor/composer/nsEditingSession.h
+++ b/editor/composer/nsEditingSession.h
@@ -26,21 +26,16 @@
 #endif
 
 #include "nsString.h"                   // for nsCString
 
 class mozIDOMWindowProxy;
 class nsIDOMWindow;
 class nsISupports;
 class nsITimer;
-
-#define NS_EDITINGSESSION_CID                            \
-{ 0xbc26ff01, 0xf2bd, 0x11d4, { 0xa7, 0x3c, 0xe5, 0xa4, 0xb5, 0xa8, 0xbd, 0xfc } }
-
-
 class nsIChannel;
 class nsIControllers;
 class nsIDocShell;
 class nsIEditor;
 class nsIWebProgress;
 
 namespace mozilla {
 class ComposerCommandsUpdater;
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/debug/bug1434391.js
@@ -0,0 +1,9 @@
+if (!('oomTest' in this))
+    quit();
+
+var g = newGlobal();
+var dbg = new Debugger();
+var gw = dbg.addDebuggee(g);
+oomTest(function () {
+    assertEq(gw.executeInGlobal("(42).toString(0)").throw.errorMessageName, "JSMSG_BAD_RADIX");
+});
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -10306,19 +10306,18 @@ DebuggerObject::getErrorMessageName(JSCo
 
     const JSErrorFormatString* efs = GetErrorMessage(nullptr, report->errorNumber);
     if (!efs) {
         result.set(nullptr);
         return true;
     }
 
     RootedString str(cx, JS_NewStringCopyZ(cx, efs->name));
-    if (!cx->compartment()->wrap(cx, &str))
-        return false;
-
+    if (!str)
+        return false;
     result.set(str);
     return true;
 }
 
 /* static */ bool
 DebuggerObject::getErrorNotes(JSContext* cx, HandleDebuggerObject object,
                               MutableHandleValue result)
 {