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/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/platform_file.h" | 12 #include "base/platform_file.h" |
13 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "content/common/database_util.h" | 15 #include "content/common/database_util.h" |
16 #include "content/common/fileapi/webblobregistry_impl.h" | 16 #include "content/common/fileapi/webblobregistry_impl.h" |
17 #include "content/common/fileapi/webfilesystem_impl.h" | 17 #include "content/common/fileapi/webfilesystem_impl.h" |
18 #include "content/common/file_utilities_messages.h" | 18 #include "content/common/file_utilities_messages.h" |
| 19 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
19 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" | 20 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" |
20 #include "content/common/mime_registry_messages.h" | 21 #include "content/common/mime_registry_messages.h" |
21 #include "content/common/npobject_util.h" | 22 #include "content/common/npobject_util.h" |
22 #include "content/common/view_messages.h" | 23 #include "content/common/view_messages.h" |
23 #include "content/common/webmessageportchannel_impl.h" | 24 #include "content/common/webmessageportchannel_impl.h" |
24 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
25 #include "content/public/common/gpu_info.h" | 26 #include "content/public/common/gpu_info.h" |
26 #include "content/public/renderer/content_renderer_client.h" | 27 #include "content/public/renderer/content_renderer_client.h" |
27 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 28 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
28 #include "content/renderer/gamepad_shared_memory_reader.h" | 29 #include "content/renderer/gamepad_shared_memory_reader.h" |
(...skipping 14 matching lines...) Expand all Loading... |
43 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamCente
rClient.h" | 44 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamCente
rClient.h" |
44 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" | 45 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" |
45 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" | 46 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 48 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
48 #include "webkit/base/file_path_string_conversions.h" | 49 #include "webkit/base/file_path_string_conversions.h" |
49 #include "webkit/glue/simple_webmimeregistry_impl.h" | 50 #include "webkit/glue/simple_webmimeregistry_impl.h" |
50 #include "webkit/glue/webclipboard_impl.h" | 51 #include "webkit/glue/webclipboard_impl.h" |
51 #include "webkit/glue/webfileutilities_impl.h" | 52 #include "webkit/glue/webfileutilities_impl.h" |
52 #include "webkit/glue/webkit_glue.h" | 53 #include "webkit/glue/webkit_glue.h" |
| 54 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
53 | 55 |
54 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
55 #include "content/common/child_process_messages.h" | 57 #include "content/common/child_process_messages.h" |
56 #include "third_party/WebKit/Source/Platform/chromium/public/win/WebSandboxSuppo
rt.h" | 58 #include "third_party/WebKit/Source/Platform/chromium/public/win/WebSandboxSuppo
rt.h" |
57 #endif | 59 #endif |
58 | 60 |
59 #if defined(OS_MACOSX) | 61 #if defined(OS_MACOSX) |
60 #include "content/common/mac/font_descriptor.h" | 62 #include "content/common/mac/font_descriptor.h" |
61 #include "content/common/mac/font_loader.h" | 63 #include "content/common/mac/font_loader.h" |
62 #include "third_party/WebKit/Source/Platform/chromium/public/mac/WebSandboxSuppo
rt.h" | 64 #include "third_party/WebKit/Source/Platform/chromium/public/mac/WebSandboxSuppo
rt.h" |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 g_sandbox_enabled = enable; | 728 g_sandbox_enabled = enable; |
727 return was_enabled; | 729 return was_enabled; |
728 } | 730 } |
729 | 731 |
730 // static | 732 // static |
731 void RendererWebKitPlatformSupportImpl::SetMockGamepadsForTesting( | 733 void RendererWebKitPlatformSupportImpl::SetMockGamepadsForTesting( |
732 const WebGamepads& pads) { | 734 const WebGamepads& pads) { |
733 g_test_gamepads.Get() = pads; | 735 g_test_gamepads.Get() = pads; |
734 } | 736 } |
735 | 737 |
736 GpuChannelHostFactory* | |
737 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { | |
738 return RenderThreadImpl::current(); | |
739 } | |
740 | |
741 //------------------------------------------------------------------------------ | 738 //------------------------------------------------------------------------------ |
742 | 739 |
743 bool RendererWebKitPlatformSupportImpl::canHyphenate( | 740 bool RendererWebKitPlatformSupportImpl::canHyphenate( |
744 const WebKit::WebString& locale) { | 741 const WebKit::WebString& locale) { |
745 // Return false unless WebKit asks for US English dictionaries because WebKit | 742 // Return false unless WebKit asks for US English dictionaries because WebKit |
746 // can currently hyphenate only English words. | 743 // can currently hyphenate only English words. |
747 if (!locale.isEmpty() && !locale.equals("en-US")) | 744 if (!locale.isEmpty() && !locale.equals("en-US")) |
748 return false; | 745 return false; |
749 | 746 |
750 // Create a hyphenator object and attach it to the render thread so it can | 747 // Create a hyphenator object and attach it to the render thread so it can |
(...skipping 21 matching lines...) Expand all Loading... |
772 | 769 |
773 //------------------------------------------------------------------------------ | 770 //------------------------------------------------------------------------------ |
774 | 771 |
775 bool RendererWebKitPlatformSupportImpl::processMemorySizesInBytes( | 772 bool RendererWebKitPlatformSupportImpl::processMemorySizesInBytes( |
776 size_t* private_bytes, size_t* shared_bytes) { | 773 size_t* private_bytes, size_t* shared_bytes) { |
777 content::RenderThread::Get()->Send( | 774 content::RenderThread::Get()->Send( |
778 new ViewHostMsg_GetProcessMemorySizes(private_bytes, shared_bytes)); | 775 new ViewHostMsg_GetProcessMemorySizes(private_bytes, shared_bytes)); |
779 return true; | 776 return true; |
780 } | 777 } |
781 | 778 |
| 779 //------------------------------------------------------------------------------ |
| 780 |
| 781 WebKit::WebGraphicsContext3D* RendererWebKitPlatformSupportImpl:: |
| 782 createOffscreenGraphicsContext3D( |
| 783 const WebKit::WebGraphicsContext3D::Attributes& attributes) { |
| 784 if (OffscreenContextFactoryForTest()) |
| 785 return OffscreenContextFactoryForTest()(); |
| 786 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
| 787 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
| 788 attributes, false); |
| 789 } else { |
| 790 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
| 791 RenderThreadImpl::current(), attributes, |
| 792 GURL(attributes.topDocumentURL)); |
| 793 } |
| 794 } |
| 795 |
| 796 //------------------------------------------------------------------------------ |
| 797 |
| 798 WebKit::WebGraphicsContext3D* RendererWebKitPlatformSupportImpl:: |
| 799 sharedOffscreenGraphicsContext3D() { |
| 800 return RenderThreadImpl::current()->OffscreenContext3dForMainThread(); |
| 801 } |
| 802 |
| 803 |
782 } // namespace content | 804 } // namespace content |
OLD | NEW |