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

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
« no previous file with comments | « LayoutTests/http/tests/serviceworker/chromium/frame-removed.html ('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 /* 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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (!m_navigator) 664 if (!m_navigator)
665 m_navigator = Navigator::create(frame()); 665 m_navigator = Navigator::create(isCurrentlyDisplayedInFrame() ? frame() : nullptr);
haraken 2015/08/24 06:28:21 Can you add a comment on this?
yhirano 2015/08/24 06:52:35 Done.
666 ASSERT(isCurrentlyDisplayedInFrame() || !m_navigator->frame());
666 return m_navigator.get(); 667 return m_navigator.get();
667 } 668 }
668 669
669 void LocalDOMWindow::schedulePostMessage(PassRefPtrWillBeRawPtr<MessageEvent> ev ent, LocalDOMWindow* source, SecurityOrigin* target, PassRefPtrWillBeRawPtr<Scri ptCallStack> stackTrace) 670 void LocalDOMWindow::schedulePostMessage(PassRefPtrWillBeRawPtr<MessageEvent> ev ent, LocalDOMWindow* source, SecurityOrigin* target, PassRefPtrWillBeRawPtr<Scri ptCallStack> stackTrace)
670 { 671 {
671 // Schedule the message. 672 // Schedule the message.
672 OwnPtrWillBeRawPtr<PostMessageTimer> timer = adoptPtrWillBeNoop(new PostMess ageTimer(*this, event, source, target, stackTrace, UserGestureIndicator::current Token())); 673 OwnPtrWillBeRawPtr<PostMessageTimer> timer = adoptPtrWillBeNoop(new PostMess ageTimer(*this, event, source, target, stackTrace, UserGestureIndicator::current Token()));
673 timer->startOneShot(0, FROM_HERE); 674 timer->startOneShot(0, FROM_HERE);
674 timer->suspendIfNeeded(); 675 timer->suspendIfNeeded();
675 m_postMessageTimers.add(timer.release()); 676 m_postMessageTimers.add(timer.release());
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 DOMWindow::trace(visitor); 1488 DOMWindow::trace(visitor);
1488 DOMWindowLifecycleNotifier::trace(visitor); 1489 DOMWindowLifecycleNotifier::trace(visitor);
1489 } 1490 }
1490 1491
1491 LocalFrame* LocalDOMWindow::frame() const 1492 LocalFrame* LocalDOMWindow::frame() const
1492 { 1493 {
1493 return m_frameObserver->frame(); 1494 return m_frameObserver->frame();
1494 } 1495 }
1495 1496
1496 } // namespace blink 1497 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/serviceworker/chromium/frame-removed.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698