OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "content/common/child_thread.h" | 6 #include "content/common/child_thread.h" |
7 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 7 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
8 #include "content/common/socket_stream_dispatcher.h" | 8 #include "content/common/socket_stream_dispatcher.h" |
9 #include "content/common/webkitplatformsupport_impl.h" | 9 #include "content/common/webkitplatformsupport_impl.h" |
10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
11 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
12 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 13 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() { | 17 WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() { |
17 } | 18 } |
18 | 19 |
19 WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() { | 20 WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() { |
20 } | 21 } |
21 | 22 |
(...skipping 30 matching lines...) Expand all Loading... |
52 WebKitPlatformSupportImpl::CreateWebSocketBridge( | 53 WebKitPlatformSupportImpl::CreateWebSocketBridge( |
53 WebKit::WebSocketStreamHandle* handle, | 54 WebKit::WebSocketStreamHandle* handle, |
54 webkit_glue::WebSocketStreamHandleDelegate* delegate) { | 55 webkit_glue::WebSocketStreamHandleDelegate* delegate) { |
55 SocketStreamDispatcher* dispatcher = | 56 SocketStreamDispatcher* dispatcher = |
56 ChildThread::current()->socket_stream_dispatcher(); | 57 ChildThread::current()->socket_stream_dispatcher(); |
57 return dispatcher->CreateBridge(handle, delegate); | 58 return dispatcher->CreateBridge(handle, delegate); |
58 } | 59 } |
59 | 60 |
60 WebKit::WebGraphicsContext3D* | 61 WebKit::WebGraphicsContext3D* |
61 WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( | 62 WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
62 const WebGraphicsContext3D::Attributes& attributes) { | 63 const WebGraphicsContext3D::Attributes& attributes, |
| 64 WebKit::WebView* webView) { |
63 // The WebGraphicsContext3DInProcessImpl code path is used for | 65 // The WebGraphicsContext3DInProcessImpl code path is used for |
64 // layout tests (though not through this code) as well as for | 66 // layout tests (though not through this code) as well as for |
65 // debugging and bringing up new ports. | 67 // debugging and bringing up new ports. |
| 68 |
| 69 // The webView parameter is currently unsued by will be used by the |
| 70 // <browser> plugin code, which is currently a separate patch. |
| 71 (void) webView; |
| 72 |
66 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | 73 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
67 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( | 74 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
68 attributes, false); | 75 attributes, false); |
69 } else { | 76 } else { |
70 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client; | 77 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client; |
71 GpuChannelHostFactory* factory = GetGpuChannelHostFactory(); | 78 GpuChannelHostFactory* factory = GetGpuChannelHostFactory(); |
72 if (!factory) | 79 if (!factory) |
73 return NULL; | 80 return NULL; |
74 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( | 81 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
75 new WebGraphicsContext3DCommandBufferImpl( | 82 new WebGraphicsContext3DCommandBufferImpl( |
76 0, GURL(), factory, null_client)); | 83 0, GURL(), factory, null_client)); |
77 if (!context->Initialize( | 84 if (!context->Initialize( |
78 attributes, | 85 attributes, |
79 false, | 86 false, |
80 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)) | 87 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)) |
81 return NULL; | 88 return NULL; |
82 return context.release(); | 89 return context.release(); |
83 } | 90 } |
84 } | 91 } |
85 | 92 |
86 GpuChannelHostFactory* WebKitPlatformSupportImpl::GetGpuChannelHostFactory() { | 93 GpuChannelHostFactory* WebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
87 NOTREACHED(); | 94 NOTREACHED(); |
88 return NULL; | 95 return NULL; |
89 } | 96 } |
90 | 97 |
91 } // namespace content | 98 } // namespace content |
OLD | NEW |