Index: content/renderer/gpu/compositor_external_begin_frame_source.h |
diff --git a/content/renderer/gpu/compositor_external_begin_frame_source.h b/content/renderer/gpu/compositor_external_begin_frame_source.h |
index 8a965772f36ddd4493fa854e7e66ba116c60aa36..64aa7d51944f70c99db4e8fb859c685a2b8a12a3 100644 |
--- a/content/renderer/gpu/compositor_external_begin_frame_source.h |
+++ b/content/renderer/gpu/compositor_external_begin_frame_source.h |
@@ -22,8 +22,15 @@ namespace content { |
// This class can be created only on the main thread, but then becomes pinned |
// to a fixed thread where cc::Scheduler is running. |
+// |
+// TODO(enne): This only implements the BeginFrameSource interface to |
+// make it easier to give to cc as an external begin frame source. In the |
+// future, if this is owned by an output surface, then the internal |
+// cc::ExternalBeginFrameSource can be the BeginFrameSource passed to cc |
+// directly rather than proxied by this class. |
class CompositorExternalBeginFrameSource |
: public cc::BeginFrameSource, |
+ public cc::ExternalBeginFrameSourceClient, |
public NON_EXPORTED_BASE(base::NonThreadSafe) { |
public: |
explicit CompositorExternalBeginFrameSource( |
@@ -38,6 +45,9 @@ class CompositorExternalBeginFrameSource |
void DidFinishFrame(cc::BeginFrameObserver* obs, |
size_t remaining_frames) override {} |
+ // cc::ExternalBeginFrameSourceClient implementation. |
+ void OnNeedsBeginFrames(bool need_begin_frames) override; |
+ |
private: |
class CompositorExternalBeginFrameSourceProxy |
: public base::RefCountedThreadSafe< |
@@ -62,22 +72,20 @@ class CompositorExternalBeginFrameSource |
DISALLOW_COPY_AND_ASSIGN(CompositorExternalBeginFrameSourceProxy); |
}; |
- void SetClientReady(); |
void OnMessageReceived(const IPC::Message& message); |
- |
void OnSetBeginFrameSourcePaused(bool paused); |
void OnBeginFrame(const cc::BeginFrameArgs& args); |
bool Send(IPC::Message* message); |
+ // Shared helper implementation. |
+ cc::ExternalBeginFrameSource external_begin_frame_source_; |
+ |
scoped_refptr<CompositorForwardingMessageFilter> begin_frame_source_filter_; |
scoped_refptr<CompositorExternalBeginFrameSourceProxy> |
begin_frame_source_proxy_; |
scoped_refptr<IPC::SyncMessageFilter> message_sender_; |
int routing_id_; |
CompositorForwardingMessageFilter::Handler begin_frame_source_filter_handler_; |
- cc::BeginFrameArgs missed_begin_frame_args_; |
- std::unordered_set<cc::BeginFrameObserver*> observers_; |
- bool paused_ = false; |
DISALLOW_COPY_AND_ASSIGN(CompositorExternalBeginFrameSource); |
}; |