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

Unified Diff: Source/core/frame/DOMWindow.cpp

Issue 307223002: Make sure we never pass a null Frame to Document::canNavigate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/DOMWindow.cpp
diff --git a/Source/core/frame/DOMWindow.cpp b/Source/core/frame/DOMWindow.cpp
index 9d85771d908ce7868b7e3d666b68851fcef5a44d..10c4f0cb6d7a33877ad4d6cdd16a81d4a08f1932 100644
--- a/Source/core/frame/DOMWindow.cpp
+++ b/Source/core/frame/DOMWindow.cpp
@@ -956,7 +956,7 @@ void DOMWindow::close(ExecutionContext* context)
if (!activeDocument)
return;
- if (!activeDocument->canNavigate(m_frame))
+ if (!activeDocument->canNavigate(*m_frame))
return;
}
@@ -1658,7 +1658,8 @@ void DOMWindow::setLocation(const String& urlString, DOMWindow* callingWindow, D
if (!activeDocument)
return;
- if (!activeDocument->canNavigate(m_frame))
+ ASSERT(m_frame);
+ if (!activeDocument->canNavigate(*m_frame))
return;
LocalFrame* firstFrame = enteredWindow->frame();
@@ -1810,7 +1811,7 @@ PassRefPtrWillBeRawPtr<DOMWindow> DOMWindow::open(const String& urlString, const
targetFrame = m_frame;
}
if (targetFrame) {
- if (!activeDocument->canNavigate(targetFrame))
+ if (!activeDocument->canNavigate(*targetFrame))
return nullptr;
KURL completedURL = firstFrame->document()->completeURL(urlString);

Powered by Google App Engine
This is Rietveld 408576698