Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp

Issue 2295863002: Remove window.postMessage(message, transferables, targetOrigin) legacy overload (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
index 1dc4d07e5b6b59d90009866ff1edb0f78280470a..3026299a1530ea9c69f2e0cc7da199e95ed5d1c3 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
@@ -150,14 +150,6 @@ void V8Window::openerAttributeSetterCustom(v8::Local<v8::Value> value, const v8:
}
}
-static bool isLegacyTargetOriginDesignation(v8::Local<v8::Value> value)
-{
- if (value->IsString() || value->IsStringObject())
- return true;
- return false;
-}
-
-
void V8Window::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", "Window", info.Holder(), info.GetIsolate());
@@ -185,20 +177,12 @@ void V8Window::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value>
}
// This function has variable arguments and can be:
- // Per current spec:
// postMessage(message, targetOrigin)
// postMessage(message, targetOrigin, {sequence of transferrables})
- // Legacy non-standard implementations in webkit allowed:
- // postMessage(message, {sequence of transferrables}, targetOrigin);
Transferables transferables;
- int targetOriginArgIndex = 1;
+ const int targetOriginArgIndex = 1;
if (info.Length() > 2) {
- int transferablesArgIndex = 2;
- if (isLegacyTargetOriginDesignation(info[2])) {
- Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), window->document(), UseCounter::WindowPostMessageWithLegacyTargetOriginArgument);
- targetOriginArgIndex = 2;
- transferablesArgIndex = 1;
- }
+ const int transferablesArgIndex = 2;
if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info[transferablesArgIndex], transferablesArgIndex, transferables, exceptionState)) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698