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/ScriptCallStackFactory.h" | 7 #include "bindings/core/v8/ScriptCallStackFactory.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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 if (exceptionState.hadException()) | 196 if (exceptionState.hadException()) |
197 return; | 197 return; |
198 | 198 |
199 // Capture the source of the message. We need to do this synchronously | 199 // Capture the source of the message. We need to do this synchronously |
200 // in order to capture the source of the message correctly. | 200 // in order to capture the source of the message correctly. |
201 if (!sourceDocument) | 201 if (!sourceDocument) |
202 return; | 202 return; |
203 String sourceOrigin = sourceDocument->securityOrigin()->toString(); | 203 String sourceOrigin = sourceDocument->securityOrigin()->toString(); |
204 String sourceSuborigin = sourceDocument->securityOrigin()->suboriginName(); | 204 String sourceSuborigin = sourceDocument->securityOrigin()->suboriginName(); |
205 | 205 |
206 // FIXME: MixedContentChecker needs to be refactored for OOPIF. For now, | |
207 // create the url using replicated origins for remote frames. | |
208 KURL targetUrl = isLocalDOMWindow() ? document()->url() : KURL(KURL(), frame
()->securityContext()->securityOrigin()->toString()); | 206 KURL targetUrl = isLocalDOMWindow() ? document()->url() : KURL(KURL(), frame
()->securityContext()->securityOrigin()->toString()); |
209 if (MixedContentChecker::isMixedContent(sourceDocument->securityOrigin(), ta
rgetUrl)) | 207 if (MixedContentChecker::isMixedContent(sourceDocument->securityOrigin(), ta
rgetUrl)) |
210 UseCounter::count(frame(), UseCounter::PostMessageFromSecureToInsecure); | 208 UseCounter::count(frame(), UseCounter::PostMessageFromSecureToInsecure); |
211 else if (MixedContentChecker::isMixedContent(frame()->securityContext()->sec
urityOrigin(), sourceDocument->url())) | 209 else if (MixedContentChecker::isMixedContent(frame()->securityContext()->sec
urityOrigin(), sourceDocument->url())) |
212 UseCounter::count(frame(), UseCounter::PostMessageFromInsecureToSecure); | 210 UseCounter::count(frame(), UseCounter::PostMessageFromInsecureToSecure); |
213 | 211 |
214 // Give the embedder a chance to intercept this postMessage. If the | 212 // Give the embedder a chance to intercept this postMessage. If the |
215 // target is a remote frame, the message will be forwarded through the | 213 // target is a remote frame, the message will be forwarded through the |
216 // browser process. | 214 // browser process. |
217 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(channels.relea
se(), message, sourceOrigin, String(), source, sourceSuborigin); | 215 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(channels.relea
se(), message, sourceOrigin, String(), source, sourceSuborigin); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); | 366 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); |
369 } | 367 } |
370 | 368 |
371 DEFINE_TRACE(DOMWindow) | 369 DEFINE_TRACE(DOMWindow) |
372 { | 370 { |
373 visitor->trace(m_location); | 371 visitor->trace(m_location); |
374 EventTargetWithInlineData::trace(visitor); | 372 EventTargetWithInlineData::trace(visitor); |
375 } | 373 } |
376 | 374 |
377 } // namespace blink | 375 } // namespace blink |
OLD | NEW |