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

Unified Diff: webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc

Issue 17447007: Change WGC3DInProcessCBImpl factories to return a base class pointer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months 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: webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index 35b1f131a70de0d1c87d7e75c490e711c1651a61..6641044452f3aa6589bed0e698fa31bbf241c6a6 100644
--- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -778,22 +778,25 @@ WebGraphicsContext3DInProcessCommandBufferImpl::EnableVirtualizedContext() {
}
// static
-WebGraphicsContext3DInProcessCommandBufferImpl*
+scoped_ptr<WebKit::WebGraphicsContext3D>
WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext(
const WebKit::WebGraphicsContext3D::Attributes& attributes,
gfx::AcceleratedWidget window) {
- if (!gfx::GLSurface::InitializeOneOff())
- return NULL;
- return new WebGraphicsContext3DInProcessCommandBufferImpl(
- attributes, false, window);
+ scoped_ptr<WebKit::WebGraphicsContext3D> context;
+ if (gfx::GLSurface::InitializeOneOff()) {
+ context.reset(new WebGraphicsContext3DInProcessCommandBufferImpl(
+ attributes, false, window));
+ }
+ return context.Pass();
}
// static
-WebGraphicsContext3DInProcessCommandBufferImpl*
+scoped_ptr<WebKit::WebGraphicsContext3D>
WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext(
const WebKit::WebGraphicsContext3D::Attributes& attributes) {
- return new WebGraphicsContext3DInProcessCommandBufferImpl(
- attributes, true, gfx::kNullAcceleratedWidget);
+ return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl(
+ attributes, true, gfx::kNullAcceleratedWidget))
+ .PassAs<WebKit::WebGraphicsContext3D>();
}
WebGraphicsContext3DInProcessCommandBufferImpl::

Powered by Google App Engine
This is Rietveld 408576698