| 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/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | |
| 17 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" | 16 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" |
| 18 #include "content/common/mime_registry_messages.h" | 17 #include "content/common/mime_registry_messages.h" |
| 19 #include "content/common/npobject_util.h" | 18 #include "content/common/npobject_util.h" |
| 20 #include "content/common/view_messages.h" | 19 #include "content/common/view_messages.h" |
| 21 #include "content/common/webblobregistry_impl.h" | 20 #include "content/common/webblobregistry_impl.h" |
| 22 #include "content/common/webmessageportchannel_impl.h" | 21 #include "content/common/webmessageportchannel_impl.h" |
| 23 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
| 24 #include "content/public/renderer/content_renderer_client.h" | 23 #include "content/public/renderer/content_renderer_client.h" |
| 25 #include "content/renderer/gamepad_shared_memory_reader.h" | 24 #include "content/renderer/gamepad_shared_memory_reader.h" |
| 26 #include "content/renderer/media/audio_device.h" | 25 #include "content/renderer/media/audio_device.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 43 #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" |
| 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
| 45 #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" |
| 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" |
| 47 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
| 48 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
| 49 #include "webkit/glue/simple_webmimeregistry_impl.h" | 48 #include "webkit/glue/simple_webmimeregistry_impl.h" |
| 50 #include "webkit/glue/webclipboard_impl.h" | 49 #include "webkit/glue/webclipboard_impl.h" |
| 51 #include "webkit/glue/webfileutilities_impl.h" | 50 #include "webkit/glue/webfileutilities_impl.h" |
| 52 #include "webkit/glue/webkit_glue.h" | 51 #include "webkit/glue/webkit_glue.h" |
| 53 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | |
| 54 | 52 |
| 55 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
| 56 #include "content/common/child_process_messages.h" | 54 #include "content/common/child_process_messages.h" |
| 57 #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" |
| 58 #endif | 56 #endif |
| 59 | 57 |
| 60 #if defined(OS_MACOSX) | 58 #if defined(OS_MACOSX) |
| 61 #include "content/common/mac/font_descriptor.h" | 59 #include "content/common/mac/font_descriptor.h" |
| 62 #include "content/common/mac/font_loader.h" | 60 #include "content/common/mac/font_loader.h" |
| 63 #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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 WebKit::WebSharedWorkerRepository* | 572 WebKit::WebSharedWorkerRepository* |
| 575 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { | 573 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { |
| 576 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 574 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 577 switches::kDisableSharedWorkers)) { | 575 switches::kDisableSharedWorkers)) { |
| 578 return shared_worker_repository_.get(); | 576 return shared_worker_repository_.get(); |
| 579 } else { | 577 } else { |
| 580 return NULL; | 578 return NULL; |
| 581 } | 579 } |
| 582 } | 580 } |
| 583 | 581 |
| 584 WebKit::WebGraphicsContext3D* | |
| 585 RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( | |
| 586 const WebGraphicsContext3D::Attributes& attributes) { | |
| 587 // The WebGraphicsContext3DInProcessImpl code path is used for | |
| 588 // layout tests (though not through this code) as well as for | |
| 589 // debugging and bringing up new ports. | |
| 590 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | |
| 591 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( | |
| 592 attributes, false); | |
| 593 } else { | |
| 594 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client; | |
| 595 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( | |
| 596 new WebGraphicsContext3DCommandBufferImpl(0, GURL(), null_client)); | |
| 597 if (!context->Initialize(attributes)) | |
| 598 return NULL; | |
| 599 return context.release(); | |
| 600 } | |
| 601 } | |
| 602 | |
| 603 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { | 582 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { |
| 604 return audio_hardware::GetOutputSampleRate(); | 583 return audio_hardware::GetOutputSampleRate(); |
| 605 } | 584 } |
| 606 | 585 |
| 607 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { | 586 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { |
| 608 return audio_hardware::GetOutputBufferSize(); | 587 return audio_hardware::GetOutputBufferSize(); |
| 609 } | 588 } |
| 610 | 589 |
| 611 WebAudioDevice* | 590 WebAudioDevice* |
| 612 RendererWebKitPlatformSupportImpl::createAudioDevice( | 591 RendererWebKitPlatformSupportImpl::createAudioDevice( |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( | 652 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( |
| 674 WebKit::WebPeerConnectionHandlerClient* client) { | 653 WebKit::WebPeerConnectionHandlerClient* client) { |
| 675 WebFrame* web_frame = WebFrame::frameForCurrentContext(); | 654 WebFrame* web_frame = WebFrame::frameForCurrentContext(); |
| 676 if (!web_frame) | 655 if (!web_frame) |
| 677 return NULL; | 656 return NULL; |
| 678 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); | 657 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
| 679 if (!render_view) | 658 if (!render_view) |
| 680 return NULL; | 659 return NULL; |
| 681 return render_view->CreatePeerConnectionHandler(client); | 660 return render_view->CreatePeerConnectionHandler(client); |
| 682 } | 661 } |
| OLD | NEW |