gpu: Lose context when BeginQueryEXT fails to allocate.

Instead of crashes, raise a GL_OUT_OF_MEMORY error. Since compositor
does not want to deal with these errors and it would leave it in a
bad state, add the ability to lose the context when GL_OUT_OF_MEMORY
occurs.

[email protected], [email protected], [email protected], piman
BUG=351587

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261120 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/webkit/common/gpu/context_provider_in_process.h b/webkit/common/gpu/context_provider_in_process.h
index fc1d15c..c42585f 100644
--- a/webkit/common/gpu/context_provider_in_process.h
+++ b/webkit/common/gpu/context_provider_in_process.h
@@ -26,9 +26,9 @@
       scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d,
       const std::string& debug_name);
 
-  // Calls Create() with a default factory method for creating an offscreen
-  // context.
-  static scoped_refptr<ContextProviderInProcess> CreateOffscreen();
+  // Uses default attributes for creating an offscreen context.
+  static scoped_refptr<ContextProviderInProcess> CreateOffscreen(
+      bool lose_context_when_out_of_memory);
 
   virtual blink::WebGraphicsContext3D* WebContext3D() OVERRIDE;