| 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 "content/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 WebKit::WebMimeRegistry* mime_registry = | 222 WebKit::WebMimeRegistry* mime_registry = |
| 223 GetContentClient()->renderer()->OverrideWebMimeRegistry(); | 223 GetContentClient()->renderer()->OverrideWebMimeRegistry(); |
| 224 if (mime_registry) | 224 if (mime_registry) |
| 225 return mime_registry; | 225 return mime_registry; |
| 226 return mime_registry_.get(); | 226 return mime_registry_.get(); |
| 227 } | 227 } |
| 228 | 228 |
| 229 WebKit::WebFileUtilities* | 229 WebKit::WebFileUtilities* |
| 230 RendererWebKitPlatformSupportImpl::fileUtilities() { | 230 RendererWebKitPlatformSupportImpl::fileUtilities() { |
| 231 if (!file_utilities_) { | 231 if (!file_utilities_) { |
| 232 file_utilities_.reset(new FileUtilities(thread_safe_sender_)); | 232 file_utilities_.reset(new FileUtilities(thread_safe_sender_.get())); |
| 233 file_utilities_->set_sandbox_enabled(sandboxEnabled()); | 233 file_utilities_->set_sandbox_enabled(sandboxEnabled()); |
| 234 } | 234 } |
| 235 return file_utilities_.get(); | 235 return file_utilities_.get(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 WebKit::WebSandboxSupport* RendererWebKitPlatformSupportImpl::sandboxSupport() { | 238 WebKit::WebSandboxSupport* RendererWebKitPlatformSupportImpl::sandboxSupport() { |
| 239 #if defined(OS_ANDROID) | 239 #if defined(OS_ANDROID) |
| 240 // WebKit doesn't use WebSandboxSupport on android. | 240 // WebKit doesn't use WebSandboxSupport on android. |
| 241 return NULL; | 241 return NULL; |
| 242 #else | 242 #else |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 std::vector<char> profile; | 757 std::vector<char> profile; |
| 758 RenderThread::Get()->Send( | 758 RenderThread::Get()->Send( |
| 759 new ViewHostMsg_GetMonitorColorProfile(&profile)); | 759 new ViewHostMsg_GetMonitorColorProfile(&profile)); |
| 760 *to_profile = profile; | 760 *to_profile = profile; |
| 761 } | 761 } |
| 762 | 762 |
| 763 //------------------------------------------------------------------------------ | 763 //------------------------------------------------------------------------------ |
| 764 | 764 |
| 765 WebBlobRegistry* RendererWebKitPlatformSupportImpl::blobRegistry() { | 765 WebBlobRegistry* RendererWebKitPlatformSupportImpl::blobRegistry() { |
| 766 // thread_safe_sender_ can be NULL when running some tests. | 766 // thread_safe_sender_ can be NULL when running some tests. |
| 767 if (!blob_registry_.get() && thread_safe_sender_) | 767 if (!blob_registry_.get() && thread_safe_sender_.get()) |
| 768 blob_registry_.reset(new WebBlobRegistryImpl(thread_safe_sender_)); | 768 blob_registry_.reset(new WebBlobRegistryImpl(thread_safe_sender_.get())); |
| 769 return blob_registry_.get(); | 769 return blob_registry_.get(); |
| 770 } | 770 } |
| 771 | 771 |
| 772 //------------------------------------------------------------------------------ | 772 //------------------------------------------------------------------------------ |
| 773 | 773 |
| 774 void RendererWebKitPlatformSupportImpl::sampleGamepads(WebGamepads& gamepads) { | 774 void RendererWebKitPlatformSupportImpl::sampleGamepads(WebGamepads& gamepads) { |
| 775 if (g_test_gamepads == 0) { | 775 if (g_test_gamepads == 0) { |
| 776 if (!gamepad_shared_memory_reader_) | 776 if (!gamepad_shared_memory_reader_) |
| 777 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); | 777 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); |
| 778 gamepad_shared_memory_reader_->SampleGamepads(gamepads); | 778 gamepad_shared_memory_reader_->SampleGamepads(gamepads); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 883 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
| 884 RenderThreadImpl::current(), | 884 RenderThreadImpl::current(), |
| 885 attributes, | 885 attributes, |
| 886 GURL(attributes.topDocumentURL)); | 886 GURL(attributes.topDocumentURL)); |
| 887 } | 887 } |
| 888 | 888 |
| 889 //------------------------------------------------------------------------------ | 889 //------------------------------------------------------------------------------ |
| 890 | 890 |
| 891 WebKit::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: | 891 WebKit::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: |
| 892 createSharedOffscreenGraphicsContext3DProvider() { | 892 createSharedOffscreenGraphicsContext3DProvider() { |
| 893 if (!shared_offscreen_context_ || | 893 if (!shared_offscreen_context_.get() || |
| 894 shared_offscreen_context_->DestroyedOnMainThread()) { | 894 shared_offscreen_context_->DestroyedOnMainThread()) { |
| 895 shared_offscreen_context_ = | 895 shared_offscreen_context_ = |
| 896 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 896 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 897 } | 897 } |
| 898 if (!shared_offscreen_context_) | 898 if (!shared_offscreen_context_.get()) |
| 899 return NULL; | 899 return NULL; |
| 900 return new webkit::gpu::WebGraphicsContext3DProviderImpl( | 900 return new webkit::gpu::WebGraphicsContext3DProviderImpl( |
| 901 shared_offscreen_context_); | 901 shared_offscreen_context_); |
| 902 } | 902 } |
| 903 | 903 |
| 904 //------------------------------------------------------------------------------ | 904 //------------------------------------------------------------------------------ |
| 905 | 905 |
| 906 WebKit::WebCompositorSupport* | 906 WebKit::WebCompositorSupport* |
| 907 RendererWebKitPlatformSupportImpl::compositorSupport() { | 907 RendererWebKitPlatformSupportImpl::compositorSupport() { |
| 908 return &compositor_support_; | 908 return &compositor_support_; |
| 909 } | 909 } |
| 910 | 910 |
| 911 } // namespace content | 911 } // namespace content |
| OLD | NEW |