| 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. |
| 4 * (http://www.torchmobile.com/) |
| 4 * Copyright (C) 2009 Adam Barth. All rights reserved. | 5 * Copyright (C) 2009 Adam Barth. All rights reserved. |
| 5 * | 6 * |
| 6 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 8 * are met: | 9 * are met: |
| 9 * | 10 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 11 * 1. Redistributions of source code must retain the above copyright |
| 11 * notice, this list of conditions and the following disclaimer. | 12 * notice, this list of conditions and the following disclaimer. |
| 12 * 2. Redistributions in binary form must reproduce the above copyright | 13 * 2. Redistributions in binary form must reproduce the above copyright |
| 13 * notice, this list of conditions and the following disclaimer in the | 14 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 bool shouldScheduleNavigation(const String& url) const; | 84 bool shouldScheduleNavigation(const String& url) const; |
| 84 | 85 |
| 85 void navigateTask(); | 86 void navigateTask(); |
| 86 void schedule(ScheduledNavigation*); | 87 void schedule(ScheduledNavigation*); |
| 87 | 88 |
| 88 static bool mustReplaceCurrentItem(LocalFrame* targetFrame); | 89 static bool mustReplaceCurrentItem(LocalFrame* targetFrame); |
| 89 | 90 |
| 90 Member<LocalFrame> m_frame; | 91 Member<LocalFrame> m_frame; |
| 91 std::unique_ptr<CancellableTaskFactory> m_navigateTaskFactory; | 92 std::unique_ptr<CancellableTaskFactory> m_navigateTaskFactory; |
| 92 Member<ScheduledNavigation> m_redirect; | 93 Member<ScheduledNavigation> m_redirect; |
| 93 WebScheduler::NavigatingFrameType | 94 |
| 94 m_frameType; // 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; |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 class NavigationDisablerForUnload { | 99 class NavigationDisablerForUnload { |
| 98 WTF_MAKE_NONCOPYABLE(NavigationDisablerForUnload); | 100 WTF_MAKE_NONCOPYABLE(NavigationDisablerForUnload); |
| 99 STACK_ALLOCATED(); | 101 STACK_ALLOCATED(); |
| 100 | 102 |
| 101 public: | 103 public: |
| 102 NavigationDisablerForUnload() { s_navigationDisableCount++; } | 104 NavigationDisablerForUnload() { s_navigationDisableCount++; } |
| 103 ~NavigationDisablerForUnload() { | 105 ~NavigationDisablerForUnload() { |
| 104 DCHECK(s_navigationDisableCount); | 106 DCHECK(s_navigationDisableCount); |
| 105 s_navigationDisableCount--; | 107 s_navigationDisableCount--; |
| 106 } | 108 } |
| 107 static bool isNavigationAllowed() { return !s_navigationDisableCount; } | 109 static bool isNavigationAllowed() { return !s_navigationDisableCount; } |
| 108 | 110 |
| 109 private: | 111 private: |
| 110 static unsigned s_navigationDisableCount; | 112 static unsigned s_navigationDisableCount; |
| 111 }; | 113 }; |
| 112 | 114 |
| 113 } // namespace blink | 115 } // namespace blink |
| 114 | 116 |
| 115 #endif // NavigationScheduler_h | 117 #endif // NavigationScheduler_h |
| OLD | NEW |