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/fileapi/webblobregistry_impl.h" |
7 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 8 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
8 #include "content/common/socket_stream_dispatcher.h" | 9 #include "content/common/socket_stream_dispatcher.h" |
| 10 #include "content/common/thread_safe_sender.h" |
9 #include "content/common/webkitplatformsupport_impl.h" | 11 #include "content/common/webkitplatformsupport_impl.h" |
10 #include "content/public/common/content_client.h" | 12 #include "content/public/common/content_client.h" |
11 #include "content/public/common/content_switches.h" | 13 #include "content/public/common/content_switches.h" |
12 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
13 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 15 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
14 | 16 |
| 17 using WebKit::WebBlobRegistry; |
| 18 |
15 namespace content { | 19 namespace content { |
16 | 20 |
17 namespace { | 21 namespace { |
18 WebKitPlatformSupportImpl::OffscreenContextFactory* g_context_factory = NULL; | 22 WebKitPlatformSupportImpl::OffscreenContextFactory* g_context_factory = NULL; |
19 } | 23 } |
20 | 24 |
21 WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() { | 25 WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() |
| 26 : thread_safe_sender_(ChildThread::current()->thread_safe_sender()) { |
22 } | 27 } |
23 | 28 |
24 WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() { | 29 WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() { |
25 } | 30 } |
26 | 31 |
27 string16 WebKitPlatformSupportImpl::GetLocalizedString(int message_id) { | 32 string16 WebKitPlatformSupportImpl::GetLocalizedString(int message_id) { |
28 return GetContentClient()->GetLocalizedString(message_id); | 33 return GetContentClient()->GetLocalizedString(message_id); |
29 } | 34 } |
30 | 35 |
31 base::StringPiece WebKitPlatformSupportImpl::GetDataResource( | 36 base::StringPiece WebKitPlatformSupportImpl::GetDataResource( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | 72 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
68 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( | 73 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
69 attributes, false); | 74 attributes, false); |
70 } else { | 75 } else { |
71 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 76 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
72 GetGpuChannelHostFactory(), attributes, | 77 GetGpuChannelHostFactory(), attributes, |
73 GURL(attributes.topDocumentURL)); | 78 GURL(attributes.topDocumentURL)); |
74 } | 79 } |
75 } | 80 } |
76 | 81 |
| 82 WebBlobRegistry* WebKitPlatformSupportImpl::blobRegistry() { |
| 83 if (!blob_registry_.get()) |
| 84 blob_registry_.reset(new WebBlobRegistryImpl(thread_safe_sender())); |
| 85 return blob_registry_.get(); |
| 86 } |
| 87 |
77 // static | 88 // static |
78 void WebKitPlatformSupportImpl::SetOffscreenContextFactoryForTest( | 89 void WebKitPlatformSupportImpl::SetOffscreenContextFactoryForTest( |
79 OffscreenContextFactory factory) { | 90 OffscreenContextFactory factory) { |
80 g_context_factory = factory; | 91 g_context_factory = factory; |
81 } | 92 } |
82 | 93 |
83 GpuChannelHostFactory* WebKitPlatformSupportImpl::GetGpuChannelHostFactory() { | 94 GpuChannelHostFactory* WebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
84 NOTREACHED(); | 95 NOTREACHED(); |
85 return NULL; | 96 return NULL; |
86 } | 97 } |
87 | 98 |
88 } // namespace content | 99 } // namespace content |
OLD | NEW |