Bug 1029866 - Rename InitUsingWin(...) to Init(...), r=bobowencode
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 25 Jun 2014 13:17:17 +0300
changeset 211563 85760b5abe33691fcd0d141a44162597dba6e3c5
parent 211562 990efda774885124e47aec65ef52f3e8cb63a3e4
child 211564 6cbfe5dd1a1db3f109e1a8633d5de47896ce1d55
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowencode
bugs1029866
milestone33.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 1029866 - Rename InitUsingWin(...) to Init(...), r=bobowencode
content/base/src/EventSource.cpp
content/base/src/WebSocket.cpp
content/base/src/nsContentUtils.cpp
content/base/src/nsDOMDataChannel.cpp
content/media/webaudio/AudioDestinationNode.cpp
content/media/webaudio/AudioProcessingEvent.cpp
content/media/webaudio/MediaBufferDecoder.cpp
content/media/webaudio/ScriptProcessorNode.cpp
dom/archivereader/ArchiveRequest.cpp
dom/base/ScriptSettings.cpp
dom/base/ScriptSettings.h
dom/bluetooth/BluetoothAdapter.cpp
dom/bluetooth/BluetoothDevice.cpp
dom/bluetooth/BluetoothManager.cpp
dom/bluetooth2/BluetoothAdapter.cpp
dom/bluetooth2/BluetoothDevice.cpp
dom/devicestorage/nsDeviceStorage.cpp
dom/icc/src/Icc.cpp
dom/workers/WorkerPrivate.cpp
--- a/content/base/src/EventSource.cpp
+++ b/content/base/src/EventSource.cpp
@@ -1233,17 +1233,17 @@ EventSource::DispatchAllMessageEvents()
   mGoingToDispatchAllMessages = false;
 
   nsresult rv = CheckInnerWindowCorrectness();
   if (NS_FAILED(rv)) {
     return;
   }
 
   AutoJSAPI jsapi;
-  if (NS_WARN_IF(!jsapi.InitUsingWin(GetOwner()))) {
+  if (NS_WARN_IF(!jsapi.Init(GetOwner()))) {
     return;
   }
   JSContext* cx = jsapi.cx();
 
   while (mMessagesToDispatch.GetSize() > 0) {
     nsAutoPtr<Message>
       message(static_cast<Message*>(mMessagesToDispatch.PopFront()));
 
--- a/content/base/src/WebSocket.cpp
+++ b/content/base/src/WebSocket.cpp
@@ -861,17 +861,17 @@ WebSocket::CreateAndDispatchMessageEvent
 {
   NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
 
   nsresult rv = CheckInnerWindowCorrectness();
   if (NS_FAILED(rv))
     return NS_OK;
 
   AutoJSAPI jsapi;
-  if (NS_WARN_IF(!jsapi.InitUsingWin(GetOwner()))) {
+  if (NS_WARN_IF(!jsapi.Init(GetOwner()))) {
     return NS_ERROR_FAILURE;
   }
   JSContext* cx = jsapi.cx();
 
   // Create appropriate JS object for message
   JS::Rooted<JS::Value> jsData(cx);
   if (isBinary) {
     if (mBinaryType == dom::BinaryType::Blob) {
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -6318,17 +6318,17 @@ nsContentUtils::GetContentSecurityPolicy
 // static
 bool
 nsContentUtils::IsPatternMatching(nsAString& aValue, nsAString& aPattern,
                                   nsIDocument* aDocument)
 {
   NS_ASSERTION(aDocument, "aDocument should be a valid pointer (not null)");
 
   AutoJSAPI jsapi;
-  if (NS_WARN_IF(!jsapi.InitUsingWin(aDocument->GetWindow()))) {
+  if (NS_WARN_IF(!jsapi.Init(aDocument->GetWindow()))) {
     return true;
   }
   JSContext* cx = jsapi.cx();
 
   // The pattern has to match the entire value.
   aPattern.Insert(NS_LITERAL_STRING("^(?:"), 0);
   aPattern.AppendLiteral(")$");
 
--- a/content/base/src/nsDOMDataChannel.cpp
+++ b/content/base/src/nsDOMDataChannel.cpp
@@ -379,17 +379,17 @@ nsDOMDataChannel::DoOnMessageAvailable(c
   LOG(("DoOnMessageAvailable%s\n",aBinary ? ((mBinaryType == DC_BINARY_TYPE_BLOB) ? " (blob)" : " (binary)") : ""));
 
   nsresult rv = CheckInnerWindowCorrectness();
   if (NS_FAILED(rv)) {
     return NS_OK;
   }
 
   AutoJSAPI jsapi;
-  if (NS_WARN_IF(!jsapi.InitUsingWin(GetOwner()))) {
+  if (NS_WARN_IF(!jsapi.Init(GetOwner()))) {
     return NS_ERROR_FAILURE;
   }
   JSContext* cx = jsapi.cx();
 
   JS::Rooted<JS::Value> jsData(cx);
 
   if (aBinary) {
     if (mBinaryType == DC_BINARY_TYPE_BLOB) {
--- a/content/media/webaudio/AudioDestinationNode.cpp
+++ b/content/media/webaudio/AudioDestinationNode.cpp
@@ -122,17 +122,17 @@ public:
   {
     AudioContext* context = aNode->Context();
     context->Shutdown();
     // Shutdown drops self reference, but the context is still referenced by aNode,
     // which is strongly referenced by the runnable that called
     // AudioDestinationNode::FireOfflineCompletionEvent.
 
     AutoJSAPI jsapi;
-    if (NS_WARN_IF(!jsapi.InitUsingWin(aNode->GetOwner()))) {
+    if (NS_WARN_IF(!jsapi.Init(aNode->GetOwner()))) {
       return;
     }
     JSContext* cx = jsapi.cx();
 
     // Create the input buffer
     ErrorResult rv;
     nsRefPtr<AudioBuffer> renderedBuffer =
       AudioBuffer::Create(context, mInputChannels.Length(),
--- a/content/media/webaudio/AudioProcessingEvent.cpp
+++ b/content/media/webaudio/AudioProcessingEvent.cpp
@@ -37,17 +37,17 @@ AudioProcessingEvent::WrapObject(JSConte
   return AudioProcessingEventBinding::Wrap(aCx, this);
 }
 
 already_AddRefed<AudioBuffer>
 AudioProcessingEvent::LazilyCreateBuffer(uint32_t aNumberOfChannels,
                                          ErrorResult& aRv)
 {
   AutoJSAPI jsapi;
-  if (NS_WARN_IF(!jsapi.InitUsingWin(mNode->GetOwner()))) {
+  if (NS_WARN_IF(!jsapi.Init(mNode->GetOwner()))) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return nullptr;
   }
   JSContext* cx = jsapi.cx();
 
   nsRefPtr<AudioBuffer> buffer =
     AudioBuffer::Create(mNode->Context(), aNumberOfChannels,
                         mNode->BufferSize(),
--- a/content/media/webaudio/MediaBufferDecoder.cpp
+++ b/content/media/webaudio/MediaBufferDecoder.cpp
@@ -409,17 +409,17 @@ MediaDecodeTask::CallbackTheResult()
 
 bool
 WebAudioDecodeJob::AllocateBuffer()
 {
   MOZ_ASSERT(!mOutput);
   MOZ_ASSERT(NS_IsMainThread());
 
   AutoJSAPI jsapi;
-  if (NS_WARN_IF(!jsapi.InitUsingWin(mContext->GetOwner()))) {
+  if (NS_WARN_IF(!jsapi.Init(mContext->GetOwner()))) {
     return false;
   }
   JSContext* cx = jsapi.cx();
 
   // Now create the AudioBuffer
   ErrorResult rv;
   mOutput = AudioBuffer::Create(mContext, mChannelBuffers.Length(),
                                 mWriteIndex, mContext->SampleRate(), cx, rv);
--- a/content/media/webaudio/ScriptProcessorNode.cpp
+++ b/content/media/webaudio/ScriptProcessorNode.cpp
@@ -398,17 +398,17 @@ private:
           MutexAutoLock lock(mStream->Engine()->NodeMutex());
           node = static_cast<ScriptProcessorNode*>(mStream->Engine()->Node());
         }
         if (!node || !node->Context()) {
           return NS_OK;
         }
 
         AutoJSAPI jsapi;
-        if (NS_WARN_IF(!jsapi.InitUsingWin(node->GetOwner()))) {
+        if (NS_WARN_IF(!jsapi.Init(node->GetOwner()))) {
           return NS_OK;
         }
         JSContext* cx = jsapi.cx();
 
         // Create the input buffer
         nsRefPtr<AudioBuffer> inputBuffer;
         if (!mNullInput) {
           ErrorResult rv;
--- a/dom/archivereader/ArchiveRequest.cpp
+++ b/dom/archivereader/ArchiveRequest.cpp
@@ -127,17 +127,17 @@ ArchiveRequest::ReaderReady(nsTArray<nsC
   if (NS_FAILED(aStatus)) {
     FireError(aStatus);
     return NS_OK;
   }
 
   nsresult rv;
 
   AutoJSAPI jsapi;
-  if (NS_WARN_IF(!jsapi.InitUsingWin(GetOwner()))) {
+  if (NS_WARN_IF(!jsapi.Init(GetOwner()))) {
     return NS_ERROR_UNEXPECTED;
   }
   JSContext* cx = jsapi.cx();
 
   JS::Rooted<JS::Value> result(cx);
   switch (mOperation) {
     case GetFilenames:
       rv = GetFilenamesResult(cx, result.address(), aFileList);
--- a/dom/base/ScriptSettings.cpp
+++ b/dom/base/ScriptSettings.cpp
@@ -289,33 +289,51 @@ bool
 AutoJSAPI::InitWithLegacyErrorReporting(nsIGlobalObject* aGlobalObject)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   return Init(aGlobalObject, FindJSContext(aGlobalObject));
 }
 
 bool
-AutoJSAPI::InitUsingWin(nsPIDOMWindow* aWindow, JSContext* aCx)
+AutoJSAPI::Init(nsPIDOMWindow* aWindow, JSContext* aCx)
 {
   return Init(static_cast<nsGlobalWindow*>(aWindow), aCx);
 }
 
 bool
-AutoJSAPI::InitUsingWin(nsPIDOMWindow* aWindow)
+AutoJSAPI::Init(nsPIDOMWindow* aWindow)
 {
   return Init(static_cast<nsGlobalWindow*>(aWindow));
 }
 
 bool
-AutoJSAPI::InitWithLegacyErrorReportingUsingWin(nsPIDOMWindow* aWindow)
+AutoJSAPI::Init(nsGlobalWindow* aWindow, JSContext* aCx)
+{
+  return Init(static_cast<nsIGlobalObject*>(aWindow), aCx);
+}
+
+bool
+AutoJSAPI::Init(nsGlobalWindow* aWindow)
+{
+  return Init(static_cast<nsIGlobalObject*>(aWindow));
+}
+
+bool
+AutoJSAPI::InitWithLegacyErrorReporting(nsPIDOMWindow* aWindow)
 {
   return InitWithLegacyErrorReporting(static_cast<nsGlobalWindow*>(aWindow));
 }
 
+bool
+AutoJSAPI::InitWithLegacyErrorReporting(nsGlobalWindow* aWindow)
+{
+  return InitWithLegacyErrorReporting(static_cast<nsIGlobalObject*>(aWindow));
+}
+
 AutoEntryScript::AutoEntryScript(nsIGlobalObject* aGlobalObject,
                                  bool aIsMainThread,
                                  JSContext* aCx)
   : AutoJSAPI(aGlobalObject, aIsMainThread,
               aCx ? aCx : FindJSContext(aGlobalObject))
   , ScriptSettingsStackEntry(aGlobalObject, /* aCandidate = */ true)
   , mWebIDLCallerPrincipal(nullptr)
 {
--- a/dom/base/ScriptSettings.h
+++ b/dom/base/ScriptSettings.h
@@ -12,16 +12,17 @@
 #include "nsCxPusher.h"
 #include "MainThreadUtils.h"
 #include "nsIGlobalObject.h"
 #include "nsIPrincipal.h"
 
 #include "mozilla/Maybe.h"
 
 class nsPIDOMWindow;
+class nsGlobalWindow;
 
 namespace mozilla {
 namespace dom {
 
 /*
  * System-wide setup/teardown routines. Init and Destroy should be invoked
  * once each, at startup and shutdown (respectively).
  */
@@ -149,21 +150,26 @@ public:
   // it uses the SafeJSContext. It then enters the compartment of aGlobalObject.
   // This means that existing error reporting mechanisms that use the JSContext
   // to find the JSErrorReporter should still work as before.
   // We should be able to remove this around bug 981198.
   // If aGlobalObject or its associated JS global are null then it returns
   // false and use of cx() will cause an assertion.
   bool InitWithLegacyErrorReporting(nsIGlobalObject* aGlobalObject);
 
-  // Convenience functions to take an nsPIDOMWindow*, when it is more easily
-  // available than an nsIGlobalObject.
-  bool InitUsingWin(nsPIDOMWindow* aWindow);
-  bool InitUsingWin(nsPIDOMWindow* aWindow, JSContext* aCx);
-  bool InitWithLegacyErrorReportingUsingWin(nsPIDOMWindow* aWindow);
+  // Convenience functions to take an nsPIDOMWindow* or nsGlobalWindow*,
+  // when it is more easily available than an nsIGlobalObject.
+  bool Init(nsPIDOMWindow* aWindow);
+  bool Init(nsPIDOMWindow* aWindow, JSContext* aCx);
+
+  bool Init(nsGlobalWindow* aWindow);
+  bool Init(nsGlobalWindow* aWindow, JSContext* aCx);
+
+  bool InitWithLegacyErrorReporting(nsPIDOMWindow* aWindow);
+  bool InitWithLegacyErrorReporting(nsGlobalWindow* aWindow);
 
   JSContext* cx() const {
     MOZ_ASSERT(mCx, "Must call Init before using an AutoJSAPI");
     return mCx;
   }
 
   bool CxPusherIsStackTop() { return mCxPusher.ref().IsStackTop(); }
 
--- a/dom/bluetooth/BluetoothAdapter.cpp
+++ b/dom/bluetooth/BluetoothAdapter.cpp
@@ -91,17 +91,17 @@ public:
       nsRefPtr<BluetoothDevice> d =
         BluetoothDevice::Create(mAdapterPtr->GetOwner(),
                                 mAdapterPtr->GetPath(),
                                 properties);
       devices.AppendElement(d);
     }
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(mAdapterPtr->GetOwner())) {
+    if (!jsapi.Init(mAdapterPtr->GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       SetError(NS_LITERAL_STRING("BluetoothAutoJSAPIInitError"));
       return false;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> JsDevices(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, devices, &JsDevices))) {
       BT_WARNING("Cannot create JS array!");
@@ -247,33 +247,33 @@ BluetoothAdapter::SetPropertyByValue(con
   } else if (name.EqualsLiteral("DiscoverableTimeout")) {
     mDiscoverableTimeout = value.get_uint32_t();
   } else if (name.EqualsLiteral("Class")) {
     mClass = value.get_uint32_t();
   } else if (name.EqualsLiteral("UUIDs")) {
     mUuids = value.get_ArrayOfnsString();
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(GetOwner())) {
+    if (!jsapi.Init(GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       return;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> uuids(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, mUuids, &uuids))) {
       BT_WARNING("Cannot set JS UUIDs object!");
       return;
     }
     mJsUuids = uuids;
     Root();
   } else if (name.EqualsLiteral("Devices")) {
     mDeviceAddresses = value.get_ArrayOfnsString();
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(GetOwner())) {
+    if (!jsapi.Init(GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       return;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> deviceAddresses(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, mDeviceAddresses, &deviceAddresses))) {
       BT_WARNING("Cannot set JS Devices object!");
       return;
--- a/dom/bluetooth/BluetoothDevice.cpp
+++ b/dom/bluetooth/BluetoothDevice.cpp
@@ -127,33 +127,33 @@ BluetoothDevice::SetPropertyByValue(cons
   } else if (name.EqualsLiteral("Connected")) {
     mConnected = value.get_bool();
   } else if (name.EqualsLiteral("Paired")) {
     mPaired = value.get_bool();
   } else if (name.EqualsLiteral("UUIDs")) {
     mUuids = value.get_ArrayOfnsString();
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(GetOwner())) {
+    if (!jsapi.Init(GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       return;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> uuids(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, mUuids, &uuids))) {
       BT_WARNING("Cannot set JS UUIDs object!");
       return;
     }
     mJsUuids = uuids;
     Root();
   } else if (name.EqualsLiteral("Services")) {
     mServices = value.get_ArrayOfnsString();
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(GetOwner())) {
+    if (!jsapi.Init(GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       return;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> services(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, mServices, &services))) {
       BT_WARNING("Cannot set JS Services object!");
       return;
--- a/dom/bluetooth/BluetoothManager.cpp
+++ b/dom/bluetooth/BluetoothManager.cpp
@@ -64,17 +64,17 @@ public:
     }
 
     const InfallibleTArray<BluetoothNamedValue>& values =
       v.get_ArrayOfBluetoothNamedValue();
     nsRefPtr<BluetoothAdapter> adapter =
       BluetoothAdapter::Create(mManagerPtr->GetOwner(), values);
 
     dom::AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(mManagerPtr->GetOwner())) {
+    if (!jsapi.Init(mManagerPtr->GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       SetError(NS_LITERAL_STRING("BluetoothAutoJSAPIInitError"));
       return false;
     }
     JSContext* cx = jsapi.cx();
     if (NS_FAILED(nsContentUtils::WrapNative(cx, adapter, aValue))) {
       BT_WARNING("Cannot create native object!");
       SetError(NS_LITERAL_STRING("BluetoothNativeObjectError"));
--- a/dom/bluetooth2/BluetoothAdapter.cpp
+++ b/dom/bluetooth2/BluetoothAdapter.cpp
@@ -90,17 +90,17 @@ public:
       }
       nsRefPtr<BluetoothDevice> d =
         BluetoothDevice::Create(mAdapterPtr->GetOwner(),
                                 properties);
       devices.AppendElement(d);
     }
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(mAdapterPtr->GetOwner())) {
+    if (!jsapi.Init(mAdapterPtr->GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       SetError(NS_LITERAL_STRING("BluetoothAutoJSAPIInitError"));
       return false;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> JsDevices(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, devices, &JsDevices))) {
       BT_WARNING("Cannot create JS array!");
@@ -249,33 +249,33 @@ BluetoothAdapter::SetPropertyByValue(con
   } else if (name.EqualsLiteral("DiscoverableTimeout")) {
     mDiscoverableTimeout = value.get_uint32_t();
   } else if (name.EqualsLiteral("Class")) {
     mClass = value.get_uint32_t();
   } else if (name.EqualsLiteral("UUIDs")) {
     mUuids = value.get_ArrayOfnsString();
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(GetOwner())) {
+    if (!jsapi.Init(GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       return;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> uuids(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, mUuids, &uuids))) {
       BT_WARNING("Cannot set JS UUIDs object!");
       return;
     }
     mJsUuids = uuids;
     Root();
   } else if (name.EqualsLiteral("Devices")) {
     mDeviceAddresses = value.get_ArrayOfnsString();
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(GetOwner())) {
+    if (!jsapi.Init(GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       return;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> deviceAddresses(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, mDeviceAddresses, &deviceAddresses))) {
       BT_WARNING("Cannot set JS Devices object!");
       return;
--- a/dom/bluetooth2/BluetoothDevice.cpp
+++ b/dom/bluetooth2/BluetoothDevice.cpp
@@ -121,33 +121,33 @@ BluetoothDevice::SetPropertyByValue(cons
   } else if (name.EqualsLiteral("Connected")) {
     mConnected = value.get_bool();
   } else if (name.EqualsLiteral("Paired")) {
     mPaired = value.get_bool();
   } else if (name.EqualsLiteral("UUIDs")) {
     mUuids = value.get_ArrayOfnsString();
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(GetOwner())) {
+    if (!jsapi.Init(GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       return;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> uuids(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, mUuids, &uuids))) {
       BT_WARNING("Cannot set JS UUIDs object!");
       return;
     }
     mJsUuids = uuids;
     Root();
   } else if (name.EqualsLiteral("Services")) {
     mServices = value.get_ArrayOfnsString();
 
     AutoJSAPI jsapi;
-    if (!jsapi.InitUsingWin(GetOwner())) {
+    if (!jsapi.Init(GetOwner())) {
       BT_WARNING("Failed to initialise AutoJSAPI!");
       return;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> services(cx);
     if (NS_FAILED(nsTArrayToJSArray(cx, mServices, &services))) {
       BT_WARNING("Cannot set JS Services object!");
       return;
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -1721,17 +1721,17 @@ nsIFileToJsval(nsPIDOMWindow* aWindow, D
 }
 
 JS::Value StringToJsval(nsPIDOMWindow* aWindow, nsAString& aString)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aWindow);
 
   AutoJSAPI jsapi;
-  if (NS_WARN_IF(!jsapi.InitUsingWin(aWindow))) {
+  if (NS_WARN_IF(!jsapi.Init(aWindow))) {
     return JSVAL_NULL;
   }
   JSContext* cx = jsapi.cx();
 
   JS::Rooted<JS::Value> result(cx);
   if (!xpc::StringToJsval(cx, aString, &result)) {
     return JSVAL_NULL;
   }
--- a/dom/icc/src/Icc.cpp
+++ b/dom/icc/src/Icc.cpp
@@ -44,17 +44,17 @@ Icc::NotifyEvent(const nsAString& aName)
 {
   return DispatchTrustedEvent(aName);
 }
 
 nsresult
 Icc::NotifyStkEvent(const nsAString& aName, const nsAString& aMessage)
 {
   AutoJSAPI jsapi;
-  if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReportingUsingWin(GetOwner()))) {
+  if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(GetOwner()))) {
     return NS_ERROR_UNEXPECTED;
   }
   JSContext* cx = jsapi.cx();
   JS::Rooted<JS::Value> value(cx);
 
   if (!aMessage.IsEmpty()) {
     nsCOMPtr<nsIJSON> json(new nsJSON());
     nsresult rv = json->DecodeToJSVal(aMessage, cx, &value);
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3133,17 +3133,17 @@ WorkerPrivateParent<Derived>::BroadcastE
     nsRefPtr<SharedWorker>& sharedWorker = sharedWorkers[index];
 
     // May be null.
     nsPIDOMWindow* window = sharedWorker->GetOwner();
 
     size_t actionsIndex = windowActions.LastIndexOf(WindowAction(window));
 
     AutoJSAPI jsapi;
-    if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReportingUsingWin(sharedWorker->GetOwner()))) {
+    if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(sharedWorker->GetOwner()))) {
       continue;
     }
     JSContext* cx = jsapi.cx();
 
     RootedDictionary<ErrorEventInit> errorInit(aCx);
     errorInit.mBubbles = false;
     errorInit.mCancelable = true;
     errorInit.mMessage = aMessage;