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/platform_file.h" | 10 #include "base/platform_file.h" |
11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "content/common/database_util.h" | 13 #include "content/common/database_util.h" |
14 #include "content/common/file_system/webfilesystem_impl.h" | 14 #include "content/common/file_system/webfilesystem_impl.h" |
15 #include "content/common/file_utilities_messages.h" | 15 #include "content/common/file_utilities_messages.h" |
16 #include "content/common/mime_registry_messages.h" | 16 #include "content/common/mime_registry_messages.h" |
17 #include "content/common/npobject_util.h" | 17 #include "content/common/npobject_util.h" |
18 #include "content/common/view_messages.h" | 18 #include "content/common/view_messages.h" |
19 #include "content/common/webblobregistry_impl.h" | 19 #include "content/common/webblobregistry_impl.h" |
20 #include "content/common/webmessageportchannel_impl.h" | 20 #include "content/common/webmessageportchannel_impl.h" |
21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
22 #include "content/public/renderer/content_renderer_client.h" | 22 #include "content/public/renderer/content_renderer_client.h" |
23 #include "content/renderer/gamepad_shared_memory_reader.h" | 23 #include "content/renderer/gamepad_shared_memory_reader.h" |
24 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | |
25 #include "content/renderer/indexed_db/renderer_webidbfactory_impl.h" | 24 #include "content/renderer/indexed_db/renderer_webidbfactory_impl.h" |
26 #include "content/renderer/media/audio_device.h" | 25 #include "content/renderer/media/audio_device.h" |
27 #include "content/renderer/media/audio_hardware.h" | 26 #include "content/renderer/media/audio_hardware.h" |
28 #include "content/renderer/render_thread_impl.h" | 27 #include "content/renderer/render_thread_impl.h" |
29 #include "content/renderer/render_view_impl.h" | 28 #include "content/renderer/render_view_impl.h" |
30 #include "content/renderer/renderer_clipboard_client.h" | 29 #include "content/renderer/renderer_clipboard_client.h" |
31 #include "content/renderer/renderer_webaudiodevice_impl.h" | 30 #include "content/renderer/renderer_webaudiodevice_impl.h" |
32 #include "content/renderer/renderer_webstoragenamespace_impl.h" | 31 #include "content/renderer/renderer_webstoragenamespace_impl.h" |
33 #include "content/renderer/websharedworkerrepository_impl.h" | 32 #include "content/renderer/websharedworkerrepository_impl.h" |
34 #include "googleurl/src/gurl.h" | 33 #include "googleurl/src/gurl.h" |
35 #include "ipc/ipc_sync_message_filter.h" | 34 #include "ipc/ipc_sync_message_filter.h" |
36 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis
try.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis
try.h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC
ontext3D.h" | |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" |
44 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandlerClient.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandlerClient.h" |
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" |
47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" |
48 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
49 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
50 #include "webkit/glue/simple_webmimeregistry_impl.h" | 48 #include "webkit/glue/simple_webmimeregistry_impl.h" |
51 #include "webkit/glue/webclipboard_impl.h" | 49 #include "webkit/glue/webclipboard_impl.h" |
52 #include "webkit/glue/webfileutilities_impl.h" | 50 #include "webkit/glue/webfileutilities_impl.h" |
53 #include "webkit/glue/webkit_glue.h" | 51 #include "webkit/glue/webkit_glue.h" |
54 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | |
55 | 52 |
56 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
57 #include "content/common/child_process_messages.h" | 54 #include "content/common/child_process_messages.h" |
58 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/win/WebSandb
oxSupport.h" | 55 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/win/WebSandb
oxSupport.h" |
59 #endif | 56 #endif |
60 | 57 |
61 #if defined(OS_MACOSX) | 58 #if defined(OS_MACOSX) |
62 #include "content/common/mac/font_descriptor.h" | 59 #include "content/common/mac/font_descriptor.h" |
63 #include "content/common/mac/font_loader.h" | 60 #include "content/common/mac/font_loader.h" |
64 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/mac/WebSandb
oxSupport.h" | 61 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/mac/WebSandb
oxSupport.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 WebKit::WebSharedWorkerRepository* | 554 WebKit::WebSharedWorkerRepository* |
558 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { | 555 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { |
559 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 556 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
560 switches::kDisableSharedWorkers)) { | 557 switches::kDisableSharedWorkers)) { |
561 return shared_worker_repository_.get(); | 558 return shared_worker_repository_.get(); |
562 } else { | 559 } else { |
563 return NULL; | 560 return NULL; |
564 } | 561 } |
565 } | 562 } |
566 | 563 |
567 WebKit::WebGraphicsContext3D* | |
568 RendererWebKitPlatformSupportImpl::createGraphicsContext3D() { | |
569 // The WebGraphicsContext3DInProcessImpl code path is used for | |
570 // layout tests (though not through this code) as well as for | |
571 // debugging and bringing up new ports. | |
572 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | |
573 return new webkit::gpu::WebGraphicsContext3DInProcessImpl( | |
574 gfx::kNullPluginWindow, NULL); | |
575 } else { | |
576 #if defined(ENABLE_GPU) | |
577 return new WebGraphicsContext3DCommandBufferImpl(); | |
578 #else | |
579 return NULL; | |
580 #endif | |
581 } | |
582 } | |
583 | |
584 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { | 564 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { |
585 return audio_hardware::GetOutputSampleRate(); | 565 return audio_hardware::GetOutputSampleRate(); |
586 } | 566 } |
587 | 567 |
588 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { | 568 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { |
589 return audio_hardware::GetOutputBufferSize(); | 569 return audio_hardware::GetOutputBufferSize(); |
590 } | 570 } |
591 | 571 |
592 WebAudioDevice* | 572 WebAudioDevice* |
593 RendererWebKitPlatformSupportImpl::createAudioDevice( | 573 RendererWebKitPlatformSupportImpl::createAudioDevice( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( | 634 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( |
655 WebKit::WebPeerConnectionHandlerClient* client) { | 635 WebKit::WebPeerConnectionHandlerClient* client) { |
656 WebFrame* web_frame = WebFrame::frameForCurrentContext(); | 636 WebFrame* web_frame = WebFrame::frameForCurrentContext(); |
657 if (!web_frame) | 637 if (!web_frame) |
658 return NULL; | 638 return NULL; |
659 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); | 639 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
660 if (!render_view) | 640 if (!render_view) |
661 return NULL; | 641 return NULL; |
662 return render_view->CreatePeerConnectionHandler(client); | 642 return render_view->CreatePeerConnectionHandler(client); |
663 } | 643 } |
OLD | NEW |