Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: third_party/WebKit/Source/core/frame/DOMWindow.cpp

Issue 2177233002: binding: Calls didAccessInitialDocument() for a returned Window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated SSLUITest's test expectation. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698