| Index: content/browser/android/synchronous_compositor_browser_filter.cc
|
| diff --git a/content/browser/android/synchronous_compositor_browser_filter.cc b/content/browser/android/synchronous_compositor_browser_filter.cc
|
| index 41999b3778320406491c7a14c2644b7e80f4ceaf..d1a7b9f9c9873fd7c0e646256f5d12e43d0be213 100644
|
| --- a/content/browser/android/synchronous_compositor_browser_filter.cc
|
| +++ b/content/browser/android/synchronous_compositor_browser_filter.cc
|
| @@ -19,14 +19,13 @@ namespace content {
|
| SynchronousCompositorBrowserFilter::SynchronousCompositorBrowserFilter(
|
| int process_id)
|
| : BrowserMessageFilter(SyncCompositorMsgStart),
|
| - render_process_host_(RenderProcessHost::FromID(process_id)),
|
| - window_android_in_vsync_(nullptr) {
|
| + render_process_host_(RenderProcessHost::FromID(process_id)) {
|
| DCHECK(render_process_host_);
|
| }
|
|
|
| SynchronousCompositorBrowserFilter::~SynchronousCompositorBrowserFilter() {
|
| DCHECK(compositor_host_pending_renderer_state_.empty());
|
| - // TODO(boliu): signal pending frames.
|
| + DCHECK(future_map_.empty());
|
| }
|
|
|
| void SynchronousCompositorBrowserFilter::SyncStateAfterVSync(
|
| @@ -96,6 +95,11 @@ void SynchronousCompositorBrowserFilter::SetFrameFuture(
|
| scoped_refptr<SynchronousCompositor::FrameFuture> frame_future) {
|
| DCHECK(frame_future);
|
| base::AutoLock lock(future_map_lock_);
|
| + if (!filter_ready_) {
|
| + frame_future->setFrame(nullptr);
|
| + return;
|
| + }
|
| +
|
| auto itr = future_map_.find(routing_id);
|
| if (itr == future_map_.end()) {
|
| auto emplace_result = future_map_.emplace(routing_id, FrameFutureQueue());
|
| @@ -112,6 +116,30 @@ void SynchronousCompositorBrowserFilter::SetFrameFuture(
|
| itr->second.emplace_back(std::move(frame_future));
|
| }
|
|
|
| +void SynchronousCompositorBrowserFilter::OnFilterAdded(IPC::Channel* channel) {
|
| + base::AutoLock lock(future_map_lock_);
|
| + filter_ready_ = true;
|
| +}
|
| +
|
| +void SynchronousCompositorBrowserFilter::OnFilterRemoved() {
|
| + SignalAllFutures();
|
| +}
|
| +
|
| +void SynchronousCompositorBrowserFilter::OnChannelClosing() {
|
| + SignalAllFutures();
|
| +}
|
| +
|
| +void SynchronousCompositorBrowserFilter::SignalAllFutures() {
|
| + base::AutoLock lock(future_map_lock_);
|
| + for (auto& pair : future_map_) {
|
| + for (auto& future_ptr : pair.second) {
|
| + future_ptr->setFrame(nullptr);
|
| + }
|
| + }
|
| + future_map_.clear();
|
| + filter_ready_ = false;
|
| +}
|
| +
|
| void SynchronousCompositorBrowserFilter::OnCompositingDidCommit() {
|
| NOTREACHED();
|
| }
|
|
|