| 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" |
| 37 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
| 38 #include "wtf/HashMap.h" | 39 #include "wtf/HashMap.h" |
| 39 #include "wtf/Noncopyable.h" | 40 #include "wtf/Noncopyable.h" |
| 40 #include "wtf/OwnPtr.h" | 41 #include "wtf/OwnPtr.h" |
| 41 #include "wtf/PassOwnPtr.h" | 42 #include "wtf/PassOwnPtr.h" |
| 42 #include "wtf/PassRefPtr.h" | 43 #include "wtf/PassRefPtr.h" |
| 43 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
| 44 | 45 |
| 45 namespace blink { | 46 namespace blink { |
| 46 | 47 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 private: | 107 private: |
| 107 friend class FrameNavigationDisabler; | 108 friend class FrameNavigationDisabler; |
| 108 | 109 |
| 109 void disableFrameNavigation() { ++m_navigationDisableCount; } | 110 void disableFrameNavigation() { ++m_navigationDisableCount; } |
| 110 void enableFrameNavigation() { --m_navigationDisableCount; } | 111 void enableFrameNavigation() { --m_navigationDisableCount; } |
| 111 bool isFrameNavigationAllowed() const { return !m_navigationDisableCount; } | 112 bool isFrameNavigationAllowed() const { return !m_navigationDisableCount; } |
| 112 | 113 |
| 113 bool shouldScheduleReload() const; | 114 bool shouldScheduleReload() const; |
| 114 bool shouldScheduleNavigation(const String& url) const; | 115 bool shouldScheduleNavigation(const String& url) const; |
| 115 | 116 |
| 116 void timerFired(Timer<NavigationScheduler>*); | 117 void navigateTask(); |
| 117 void schedule(PassOwnPtrWillBeRawPtr<ScheduledNavigation>); | 118 void schedule(PassOwnPtrWillBeRawPtr<ScheduledNavigation>); |
| 118 | 119 |
| 119 static bool mustReplaceCurrentItem(LocalFrame* targetFrame); | 120 static bool mustReplaceCurrentItem(LocalFrame* targetFrame); |
| 120 | 121 |
| 121 RawPtrWillBeMember<LocalFrame> m_frame; | 122 RawPtrWillBeMember<LocalFrame> m_frame; |
| 122 Timer<NavigationScheduler> m_timer; | 123 CancellableTaskFactory m_navigateTaskFactory; |
| 123 OwnPtrWillBeMember<ScheduledNavigation> m_redirect; | 124 OwnPtrWillBeMember<ScheduledNavigation> m_redirect; |
| 124 int m_navigationDisableCount; | 125 int m_navigationDisableCount; |
| 125 }; | 126 }; |
| 126 | 127 |
| 127 } // namespace blink | 128 } // namespace blink |
| 128 | 129 |
| 129 #endif // NavigationScheduler_h | 130 #endif // NavigationScheduler_h |
| OLD | NEW |