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

Side by Side Diff: content/browser/renderer_host/begin_frame_manager.h

Issue 1000503002: Add BeginFrameObserverProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add BeginFrameManager Created 5 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
(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 CONTENT_BROWSER_RENDERER_HOST_BEGIN_FRAME_MANAGER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_BEGIN_FRAME_MANAGER_H_
7
8 #include "content/common/content_export.h"
9 #include "ui/compositor/compositor.h"
10 #include "ui/compositor/compositor_observer.h"
11
12 namespace cc {
13 struct BeginFrameArgs;
14 }
15
16 namespace content {
17
18 // This is the interface from the BeginFrameManager which manages sending
19 // BeginFrame messages.
20 class BeginFrameManagerClient {
21 public:
22 virtual void SendBeginFrame(const cc::BeginFrameArgs& args) = 0;
23 };
24
25 // This class is used to manage all of the RWHV state and functionality that is
danakj 2015/03/17 18:56:45 can you spell out RenderWidgetHostView here?
simonhong 2015/03/19 15:48:46 Done.
26 // associated with BeginFrame message handling.
27 class CONTENT_EXPORT BeginFrameManager
brianderson 2015/03/17 22:29:32 BeginFrameManager is a somewhat ambiguous name. Wh
simonhong 2015/03/19 15:48:46 Done.
28 : public ui::CompositorBeginFrameObserver {
29 public:
30 explicit BeginFrameManager(BeginFrameManagerClient* client);
31 virtual ~BeginFrameManager();
32
33 void OnSetNeedsBeginFrames(bool needs_begin_frames);
34
35 void SetCompositor(ui::Compositor* compositor);
36 void ResetCompositor();
37
38 // Overridden from ui::CompositorBeginFrameObserver:
39 void OnSendBeginFrame(const cc::BeginFrameArgs& args) override;
40
41 private:
42 void StartObservingBeginFrames();
43 void StopObservingBeginFrames();
44
45 // True when RenderWidget needs a BeginFrame message.
46 bool needs_begin_frames_;
47
48 // Pass |last_sent_begin_frame_args_| to compositor when |this| is added as a
49 // CompositorBeginFrameObserver. With this, Compositor can determine whether
50 // latest BeginFrameArgs can be used immediately or not.
51 cc::BeginFrameArgs last_sent_begin_frame_args_;
52
53 // Not owned.
danakj 2015/03/17 18:56:45 I think the ownership is implied by the raw pointe
simonhong 2015/03/19 15:48:46 Removed.
54 BeginFrameManagerClient* client_;
55 ui::Compositor* compositor_;
56
57 DISALLOW_COPY_AND_ASSIGN(BeginFrameManager);
58 };
59
60 } // namespace content
61
62 #endif // CONTENT_BROWSER_RENDERER_HOST_BEGIN_FRAME_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698