Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h

Issue 2023033003: scheduler: Throttle timers in out-of-view frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULE R_IMPL_H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULE R_IMPL_H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULE R_IMPL_H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULE R_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 23 matching lines...) Expand all
34 public: 34 public:
35 WebFrameSchedulerImpl(RendererSchedulerImpl* renderer_scheduler, 35 WebFrameSchedulerImpl(RendererSchedulerImpl* renderer_scheduler,
36 WebViewSchedulerImpl* parent_web_view_scheduler, 36 WebViewSchedulerImpl* parent_web_view_scheduler,
37 base::trace_event::BlameContext* blame_context); 37 base::trace_event::BlameContext* blame_context);
38 38
39 ~WebFrameSchedulerImpl() override; 39 ~WebFrameSchedulerImpl() override;
40 40
41 // WebFrameScheduler implementation: 41 // WebFrameScheduler implementation:
42 void setFrameVisible(bool frame_visible) override; 42 void setFrameVisible(bool frame_visible) override;
43 void setPageVisible(bool page_visible) override; 43 void setPageVisible(bool page_visible) override;
44 void setCrossOrigin(bool cross_origin) override;
44 WebTaskRunner* loadingTaskRunner() override; 45 WebTaskRunner* loadingTaskRunner() override;
45 WebTaskRunner* timerTaskRunner() override; 46 WebTaskRunner* timerTaskRunner() override;
46 WebTaskRunner* unthrottledTaskRunner() override; 47 WebTaskRunner* unthrottledTaskRunner() override;
47 WebViewScheduler* webViewScheduler() override; 48 WebViewScheduler* webViewScheduler() override;
48 void didStartLoading(unsigned long identifier) override; 49 void didStartLoading(unsigned long identifier) override;
49 void didStopLoading(unsigned long identifier) override; 50 void didStopLoading(unsigned long identifier) override;
50 void setDocumentParsingInBackground(bool background_parser_active) override; 51 void setDocumentParsingInBackground(bool background_parser_active) override;
51 52
52 private: 53 private:
53 friend class WebViewSchedulerImpl; 54 friend class WebViewSchedulerImpl;
54 55
55 void DetachFromWebViewScheduler(); 56 void DetachFromWebViewScheduler();
56 void ApplyPolicyToTimerQueue(); 57 void ApplyPolicyToTimerQueue();
58 bool ShouldThrottleTimers() const;
59 void UpdateTimerThrottling(bool was_throttled);
57 60
58 scoped_refptr<TaskQueue> loading_task_queue_; 61 scoped_refptr<TaskQueue> loading_task_queue_;
59 scoped_refptr<TaskQueue> timer_task_queue_; 62 scoped_refptr<TaskQueue> timer_task_queue_;
60 scoped_refptr<TaskQueue> unthrottled_task_queue_; 63 scoped_refptr<TaskQueue> unthrottled_task_queue_;
61 std::unique_ptr<WebTaskRunnerImpl> loading_web_task_runner_; 64 std::unique_ptr<WebTaskRunnerImpl> loading_web_task_runner_;
62 std::unique_ptr<WebTaskRunnerImpl> timer_web_task_runner_; 65 std::unique_ptr<WebTaskRunnerImpl> timer_web_task_runner_;
63 std::unique_ptr<WebTaskRunnerImpl> unthrottled_web_task_runner_; 66 std::unique_ptr<WebTaskRunnerImpl> unthrottled_web_task_runner_;
64 RendererSchedulerImpl* renderer_scheduler_; // NOT OWNED 67 RendererSchedulerImpl* renderer_scheduler_; // NOT OWNED
65 WebViewSchedulerImpl* parent_web_view_scheduler_; // NOT OWNED 68 WebViewSchedulerImpl* parent_web_view_scheduler_; // NOT OWNED
66 base::trace_event::BlameContext* blame_context_; // NOT OWNED 69 base::trace_event::BlameContext* blame_context_; // NOT OWNED
67 TaskQueue::PumpPolicy virtual_time_pump_policy_; 70 TaskQueue::PumpPolicy virtual_time_pump_policy_;
68 bool frame_visible_; 71 bool frame_visible_;
69 bool page_visible_; 72 bool page_visible_;
73 bool cross_origin_;
70 74
71 DISALLOW_COPY_AND_ASSIGN(WebFrameSchedulerImpl); 75 DISALLOW_COPY_AND_ASSIGN(WebFrameSchedulerImpl);
72 }; 76 };
73 77
74 } // namespace scheduler 78 } // namespace scheduler
75 } // namespace blink 79 } // namespace blink
76 80
77 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_FRAME_SCHED ULER_IMPL_H_ 81 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_FRAME_SCHED ULER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698