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

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

Issue 1962053002: Allow expensive task blocking if there is pending iframe navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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. (http://www.t orchmobile.com/) 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
4 * Copyright (C) 2009 Adam Barth. All rights reserved. 4 * Copyright (C) 2009 Adam Barth. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool shouldScheduleNavigation(const String& url) const; 80 bool shouldScheduleNavigation(const String& url) const;
81 81
82 void navigateTask(); 82 void navigateTask();
83 void schedule(ScheduledNavigation*); 83 void schedule(ScheduledNavigation*);
84 84
85 static bool mustReplaceCurrentItem(LocalFrame* targetFrame); 85 static bool mustReplaceCurrentItem(LocalFrame* targetFrame);
86 86
87 Member<LocalFrame> m_frame; 87 Member<LocalFrame> m_frame;
88 OwnPtr<CancellableTaskFactory> m_navigateTaskFactory; 88 OwnPtr<CancellableTaskFactory> m_navigateTaskFactory;
89 Member<ScheduledNavigation> m_redirect; 89 Member<ScheduledNavigation> m_redirect;
90 bool m_frameIsMainFrame; // Exists because we can't deref m_frame in destruc tor.
90 }; 91 };
91 92
92 class NavigationDisablerForBeforeUnload { 93 class NavigationDisablerForBeforeUnload {
93 WTF_MAKE_NONCOPYABLE(NavigationDisablerForBeforeUnload); 94 WTF_MAKE_NONCOPYABLE(NavigationDisablerForBeforeUnload);
94 STACK_ALLOCATED(); 95 STACK_ALLOCATED();
95 public: 96 public:
96 NavigationDisablerForBeforeUnload() 97 NavigationDisablerForBeforeUnload()
97 { 98 {
98 s_navigationDisableCount++; 99 s_navigationDisableCount++;
99 } 100 }
100 ~NavigationDisablerForBeforeUnload() 101 ~NavigationDisablerForBeforeUnload()
101 { 102 {
102 ASSERT(s_navigationDisableCount); 103 ASSERT(s_navigationDisableCount);
103 s_navigationDisableCount--; 104 s_navigationDisableCount--;
104 } 105 }
105 static bool isNavigationAllowed() { return !s_navigationDisableCount; } 106 static bool isNavigationAllowed() { return !s_navigationDisableCount; }
106 107
107 private: 108 private:
108 static unsigned s_navigationDisableCount; 109 static unsigned s_navigationDisableCount;
109 }; 110 };
110 111
111 } // namespace blink 112 } // namespace blink
112 113
113 #endif // NavigationScheduler_h 114 #endif // NavigationScheduler_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698