| 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 24 matching lines...) Expand all Loading... |
| 35 #include <memory> | 35 #include <memory> |
| 36 #include "core/CoreExport.h" | 36 #include "core/CoreExport.h" |
| 37 #include "platform/WebTaskRunner.h" | 37 #include "platform/WebTaskRunner.h" |
| 38 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
| 39 #include "platform/weborigin/KURL.h" | 39 #include "platform/weborigin/KURL.h" |
| 40 #include "platform/wtf/Forward.h" | 40 #include "platform/wtf/Forward.h" |
| 41 #include "platform/wtf/HashMap.h" | 41 #include "platform/wtf/HashMap.h" |
| 42 #include "platform/wtf/Noncopyable.h" | 42 #include "platform/wtf/Noncopyable.h" |
| 43 #include "platform/wtf/PassRefPtr.h" | 43 #include "platform/wtf/PassRefPtr.h" |
| 44 #include "platform/wtf/text/WTFString.h" | 44 #include "platform/wtf/text/WTFString.h" |
| 45 #include "public/platform/WebScheduler.h" | 45 #include "public/platform/scheduler/renderer/renderer_scheduler.h" |
| 46 | 46 |
| 47 namespace blink { | 47 namespace blink { |
| 48 | 48 |
| 49 class Document; | 49 class Document; |
| 50 class FormSubmission; | 50 class FormSubmission; |
| 51 class LocalFrame; | 51 class LocalFrame; |
| 52 class ScheduledNavigation; | 52 class ScheduledNavigation; |
| 53 | 53 |
| 54 class CORE_EXPORT NavigationScheduler final | 54 class CORE_EXPORT NavigationScheduler final |
| 55 : public GarbageCollectedFinalized<NavigationScheduler> { | 55 : public GarbageCollectedFinalized<NavigationScheduler> { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void NavigateTask(); | 87 void NavigateTask(); |
| 88 void Schedule(ScheduledNavigation*); | 88 void Schedule(ScheduledNavigation*); |
| 89 | 89 |
| 90 static bool MustReplaceCurrentItem(LocalFrame* target_frame); | 90 static bool MustReplaceCurrentItem(LocalFrame* target_frame); |
| 91 | 91 |
| 92 Member<LocalFrame> frame_; | 92 Member<LocalFrame> frame_; |
| 93 TaskHandle navigate_task_handle_; | 93 TaskHandle navigate_task_handle_; |
| 94 Member<ScheduledNavigation> redirect_; | 94 Member<ScheduledNavigation> redirect_; |
| 95 | 95 |
| 96 // Exists because we can't deref m_frame in destructor. | 96 // Exists because we can't deref m_frame in destructor. |
| 97 WebScheduler::NavigatingFrameType frame_type_; | 97 scheduler::RendererScheduler::NavigatingFrameType frame_type_; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 class NavigationDisablerForBeforeUnload { | 100 class NavigationDisablerForBeforeUnload { |
| 101 WTF_MAKE_NONCOPYABLE(NavigationDisablerForBeforeUnload); | 101 WTF_MAKE_NONCOPYABLE(NavigationDisablerForBeforeUnload); |
| 102 STACK_ALLOCATED(); | 102 STACK_ALLOCATED(); |
| 103 | 103 |
| 104 public: | 104 public: |
| 105 NavigationDisablerForBeforeUnload() { navigation_disable_count_++; } | 105 NavigationDisablerForBeforeUnload() { navigation_disable_count_++; } |
| 106 ~NavigationDisablerForBeforeUnload() { | 106 ~NavigationDisablerForBeforeUnload() { |
| 107 DCHECK(navigation_disable_count_); | 107 DCHECK(navigation_disable_count_); |
| 108 navigation_disable_count_--; | 108 navigation_disable_count_--; |
| 109 } | 109 } |
| 110 static bool IsNavigationAllowed() { return !navigation_disable_count_; } | 110 static bool IsNavigationAllowed() { return !navigation_disable_count_; } |
| 111 | 111 |
| 112 private: | 112 private: |
| 113 static unsigned navigation_disable_count_; | 113 static unsigned navigation_disable_count_; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| 117 | 117 |
| 118 #endif // NavigationScheduler_h | 118 #endif // NavigationScheduler_h |
| OLD | NEW |