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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 { 654 {
655 if (!isCurrentlyDisplayedInFrame()) 655 if (!isCurrentlyDisplayedInFrame())
656 return nullptr; 656 return nullptr;
657 if (!m_applicationCache) 657 if (!m_applicationCache)
658 m_applicationCache = ApplicationCache::create(frame()); 658 m_applicationCache = ApplicationCache::create(frame());
659 return m_applicationCache.get(); 659 return m_applicationCache.get();
660 } 660 }
661 661
662 Navigator* LocalDOMWindow::navigator() const 662 Navigator* LocalDOMWindow::navigator() const
663 { 663 {
664 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.
665 // This window is already detached.
666 ASSERT(!m_navigator);
667 return nullptr;
668 }
669
664 if (!m_navigator) 670 if (!m_navigator)
665 m_navigator = Navigator::create(frame()); 671 m_navigator = Navigator::create(frame());
666 return m_navigator.get(); 672 return m_navigator.get();
667 } 673 }
668 674
669 void LocalDOMWindow::schedulePostMessage(PassRefPtrWillBeRawPtr<MessageEvent> ev ent, LocalDOMWindow* source, SecurityOrigin* target, PassRefPtrWillBeRawPtr<Scri ptCallStack> stackTrace) 675 void LocalDOMWindow::schedulePostMessage(PassRefPtrWillBeRawPtr<MessageEvent> ev ent, LocalDOMWindow* source, SecurityOrigin* target, PassRefPtrWillBeRawPtr<Scri ptCallStack> stackTrace)
670 { 676 {
671 // Schedule the message. 677 // Schedule the message.
672 OwnPtrWillBeRawPtr<PostMessageTimer> timer = adoptPtrWillBeNoop(new PostMess ageTimer(*this, event, source, target, stackTrace, UserGestureIndicator::current Token())); 678 OwnPtrWillBeRawPtr<PostMessageTimer> timer = adoptPtrWillBeNoop(new PostMess ageTimer(*this, event, source, target, stackTrace, UserGestureIndicator::current Token()));
673 timer->startOneShot(0, FROM_HERE); 679 timer->startOneShot(0, FROM_HERE);
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 DOMWindow::trace(visitor); 1493 DOMWindow::trace(visitor);
1488 DOMWindowLifecycleNotifier::trace(visitor); 1494 DOMWindowLifecycleNotifier::trace(visitor);
1489 } 1495 }
1490 1496
1491 LocalFrame* LocalDOMWindow::frame() const 1497 LocalFrame* LocalDOMWindow::frame() const
1492 { 1498 {
1493 return m_frameObserver->frame(); 1499 return m_frameObserver->frame();
1494 } 1500 }
1495 1501
1496 } // namespace blink 1502 } // namespace blink
OLDNEW
« 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