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. | 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 Loading... |
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 std::unique_ptr<CancellableTaskFactory> m_navigateTaskFactory; | 92 std::unique_ptr<CancellableTaskFactory> m_navigateTaskFactory; |
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 { | |
100 WTF_MAKE_NONCOPYABLE(NavigationDisablerForUnload); | |
101 STACK_ALLOCATED(); | |
102 | |
103 public: | |
104 NavigationDisablerForUnload() { s_navigationDisableCount++; } | |
105 ~NavigationDisablerForUnload() { | |
106 DCHECK(s_navigationDisableCount); | |
107 s_navigationDisableCount--; | |
108 } | |
109 static bool isNavigationAllowed() { return !s_navigationDisableCount; } | |
110 | |
111 private: | |
112 static unsigned s_navigationDisableCount; | |
113 }; | |
114 | |
115 } // namespace blink | 99 } // namespace blink |
116 | 100 |
117 #endif // NavigationScheduler_h | 101 #endif // NavigationScheduler_h |
OLD | NEW |