Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| index 3e4723950ddf5d5b5f8e47f46bf2669a907f6d40..29fa67e69cc62d751d66319ca600a49d24719e84 100644 |
| --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| @@ -233,12 +233,17 @@ void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, |
| : KURL(KURL(), |
| frame()->securityContext()->getSecurityOrigin()->toString()); |
| if (MixedContentChecker::isMixedContent(sourceDocument->getSecurityOrigin(), |
| - targetUrl)) |
| + targetUrl)) { |
| UseCounter::count(frame(), UseCounter::PostMessageFromSecureToInsecure); |
| - else if (MixedContentChecker::isMixedContent( |
| - frame()->securityContext()->getSecurityOrigin(), |
| - sourceDocument->url())) |
| + } else if (MixedContentChecker::isMixedContent( |
| + frame()->securityContext()->getSecurityOrigin(), |
| + sourceDocument->url())) { |
| UseCounter::count(frame(), UseCounter::PostMessageFromInsecureToSecure); |
| + if (frame()->isMainFrame()) { |
|
Mike West
2017/01/23 08:59:22
That is, I think the goal of the counter is to det
|
| + UseCounter::count(frame(), |
| + UseCounter::PostMessageFromInsecureToSecureToplevel); |
| + } |
| + } |
| MessageEvent* event = |
| MessageEvent::create(std::move(channels), std::move(message), |