Index: content/common/webkitplatformsupport_impl.cc |
diff --git a/content/common/webkitplatformsupport_impl.cc b/content/common/webkitplatformsupport_impl.cc |
index dd7a9fcb7961f2e9fc64ecae629d1b88ff6e5390..991dc1e13d032c3f5f88a200659834b16506a55b 100644 |
--- a/content/common/webkitplatformsupport_impl.cc |
+++ b/content/common/webkitplatformsupport_impl.cc |
@@ -13,6 +13,10 @@ |
namespace content { |
+namespace { |
+WebKitPlatformSupportImpl::OffscreenContextFactory* g_context_factory = NULL; |
+} |
+ |
WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() { |
} |
@@ -55,6 +59,8 @@ WebKitPlatformSupportImpl::CreateWebSocketBridge( |
WebKit::WebGraphicsContext3D* |
WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
const WebGraphicsContext3D::Attributes& attributes) { |
+ if (g_context_factory) |
+ return g_context_factory(); |
// The WebGraphicsContext3DInProcessImpl code path is used for |
// layout tests (though not through this code) as well as for |
// debugging and bringing up new ports. |
@@ -69,6 +75,12 @@ WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
} |
} |
+// static |
+void WebKitPlatformSupportImpl::SetOffscreenContextFactoryForTest( |
+ OffscreenContextFactory factory) { |
+ g_context_factory = factory; |
+} |
+ |
GpuChannelHostFactory* WebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
NOTREACHED(); |
return NULL; |