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 "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
9 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
10 #include "core/dom/SecurityContext.h" | 10 #include "core/dom/SecurityContext.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 { | 123 { |
124 DEFINE_STATIC_LOCAL(Persistent<External>, external, (new External)); | 124 DEFINE_STATIC_LOCAL(Persistent<External>, external, (new External)); |
125 return external; | 125 return external; |
126 } | 126 } |
127 | 127 |
128 DOMWindow* DOMWindow::anonymousIndexedGetter(uint32_t index) const | 128 DOMWindow* DOMWindow::anonymousIndexedGetter(uint32_t index) const |
129 { | 129 { |
130 if (!frame()) | 130 if (!frame()) |
131 return nullptr; | 131 return nullptr; |
132 | 132 |
133 Frame* child = frame()->tree().scopedChild(index); | 133 Frame* childFrame = frame()->tree().scopedChild(index); |
134 return child ? child->domWindow() : nullptr; | 134 if (!childFrame) |
| 135 return nullptr; |
| 136 |
| 137 DOMWindow* childWindow = childFrame->domWindow(); |
| 138 if (childWindow && childWindow->isLocalDOMWindow()) { |
| 139 LocalFrame* targetFrame = blink::toLocalDOMWindow(childWindow)->frame(); |
| 140 if (targetFrame) { |
| 141 // Notify the loader's client if the initial document has been acces
sed. |
| 142 if (targetFrame->loader().stateMachine()->isDisplayingInitialEmptyDo
cument()) { |
| 143 targetFrame->loader().didAccessInitialDocument(); |
| 144 } |
| 145 } |
| 146 } |
| 147 |
| 148 return childWindow; |
135 } | 149 } |
136 | 150 |
137 bool DOMWindow::isCurrentlyDisplayedInFrame() const | 151 bool DOMWindow::isCurrentlyDisplayedInFrame() const |
138 { | 152 { |
139 if (frame()) | 153 if (frame()) |
140 SECURITY_CHECK(frame()->domWindow() == this); | 154 SECURITY_CHECK(frame()->domWindow() == this); |
141 return frame() && frame()->host(); | 155 return frame() && frame()->host(); |
142 } | 156 } |
143 | 157 |
144 bool DOMWindow::isInsecureScriptAccess(LocalDOMWindow& callingWindow, const Stri
ng& urlString) | 158 bool DOMWindow::isInsecureScriptAccess(LocalDOMWindow& callingWindow, const Stri
ng& urlString) |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); | 389 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); |
376 } | 390 } |
377 | 391 |
378 DEFINE_TRACE(DOMWindow) | 392 DEFINE_TRACE(DOMWindow) |
379 { | 393 { |
380 visitor->trace(m_location); | 394 visitor->trace(m_location); |
381 EventTargetWithInlineData::trace(visitor); | 395 EventTargetWithInlineData::trace(visitor); |
382 } | 396 } |
383 | 397 |
384 } // namespace blink | 398 } // namespace blink |
OLD | NEW |