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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 | 162 |
163 bool DOMWindow::isSecureContext() const | 163 bool DOMWindow::isSecureContext() const |
164 { | 164 { |
165 if (!frame()) | 165 if (!frame()) |
166 return false; | 166 return false; |
167 | 167 |
168 return document()->isSecureContext(ExecutionContext::StandardSecureContextCh
eck); | 168 return document()->isSecureContext(ExecutionContext::StandardSecureContextCh
eck); |
169 } | 169 } |
170 | 170 |
171 void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes
sagePortArray* ports, const String& targetOrigin, LocalDOMWindow* source, Except
ionState& exceptionState) | 171 void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes
sagePortArray& ports, const String& targetOrigin, LocalDOMWindow* source, Except
ionState& exceptionState) |
172 { | 172 { |
173 if (!isCurrentlyDisplayedInFrame()) | 173 if (!isCurrentlyDisplayedInFrame()) |
174 return; | 174 return; |
175 | 175 |
176 Document* sourceDocument = source->document(); | 176 Document* sourceDocument = source->document(); |
177 | 177 |
178 // Compute the target origin. We need to do this synchronously in order | 178 // Compute the target origin. We need to do this synchronously in order |
179 // to generate the SyntaxError exception correctly. | 179 // to generate the SyntaxError exception correctly. |
180 RefPtr<SecurityOrigin> target; | 180 RefPtr<SecurityOrigin> target; |
181 if (targetOrigin == "/") { | 181 if (targetOrigin == "/") { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); | 372 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); |
373 } | 373 } |
374 | 374 |
375 DEFINE_TRACE(DOMWindow) | 375 DEFINE_TRACE(DOMWindow) |
376 { | 376 { |
377 visitor->trace(m_location); | 377 visitor->trace(m_location); |
378 EventTargetWithInlineData::trace(visitor); | 378 EventTargetWithInlineData::trace(visitor); |
379 } | 379 } |
380 | 380 |
381 } // namespace blink | 381 } // namespace blink |
OLD | NEW |