mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1029866 - Rename InitUsingWin(...) to Init(...), r=bobowencode
--HG-- extra : rebase_source : e04aac99fe64270f283cf49ed52b8f7512a2fa3b
This commit is contained in:
parent
eff7f162b1
commit
2091da9022
@ -1238,7 +1238,7 @@ EventSource::DispatchAllMessageEvents()
|
||||
}
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (NS_WARN_IF(!jsapi.InitUsingWin(GetOwner()))) {
|
||||
if (NS_WARN_IF(!jsapi.Init(GetOwner()))) {
|
||||
return;
|
||||
}
|
||||
JSContext* cx = jsapi.cx();
|
||||
|
@ -866,7 +866,7 @@ WebSocket::CreateAndDispatchMessageEvent(const nsACString& aData,
|
||||
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();
|
||||
|
@ -6323,7 +6323,7 @@ nsContentUtils::IsPatternMatching(nsAString& aValue, nsAString& aPattern,
|
||||
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();
|
||||
|
@ -384,7 +384,7 @@ nsDOMDataChannel::DoOnMessageAvailable(const nsACString& aData,
|
||||
}
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (NS_WARN_IF(!jsapi.InitUsingWin(GetOwner()))) {
|
||||
if (NS_WARN_IF(!jsapi.Init(GetOwner()))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
JSContext* cx = jsapi.cx();
|
||||
|
@ -127,7 +127,7 @@ public:
|
||||
// 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();
|
||||
|
@ -42,7 +42,7 @@ 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;
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ WebAudioDecodeJob::AllocateBuffer()
|
||||
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();
|
||||
|
@ -403,7 +403,7 @@ private:
|
||||
}
|
||||
|
||||
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();
|
||||
|
@ -132,7 +132,7 @@ ArchiveRequest::ReaderReady(nsTArray<nsCOMPtr<nsIDOMFile> >& aFileList,
|
||||
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();
|
||||
|
@ -294,23 +294,41 @@ AutoJSAPI::InitWithLegacyErrorReporting(nsIGlobalObject* 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)
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "mozilla/Maybe.h"
|
||||
|
||||
class nsPIDOMWindow;
|
||||
class nsGlobalWindow;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@ -154,11 +155,16 @@ public:
|
||||
// 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");
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
}
|
||||
|
||||
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;
|
||||
@ -252,7 +252,7 @@ BluetoothAdapter::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
mUuids = value.get_ArrayOfnsString();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.InitUsingWin(GetOwner())) {
|
||||
if (!jsapi.Init(GetOwner())) {
|
||||
BT_WARNING("Failed to initialise AutoJSAPI!");
|
||||
return;
|
||||
}
|
||||
@ -268,7 +268,7 @@ BluetoothAdapter::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
mDeviceAddresses = value.get_ArrayOfnsString();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.InitUsingWin(GetOwner())) {
|
||||
if (!jsapi.Init(GetOwner())) {
|
||||
BT_WARNING("Failed to initialise AutoJSAPI!");
|
||||
return;
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ BluetoothDevice::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
mUuids = value.get_ArrayOfnsString();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.InitUsingWin(GetOwner())) {
|
||||
if (!jsapi.Init(GetOwner())) {
|
||||
BT_WARNING("Failed to initialise AutoJSAPI!");
|
||||
return;
|
||||
}
|
||||
@ -148,7 +148,7 @@ BluetoothDevice::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
mServices = value.get_ArrayOfnsString();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.InitUsingWin(GetOwner())) {
|
||||
if (!jsapi.Init(GetOwner())) {
|
||||
BT_WARNING("Failed to initialise AutoJSAPI!");
|
||||
return;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
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;
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
}
|
||||
|
||||
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;
|
||||
@ -254,7 +254,7 @@ BluetoothAdapter::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
mUuids = value.get_ArrayOfnsString();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.InitUsingWin(GetOwner())) {
|
||||
if (!jsapi.Init(GetOwner())) {
|
||||
BT_WARNING("Failed to initialise AutoJSAPI!");
|
||||
return;
|
||||
}
|
||||
@ -270,7 +270,7 @@ BluetoothAdapter::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
mDeviceAddresses = value.get_ArrayOfnsString();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.InitUsingWin(GetOwner())) {
|
||||
if (!jsapi.Init(GetOwner())) {
|
||||
BT_WARNING("Failed to initialise AutoJSAPI!");
|
||||
return;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ BluetoothDevice::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
mUuids = value.get_ArrayOfnsString();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.InitUsingWin(GetOwner())) {
|
||||
if (!jsapi.Init(GetOwner())) {
|
||||
BT_WARNING("Failed to initialise AutoJSAPI!");
|
||||
return;
|
||||
}
|
||||
@ -142,7 +142,7 @@ BluetoothDevice::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
mServices = value.get_ArrayOfnsString();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.InitUsingWin(GetOwner())) {
|
||||
if (!jsapi.Init(GetOwner())) {
|
||||
BT_WARNING("Failed to initialise AutoJSAPI!");
|
||||
return;
|
||||
}
|
||||
|
@ -1726,7 +1726,7 @@ JS::Value StringToJsval(nsPIDOMWindow* aWindow, nsAString& aString)
|
||||
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();
|
||||
|
@ -49,7 +49,7 @@ 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();
|
||||
|
@ -3138,7 +3138,7 @@ WorkerPrivateParent<Derived>::BroadcastErrorToSharedWorkers(
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user