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

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

Issue 2487403002: Allow navigations to frames that aren't being unloaded in the unload handler. (Closed)
Patch Set: Created 4 years, 1 month 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 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 908
909 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame) 909 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame)
910 : m_frame(&frame) { 910 : m_frame(&frame) {
911 m_frame->disableNavigation(); 911 m_frame->disableNavigation();
912 } 912 }
913 913
914 FrameNavigationDisabler::~FrameNavigationDisabler() { 914 FrameNavigationDisabler::~FrameNavigationDisabler() {
915 m_frame->enableNavigation(); 915 m_frame->enableNavigation();
916 } 916 }
917 917
918 bool LocalFrame::isNavigationAllowed() const {
919 for (const Frame* cur = this; cur; cur = cur->tree().parent()) {
920 if (cur->isLocalFrame() && toLocalFrame(cur)->m_navigationDisableCount > 0)
921 return false;
922 }
923
924 return true;
925 }
926
918 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) : m_frame(frame) { 927 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) : m_frame(frame) {
919 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 928 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
920 m_frame->client()->frameBlameContext()->Enter(); 929 m_frame->client()->frameBlameContext()->Enter();
921 } 930 }
922 931
923 ScopedFrameBlamer::~ScopedFrameBlamer() { 932 ScopedFrameBlamer::~ScopedFrameBlamer() {
924 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 933 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
925 m_frame->client()->frameBlameContext()->Leave(); 934 m_frame->client()->frameBlameContext()->Leave();
926 } 935 }
927 936
928 } // namespace blink 937 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698