| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 if (!frame()) | 117 if (!frame()) |
| 118 return nullptr; | 118 return nullptr; |
| 119 | 119 |
| 120 Frame* child = frame()->tree().scopedChild(index); | 120 Frame* child = frame()->tree().scopedChild(index); |
| 121 return child ? child->domWindow() : nullptr; | 121 return child ? child->domWindow() : nullptr; |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool DOMWindow::isCurrentlyDisplayedInFrame() const | 124 bool DOMWindow::isCurrentlyDisplayedInFrame() const |
| 125 { | 125 { |
| 126 if (frame()) | 126 if (frame()) |
| 127 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(frame()->domWindow() == this); | 127 SECURITY_CHECK(frame()->domWindow() == this); |
| 128 return frame() && frame()->host(); | 128 return frame() && frame()->host(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 bool DOMWindow::isInsecureScriptAccess(LocalDOMWindow& callingWindow, const Stri
ng& urlString) | 131 bool DOMWindow::isInsecureScriptAccess(LocalDOMWindow& callingWindow, const Stri
ng& urlString) |
| 132 { | 132 { |
| 133 if (!protocolIsJavaScript(urlString)) | 133 if (!protocolIsJavaScript(urlString)) |
| 134 return false; | 134 return false; |
| 135 | 135 |
| 136 // If this DOMWindow isn't currently active in the Frame, then there's no | 136 // If this DOMWindow isn't currently active in the Frame, then there's no |
| 137 // way we should allow the access. | 137 // way we should allow the access. |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); | 369 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); |
| 370 } | 370 } |
| 371 | 371 |
| 372 DEFINE_TRACE(DOMWindow) | 372 DEFINE_TRACE(DOMWindow) |
| 373 { | 373 { |
| 374 visitor->trace(m_location); | 374 visitor->trace(m_location); |
| 375 EventTargetWithInlineData::trace(visitor); | 375 EventTargetWithInlineData::trace(visitor); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace blink | 378 } // namespace blink |
| OLD | NEW |