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

Side by Side Diff: third_party/WebKit/Source/core/loader/NavigationScheduler.h

Issue 2487403002: Allow navigations to frames that aren't being unloaded in the unload handler. (Closed)
Patch Set: early return on back/forward navigations Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
4 * (http://www.torchmobile.com/) 4 * (http://www.torchmobile.com/)
5 * Copyright (C) 2009 Adam Barth. All rights reserved. 5 * Copyright (C) 2009 Adam Barth. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 static bool mustReplaceCurrentItem(LocalFrame* targetFrame); 89 static bool mustReplaceCurrentItem(LocalFrame* targetFrame);
90 90
91 Member<LocalFrame> m_frame; 91 Member<LocalFrame> m_frame;
92 TaskHandle m_navigateTaskHandle; 92 TaskHandle m_navigateTaskHandle;
93 Member<ScheduledNavigation> m_redirect; 93 Member<ScheduledNavigation> m_redirect;
94 94
95 // Exists because we can't deref m_frame in destructor. 95 // Exists because we can't deref m_frame in destructor.
96 WebScheduler::NavigatingFrameType m_frameType; 96 WebScheduler::NavigatingFrameType m_frameType;
97 }; 97 };
98 98
99 class NavigationDisablerForUnload { 99 class NavigationDisablerForBeforeUnload {
100 WTF_MAKE_NONCOPYABLE(NavigationDisablerForUnload); 100 WTF_MAKE_NONCOPYABLE(NavigationDisablerForBeforeUnload);
101 STACK_ALLOCATED(); 101 STACK_ALLOCATED();
102 102
103 public: 103 public:
104 NavigationDisablerForUnload() { s_navigationDisableCount++; } 104 NavigationDisablerForBeforeUnload() { s_navigationDisableCount++; }
105 ~NavigationDisablerForUnload() { 105 ~NavigationDisablerForBeforeUnload() {
106 DCHECK(s_navigationDisableCount); 106 DCHECK(s_navigationDisableCount);
107 s_navigationDisableCount--; 107 s_navigationDisableCount--;
108 } 108 }
109 static bool isNavigationAllowed() { return !s_navigationDisableCount; } 109 static bool isNavigationAllowed() { return !s_navigationDisableCount; }
110 110
111 private: 111 private:
112 static unsigned s_navigationDisableCount; 112 static unsigned s_navigationDisableCount;
113 }; 113 };
114 114
115 } // namespace blink 115 } // namespace blink
116 116
117 #endif // NavigationScheduler_h 117 #endif // NavigationScheduler_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698