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

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

Issue 1308723003: DOMWindow::navigator should return navigator w/o frame when detached. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index 0ffefbc9f3026c909f369bca438422e598acdad5..3feb9960f5f950b364295674b2b39d3625c93fb7 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -661,6 +661,12 @@ ApplicationCache* LocalDOMWindow::applicationCache() const
Navigator* LocalDOMWindow::navigator() const
{
+ if (frame() && frame()->domWindow() != this) {
haraken 2015/08/24 02:22:15 It would be better to use: if (!isCurrentlyDisp
yhirano 2015/08/24 03:27:11 Done.
+ // This window is already detached.
+ ASSERT(!m_navigator);
+ return nullptr;
+ }
+
if (!m_navigator)
m_navigator = Navigator::create(frame());
return m_navigator.get();
« no previous file with comments | « LayoutTests/fast/dom/navigator-detached-by-navigation.html ('k') | Source/modules/gamepad/NavigatorGamepad.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698