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

Side by Side Diff: content/renderer/android/synchronous_compositor_output_surface.cc

Issue 1441273002: Android WebView: Crash on compositor context loss (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't lose on memory Created 5 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/renderer/android/synchronous_compositor_output_surface.h" 5 #include "content/renderer/android/synchronous_compositor_output_surface.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {} 86 SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {}
87 87
88 void SynchronousCompositorOutputSurface::SetSyncClient( 88 void SynchronousCompositorOutputSurface::SetSyncClient(
89 SynchronousCompositorOutputSurfaceClient* compositor) { 89 SynchronousCompositorOutputSurfaceClient* compositor) {
90 DCHECK(CalledOnValidThread()); 90 DCHECK(CalledOnValidThread());
91 sync_client_ = compositor; 91 sync_client_ = compositor;
92 } 92 }
93 93
94 void SynchronousCompositorOutputSurface::DidLoseOutputSurface() {
95 // Android WebView does not handle context loss.
96 LOG(FATAL) << "Renderer compositor context loss";
97 }
98
94 bool SynchronousCompositorOutputSurface::BindToClient( 99 bool SynchronousCompositorOutputSurface::BindToClient(
95 cc::OutputSurfaceClient* surface_client) { 100 cc::OutputSurfaceClient* surface_client) {
96 DCHECK(CalledOnValidThread()); 101 DCHECK(CalledOnValidThread());
97 if (!cc::OutputSurface::BindToClient(surface_client)) 102 if (!cc::OutputSurface::BindToClient(surface_client))
98 return false; 103 return false;
99 104
100 client_->SetMemoryPolicy(memory_policy_); 105 client_->SetMemoryPolicy(memory_policy_);
101 registry_->RegisterOutputSurface(routing_id_, this); 106 registry_->RegisterOutputSurface(routing_id_, this);
102 registered_ = true; 107 registered_ = true;
103 return true; 108 return true;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 scoped_ptr<FrameSwapMessageQueue::SendMessageScope> send_message_scope = 273 scoped_ptr<FrameSwapMessageQueue::SendMessageScope> send_message_scope =
269 frame_swap_message_queue_->AcquireSendMessageScope(); 274 frame_swap_message_queue_->AcquireSendMessageScope();
270 frame_swap_message_queue_->DrainMessages(messages); 275 frame_swap_message_queue_->DrainMessages(messages);
271 } 276 }
272 277
273 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { 278 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const {
274 return thread_checker_.CalledOnValidThread(); 279 return thread_checker_.CalledOnValidThread();
275 } 280 }
276 281
277 } // namespace content 282 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698