| 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..0e1a26b4d379bedfb6bfdf6c5dc41218824f628f 100644
|
| --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
|
| @@ -233,12 +233,19 @@ 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 (MixedContentChecker::isMixedContent(
|
| + frame()->tree().top()->securityContext()->getSecurityOrigin(),
|
| + sourceDocument->url())) {
|
| + UseCounter::count(frame(),
|
| + UseCounter::PostMessageFromInsecureToSecureToplevel);
|
| + }
|
| + }
|
|
|
| MessageEvent* event =
|
| MessageEvent::create(std::move(channels), std::move(message),
|
|
|