Index: Source/bindings/core/v8/custom/V8WindowCustom.cpp |
diff --git a/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
index c79f629e35c7040d0bcc264699d8dc60ea88898e..b0a945f5f24a56d81d984a29cc6ba46b2ab83294 100644 |
--- a/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
+++ b/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
@@ -54,6 +54,7 @@ |
#include "core/frame/LocalDOMWindow.h" |
#include "core/frame/LocalFrame.h" |
#include "core/frame/Settings.h" |
+#include "core/frame/UseCounter.h" |
#include "core/frame/csp/ContentSecurityPolicy.h" |
#include "core/html/HTMLCollection.h" |
#include "core/html/HTMLDocument.h" |
@@ -245,6 +246,9 @@ void V8Window::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value> |
LocalDOMWindow* window = V8Window::toImpl(info.Holder()); |
LocalDOMWindow* source = callingDOMWindow(info.GetIsolate()); |
+ ASSERT(window); |
+ UseCounter::countIfNotPrivateScript(info.GetIsolate(), window->document(), UseCounter::WindowPostMessage); |
Mike West
2014/10/22 07:57:01
Aside: Ooh. countIfNotPrivateScript is... verbose.
sof
2014/10/22 08:00:33
Added a couple of days ago, https://codereview.chr
|
+ |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", "Window", info.Holder(), info.GetIsolate()); |
// If called directly by WebCore we don't have a calling context. |
@@ -266,6 +270,7 @@ void V8Window::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value> |
if (info.Length() > 2) { |
int transferablesArgIndex = 2; |
if (isLegacyTargetOriginDesignation(info[2])) { |
+ UseCounter::countIfNotPrivateScript(info.GetIsolate(), window->document(), UseCounter::WindowPostMessageWithLegacyTargetOriginArgument); |
targetOriginArgIndex = 2; |
transferablesArgIndex = 1; |
} |