0

Android WebView: Crash on compositor context loss

Android webview does not, and in some cases cannot correctly handle
context loss. Explicitly crash on context loss so they generate
consistent crash stacks.

CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1441273002

Cr-Commit-Position: refs/heads/master@{#367371}
This commit is contained in:
boliu
2016-01-04 13:24:19 -08:00
committed by Commit bot
parent a45c0ddbd4
commit b354724cc2
6 changed files with 14 additions and 2 deletions

@ -59,7 +59,7 @@ AwRenderThreadContextProvider::AwRenderThreadContextProvider(
gpu::gles2::ContextCreationAttribHelper attribs_for_gles2;
gpu_blink::WebGraphicsContext3DImpl::ConvertAttributes(attributes,
&attribs_for_gles2);
attribs_for_gles2.lose_context_when_out_of_memory = true;
attribs_for_gles2.lose_context_when_out_of_memory = false;
context_.reset(gpu::GLInProcessContext::Create(
service,

@ -17,6 +17,11 @@ ParentOutputSurface::ParentOutputSurface(
ParentOutputSurface::~ParentOutputSurface() {
}
void ParentOutputSurface::DidLoseOutputSurface() {
// Android WebView does not handle context loss.
LOG(FATAL) << "Render thread context loss";
}
void ParentOutputSurface::Reshape(const gfx::Size& size,
float scale_factor,
bool has_alpha) {

@ -17,6 +17,7 @@ class ParentOutputSurface : NON_EXPORTED_BASE(public cc::OutputSurface) {
~ParentOutputSurface() override;
// OutputSurface overrides.
void DidLoseOutputSurface() override;
void Reshape(const gfx::Size& size,
float scale_factor,
bool has_alpha) override;

@ -151,7 +151,7 @@ class CC_EXPORT OutputSurface : public base::trace_event::MemoryDumpProvider {
// Get the texture for the main image's overlay.
virtual unsigned GetOverlayTextureId() const;
void DidLoseOutputSurface();
virtual void DidLoseOutputSurface();
void SetMemoryPolicy(const ManagedMemoryPolicy& policy);
// Support for a pull-model where draws are requested by the output surface.

@ -92,6 +92,11 @@ void SynchronousCompositorOutputSurface::SetSyncClient(
sync_client_ = compositor;
}
void SynchronousCompositorOutputSurface::DidLoseOutputSurface() {
// Android WebView does not handle context loss.
LOG(FATAL) << "Renderer compositor context loss";
}
bool SynchronousCompositorOutputSurface::BindToClient(
cc::OutputSurfaceClient* surface_client) {
DCHECK(CalledOnValidThread());

@ -67,6 +67,7 @@ class SynchronousCompositorOutputSurface
void SetSyncClient(SynchronousCompositorOutputSurfaceClient* compositor);
// OutputSurface.
void DidLoseOutputSurface() override;
bool BindToClient(cc::OutputSurfaceClient* surface_client) override;
void DetachFromClient() override;
void Reshape(const gfx::Size& size,