зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1474835 - Use implicit_jscontext for nsIWebNavigation.setOriginAttributesBeforeLoading. r=smaug
This commit is contained in:
Родитель
339b56f02e
Коммит
ef58e3064f
|
@ -13832,24 +13832,15 @@ nsDocShell::SetOriginAttributes(const OriginAttributes& aAttrs)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetOriginAttributesBeforeLoading(JS::Handle<JS::Value> aOriginAttributes)
|
||||
nsDocShell::SetOriginAttributesBeforeLoading(JS::Handle<JS::Value> aOriginAttributes,
|
||||
JSContext* aCx)
|
||||
{
|
||||
if (!aOriginAttributes.isObject()) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.Init(&aOriginAttributes.toObject())) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
JSContext* cx = jsapi.cx();
|
||||
if (NS_WARN_IF(!cx)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
OriginAttributes attrs;
|
||||
if (!aOriginAttributes.isObject() || !attrs.Init(cx, aOriginAttributes)) {
|
||||
if (!attrs.Init(aCx, aOriginAttributes)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
|
|
@ -406,5 +406,6 @@ interface nsIWebNavigation : nsISupports
|
|||
* Set an OriginAttributes dictionary in the docShell. This can be done only
|
||||
* before loading any content.
|
||||
*/
|
||||
[implicit_jscontext]
|
||||
void setOriginAttributesBeforeLoading(in jsval originAttributes);
|
||||
};
|
||||
|
|
|
@ -1820,7 +1820,8 @@ nsSHistory::LoadURIWithOptions(const char16_t* aURI,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSHistory::SetOriginAttributesBeforeLoading(JS::HandleValue aOriginAttributes)
|
||||
nsSHistory::SetOriginAttributesBeforeLoading(JS::HandleValue aOriginAttributes,
|
||||
JSContext* aCx)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -672,9 +672,10 @@ nsWebBrowser::LoadURIWithOptions(const char16_t* aURI, uint32_t aLoadFlags,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebBrowser::SetOriginAttributesBeforeLoading(JS::Handle<JS::Value> aOriginAttributes)
|
||||
nsWebBrowser::SetOriginAttributesBeforeLoading(JS::Handle<JS::Value> aOriginAttributes,
|
||||
JSContext* aCx)
|
||||
{
|
||||
return mDocShellAsNav->SetOriginAttributesBeforeLoading(aOriginAttributes);
|
||||
return mDocShellAsNav->SetOriginAttributesBeforeLoading(aOriginAttributes, aCx);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче