| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/frame/DOMWindow.h" | 5 #include "core/frame/DOMWindow.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptCallStack.h" | 7 #include "bindings/core/v8/ScriptCallStack.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
| 10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 String sourceOrigin = (hasSuborigin && securityOrigin->suborigin()->policyCo
ntains(unsafeSendOpt)) ? securityOrigin->toPhysicalOriginString() : securityOrig
in->toString(); | 213 String sourceOrigin = (hasSuborigin && securityOrigin->suborigin()->policyCo
ntains(unsafeSendOpt)) ? securityOrigin->toPhysicalOriginString() : securityOrig
in->toString(); |
| 214 String sourceSuborigin = hasSuborigin ? securityOrigin->suborigin()->name()
: String(); | 214 String sourceSuborigin = hasSuborigin ? securityOrigin->suborigin()->name()
: String(); |
| 215 | 215 |
| 216 KURL targetUrl = isLocalDOMWindow() ? document()->url() : KURL(KURL(), frame
()->securityContext()->getSecurityOrigin()->toString()); | 216 KURL targetUrl = isLocalDOMWindow() ? document()->url() : KURL(KURL(), frame
()->securityContext()->getSecurityOrigin()->toString()); |
| 217 if (MixedContentChecker::isMixedContent(sourceDocument->getSecurityOrigin(),
targetUrl)) | 217 if (MixedContentChecker::isMixedContent(sourceDocument->getSecurityOrigin(),
targetUrl)) |
| 218 UseCounter::count(frame(), UseCounter::PostMessageFromSecureToInsecure); | 218 UseCounter::count(frame(), UseCounter::PostMessageFromSecureToInsecure); |
| 219 else if (MixedContentChecker::isMixedContent(frame()->securityContext()->get
SecurityOrigin(), sourceDocument->url())) | 219 else if (MixedContentChecker::isMixedContent(frame()->securityContext()->get
SecurityOrigin(), sourceDocument->url())) |
| 220 UseCounter::count(frame(), UseCounter::PostMessageFromInsecureToSecure); | 220 UseCounter::count(frame(), UseCounter::PostMessageFromInsecureToSecure); |
| 221 | 221 |
| 222 MessageEvent* event = MessageEvent::create(channels.release(), message, sour
ceOrigin, String(), source, sourceSuborigin); | 222 MessageEvent* event = MessageEvent::create(std::move(channels), message, sou
rceOrigin, String(), source, sourceSuborigin); |
| 223 // Give the embedder a chance to intercept this postMessage. If the | 223 // Give the embedder a chance to intercept this postMessage. If the |
| 224 // target is a remote frame, the message will be forwarded through the | 224 // target is a remote frame, the message will be forwarded through the |
| 225 // browser process. | 225 // browser process. |
| 226 if (frame()->client()->willCheckAndDispatchMessageEvent(target.get(), event,
source->document()->frame())) | 226 if (frame()->client()->willCheckAndDispatchMessageEvent(target.get(), event,
source->document()->frame())) |
| 227 return; | 227 return; |
| 228 | 228 |
| 229 // Capture stack trace only when inspector front-end is loaded as it may be
time consuming. | 229 // Capture stack trace only when inspector front-end is loaded as it may be
time consuming. |
| 230 RefPtr<ScriptCallStack> stackTrace; | 230 RefPtr<ScriptCallStack> stackTrace; |
| 231 if (InspectorInstrumentation::consoleAgentEnabled(sourceDocument)) | 231 if (InspectorInstrumentation::consoleAgentEnabled(sourceDocument)) |
| 232 stackTrace = ScriptCallStack::capture(); | 232 stackTrace = ScriptCallStack::capture(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); | 377 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); |
| 378 } | 378 } |
| 379 | 379 |
| 380 DEFINE_TRACE(DOMWindow) | 380 DEFINE_TRACE(DOMWindow) |
| 381 { | 381 { |
| 382 visitor->trace(m_location); | 382 visitor->trace(m_location); |
| 383 EventTargetWithInlineData::trace(visitor); | 383 EventTargetWithInlineData::trace(visitor); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace blink | 386 } // namespace blink |
| OLD | NEW |