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

Side by Side Diff: components/scheduler/renderer/web_view_scheduler_impl.h

Issue 1447563002: Implement frame attribution (FrameBlamer) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 4 years, 9 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 COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ 5 #ifndef COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_
6 #define COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ 6 #define COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "components/scheduler/base/task_queue.h" 13 #include "components/scheduler/base/task_queue.h"
14 #include "components/scheduler/scheduler_export.h" 14 #include "components/scheduler/scheduler_export.h"
15 #include "third_party/WebKit/public/platform/WebViewScheduler.h" 15 #include "third_party/WebKit/public/platform/WebViewScheduler.h"
16 16
17 namespace base { 17 namespace base {
18 class SingleThreadTaskRunner; 18 class SingleThreadTaskRunner;
19 } // namespace base 19 } // namespace base
20 20
21 namespace blink { 21 namespace blink {
22 class WebFrame;
22 class WebView; 23 class WebView;
23 } // namespace blink 24 } // namespace blink
24 25
25 namespace scheduler { 26 namespace scheduler {
26 27
27 class AutoAdvancingVirtualTimeDomain; 28 class AutoAdvancingVirtualTimeDomain;
28 class RendererSchedulerImpl; 29 class RendererSchedulerImpl;
29 class WebFrameSchedulerImpl; 30 class WebFrameSchedulerImpl;
30 31
31 class SCHEDULER_EXPORT WebViewSchedulerImpl : public blink::WebViewScheduler { 32 class SCHEDULER_EXPORT WebViewSchedulerImpl : public blink::WebViewScheduler {
32 public: 33 public:
33 WebViewSchedulerImpl(blink::WebView* web_view, 34 WebViewSchedulerImpl(blink::WebView* web_view,
34 RendererSchedulerImpl* renderer_scheduler, 35 RendererSchedulerImpl* renderer_scheduler,
35 bool disable_background_timer_throttling); 36 bool disable_background_timer_throttling);
36 37
37 ~WebViewSchedulerImpl() override; 38 ~WebViewSchedulerImpl() override;
38 39
39 // blink::WebViewScheduler implementation: 40 // blink::WebViewScheduler implementation:
40 void setPageVisible(bool page_visible) override; 41 void setPageVisible(bool page_visible) override;
41 blink::WebPassOwnPtr<blink::WebFrameScheduler> createFrameScheduler() 42 blink::WebPassOwnPtr<blink::WebFrameScheduler> createFrameScheduler(
42 override; 43 blink::WebBlameContext* blame_context) override;
43 void enableVirtualTime() override; 44 void enableVirtualTime() override;
44 void setAllowVirtualTimeToAdvance( 45 void setAllowVirtualTimeToAdvance(
45 bool allow_virtual_time_to_advance) override; 46 bool allow_virtual_time_to_advance) override;
46 47
47 // Virtual for testing. 48 // Virtual for testing.
48 virtual void AddConsoleWarning(const std::string& message); 49 virtual void AddConsoleWarning(const std::string& message);
49 50
50 scoped_ptr<WebFrameSchedulerImpl> createWebFrameSchedulerImpl(); 51 scoped_ptr<WebFrameSchedulerImpl> createWebFrameSchedulerImpl(
52 blink::WebBlameContext* blame_context);
51 53
52 private: 54 private:
53 friend class WebFrameSchedulerImpl; 55 friend class WebFrameSchedulerImpl;
54 56
55 void Unregister(WebFrameSchedulerImpl* frame_scheduler); 57 void Unregister(WebFrameSchedulerImpl* frame_scheduler);
56 58
57 AutoAdvancingVirtualTimeDomain* virtual_time_domain() const { 59 AutoAdvancingVirtualTimeDomain* virtual_time_domain() const {
58 return virtual_time_domain_.get(); 60 return virtual_time_domain_.get();
59 } 61 }
60 62
61 std::set<WebFrameSchedulerImpl*> frame_schedulers_; 63 std::set<WebFrameSchedulerImpl*> frame_schedulers_;
62 scoped_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_; 64 scoped_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_;
63 TaskQueue::PumpPolicy virtual_time_pump_policy_; 65 TaskQueue::PumpPolicy virtual_time_pump_policy_;
64 blink::WebView* web_view_; 66 blink::WebView* web_view_;
65 RendererSchedulerImpl* renderer_scheduler_; 67 RendererSchedulerImpl* renderer_scheduler_;
66 bool page_visible_; 68 bool page_visible_;
67 bool disable_background_timer_throttling_; 69 bool disable_background_timer_throttling_;
68 bool allow_virtual_time_to_advance_; 70 bool allow_virtual_time_to_advance_;
69 71
70 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); 72 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl);
71 }; 73 };
72 74
73 } // namespace scheduler 75 } // namespace scheduler
74 76
75 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ 77 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698