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

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

Issue 1374533002: Null out LocalDOMWindow::m_frame on navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try to fix crash-on-querying-event-path.html Created 5 years, 2 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
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 "config.h" 5 #include "config.h"
6 #include "core/frame/DOMWindow.h" 6 #include "core/frame/DOMWindow.h"
7 7
8 #include "bindings/core/v8/ScriptCallStackFactory.h" 8 #include "bindings/core/v8/ScriptCallStackFactory.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 { 113 {
114 if (!frame()) 114 if (!frame())
115 return nullptr; 115 return nullptr;
116 116
117 Frame* child = frame()->tree().scopedChild(index); 117 Frame* child = frame()->tree().scopedChild(index);
118 return child ? child->domWindow() : nullptr; 118 return child ? child->domWindow() : nullptr;
119 } 119 }
120 120
121 bool DOMWindow::isCurrentlyDisplayedInFrame() const 121 bool DOMWindow::isCurrentlyDisplayedInFrame() const
122 { 122 {
123 return frame() && frame()->domWindow() == this && frame()->host(); 123 if (frame())
124 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(frame()->domWindow() == this);
125 return frame() && frame()->host();
124 } 126 }
125 127
126 bool DOMWindow::isInsecureScriptAccess(LocalDOMWindow& callingWindow, const Stri ng& urlString) 128 bool DOMWindow::isInsecureScriptAccess(LocalDOMWindow& callingWindow, const Stri ng& urlString)
127 { 129 {
128 if (!protocolIsJavaScript(urlString)) 130 if (!protocolIsJavaScript(urlString))
129 return false; 131 return false;
130 132
131 // If this DOMWindow isn't currently active in the Frame, then there's no 133 // If this DOMWindow isn't currently active in the Frame, then there's no
132 // way we should allow the access. 134 // way we should allow the access.
133 if (isCurrentlyDisplayedInFrame()) { 135 if (isCurrentlyDisplayedInFrame()) {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 m_windowIsClosing = true; 330 m_windowIsClosing = true;
329 } 331 }
330 332
331 DEFINE_TRACE(DOMWindow) 333 DEFINE_TRACE(DOMWindow)
332 { 334 {
333 visitor->trace(m_location); 335 visitor->trace(m_location);
334 EventTargetWithInlineData::trace(visitor); 336 EventTargetWithInlineData::trace(visitor);
335 } 337 }
336 338
337 } // namespace blink 339 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698