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

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

Issue 2118903002: scheduler: Move the Blink scheduler into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_SCHEDULER_RENDERER_RENDER_WIDGET_SIGNALS_H_
6 #define COMPONENTS_SCHEDULER_RENDERER_RENDER_WIDGET_SIGNALS_H_
7
8 #include <memory>
9
10 #include "base/trace_event/trace_event.h"
11 #include "base/trace_event/trace_event_argument.h"
12 #include "components/scheduler/scheduler_export.h"
13
14 namespace scheduler {
15
16 class RenderWidgetSchedulingState;
17
18 class SCHEDULER_EXPORT RenderWidgetSignals {
19 public:
20 class SCHEDULER_EXPORT Observer {
21 public:
22 virtual ~Observer() {}
23
24 // If |hidden| is true then all render widgets managed by this renderer
25 // process have been hidden.
26 // If |hidden| is false at least one render widget managed by this renderer
27 // process has become visible and the renderer is no longer hidden.
28 // Will be called on the main thread.
29 virtual void SetAllRenderWidgetsHidden(bool hidden) = 0;
30
31 // Tells the observer whether or not we have at least one touch handler on
32 // a visible render widget. Will be called on the main thread.
33 virtual void SetHasVisibleRenderWidgetWithTouchHandler(
34 bool has_visible_render_widget_with_touch_handler) = 0;
35 };
36
37 explicit RenderWidgetSignals(Observer* observer);
38
39 std::unique_ptr<RenderWidgetSchedulingState> NewRenderWidgetSchedulingState();
40
41 void AsValueInto(base::trace_event::TracedValue* state) const;
42
43 private:
44 friend class RenderWidgetSchedulingState;
45
46 void IncNumVisibleRenderWidgets();
47 void DecNumVisibleRenderWidgets();
48 void IncNumVisibleRenderWidgetsWithTouchHandlers();
49 void DecNumVisibleRenderWidgetsWithTouchHandlers();
50
51 Observer* observer_; // NOT OWNED
52 int num_visible_render_widgets_;
53 int num_visible_render_widgets_with_touch_handlers_;
54 };
55
56 } // namespace scheduler
57
58 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDER_WIDGET_SIGNALS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698