OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef NavigationScheduler_h | 31 #ifndef NavigationScheduler_h |
32 #define NavigationScheduler_h | 32 #define NavigationScheduler_h |
33 | 33 |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
35 #include "platform/Timer.h" | 35 #include "platform/Timer.h" |
36 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
37 #include "platform/scheduler/CancellableTaskFactory.h" | |
38 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
39 #include "wtf/HashMap.h" | 38 #include "wtf/HashMap.h" |
40 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
41 #include "wtf/OwnPtr.h" | 40 #include "wtf/OwnPtr.h" |
42 #include "wtf/PassOwnPtr.h" | 41 #include "wtf/PassOwnPtr.h" |
43 #include "wtf/PassRefPtr.h" | 42 #include "wtf/PassRefPtr.h" |
44 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
45 | 44 |
46 namespace blink { | 45 namespace blink { |
47 | 46 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 private: | 106 private: |
108 friend class FrameNavigationDisabler; | 107 friend class FrameNavigationDisabler; |
109 | 108 |
110 void disableFrameNavigation() { ++m_navigationDisableCount; } | 109 void disableFrameNavigation() { ++m_navigationDisableCount; } |
111 void enableFrameNavigation() { --m_navigationDisableCount; } | 110 void enableFrameNavigation() { --m_navigationDisableCount; } |
112 bool isFrameNavigationAllowed() const { return !m_navigationDisableCount; } | 111 bool isFrameNavigationAllowed() const { return !m_navigationDisableCount; } |
113 | 112 |
114 bool shouldScheduleReload() const; | 113 bool shouldScheduleReload() const; |
115 bool shouldScheduleNavigation(const String& url) const; | 114 bool shouldScheduleNavigation(const String& url) const; |
116 | 115 |
117 void navigateTask(); | 116 void timerFired(Timer<NavigationScheduler>*); |
118 void schedule(PassOwnPtrWillBeRawPtr<ScheduledNavigation>); | 117 void schedule(PassOwnPtrWillBeRawPtr<ScheduledNavigation>); |
119 | 118 |
120 static bool mustReplaceCurrentItem(LocalFrame* targetFrame); | 119 static bool mustReplaceCurrentItem(LocalFrame* targetFrame); |
121 | 120 |
122 RawPtrWillBeMember<LocalFrame> m_frame; | 121 RawPtrWillBeMember<LocalFrame> m_frame; |
123 CancellableTaskFactory m_navigateTaskFactory; | 122 Timer<NavigationScheduler> m_timer; |
124 OwnPtrWillBeMember<ScheduledNavigation> m_redirect; | 123 OwnPtrWillBeMember<ScheduledNavigation> m_redirect; |
125 int m_navigationDisableCount; | 124 int m_navigationDisableCount; |
126 }; | 125 }; |
127 | 126 |
128 } // namespace blink | 127 } // namespace blink |
129 | 128 |
130 #endif // NavigationScheduler_h | 129 #endif // NavigationScheduler_h |
OLD | NEW |