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

Unified Diff: content/common/gpu/image_transport_surface_android.cc

Issue 1436533003: android: Handle getViewSurface() failure gracefully. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/image_transport_surface_android.cc
diff --git a/content/common/gpu/image_transport_surface_android.cc b/content/common/gpu/image_transport_surface_android.cc
index 8f374186338585569859286334c7698daf270d3c..79a16c0bbdf31687d8d446419e8e2889f6bd4bec 100644
--- a/content/common/gpu/image_transport_surface_android.cc
+++ b/content/common/gpu/image_transport_surface_android.cc
@@ -24,12 +24,14 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface(
DCHECK_EQ(handle.transport_type, gfx::NATIVE_DIRECT);
ANativeWindow* window =
GpuSurfaceLookup::GetInstance()->AcquireNativeWidget(handle.handle);
- CHECK(window) << "Failed to retrieve window handle.";
+ if (!window) {
+ LOG(WARNING) << "Failed to acquire native widget.";
+ return scoped_refptr<gfx::GLSurface>();
+ }
scoped_refptr<gfx::GLSurface> surface =
new gfx::NativeViewGLSurfaceEGL(window);
bool initialize_success = surface->Initialize();
- if (window)
- ANativeWindow_release(window);
+ ANativeWindow_release(window);
if (!initialize_success)
return scoped_refptr<gfx::GLSurface>();

Powered by Google App Engine
This is Rietveld 408576698