| 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/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #include "content/renderer/media/audio_decoder.h" | 40 #include "content/renderer/media/audio_decoder.h" |
| 41 #include "content/renderer/media/crypto/key_systems.h" | 41 #include "content/renderer/media/crypto/key_systems.h" |
| 42 #include "content/renderer/media/media_stream_dependency_factory.h" | 42 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 43 #include "content/renderer/media/renderer_webaudiodevice_impl.h" | 43 #include "content/renderer/media/renderer_webaudiodevice_impl.h" |
| 44 #include "content/renderer/media/renderer_webmidiaccessor_impl.h" | 44 #include "content/renderer/media/renderer_webmidiaccessor_impl.h" |
| 45 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" | 45 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" |
| 46 #include "content/renderer/render_thread_impl.h" | 46 #include "content/renderer/render_thread_impl.h" |
| 47 #include "content/renderer/renderer_clipboard_client.h" | 47 #include "content/renderer/renderer_clipboard_client.h" |
| 48 #include "content/renderer/webclipboard_impl.h" | 48 #include "content/renderer/webclipboard_impl.h" |
| 49 #include "content/renderer/webcrypto/webcrypto_impl.h" | 49 #include "content/renderer/webcrypto/webcrypto_impl.h" |
| 50 #include "content/renderer/websharedworkerrepository_impl.h" | |
| 51 #include "gpu/config/gpu_info.h" | 50 #include "gpu/config/gpu_info.h" |
| 52 #include "ipc/ipc_sync_message_filter.h" | 51 #include "ipc/ipc_sync_message_filter.h" |
| 53 #include "media/audio/audio_output_device.h" | 52 #include "media/audio/audio_output_device.h" |
| 54 #include "media/base/audio_hardware_config.h" | 53 #include "media/base/audio_hardware_config.h" |
| 55 #include "media/filters/stream_parser_factory.h" | 54 #include "media/filters/stream_parser_factory.h" |
| 56 #include "net/base/mime_util.h" | 55 #include "net/base/mime_util.h" |
| 57 #include "net/base/net_util.h" | 56 #include "net/base/net_util.h" |
| 58 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" | 57 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
| 59 #include "third_party/WebKit/public/platform/WebDeviceMotionListener.h" | 58 #include "third_party/WebKit/public/platform/WebDeviceMotionListener.h" |
| 60 #include "third_party/WebKit/public/platform/WebDeviceOrientationListener.h" | 59 #include "third_party/WebKit/public/platform/WebDeviceOrientationListener.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 #endif // defined(OS_ANDROID) | 197 #endif // defined(OS_ANDROID) |
| 199 | 198 |
| 200 //------------------------------------------------------------------------------ | 199 //------------------------------------------------------------------------------ |
| 201 | 200 |
| 202 RendererWebKitPlatformSupportImpl::RendererWebKitPlatformSupportImpl() | 201 RendererWebKitPlatformSupportImpl::RendererWebKitPlatformSupportImpl() |
| 203 : clipboard_client_(new RendererClipboardClient), | 202 : clipboard_client_(new RendererClipboardClient), |
| 204 clipboard_(new WebClipboardImpl(clipboard_client_.get())), | 203 clipboard_(new WebClipboardImpl(clipboard_client_.get())), |
| 205 mime_registry_(new RendererWebKitPlatformSupportImpl::MimeRegistry), | 204 mime_registry_(new RendererWebKitPlatformSupportImpl::MimeRegistry), |
| 206 sudden_termination_disables_(0), | 205 sudden_termination_disables_(0), |
| 207 plugin_refresh_allowed_(true), | 206 plugin_refresh_allowed_(true), |
| 208 shared_worker_repository_(new WebSharedWorkerRepositoryImpl), | |
| 209 child_thread_loop_(base::MessageLoopProxy::current()) { | 207 child_thread_loop_(base::MessageLoopProxy::current()) { |
| 210 if (g_sandbox_enabled && sandboxEnabled()) { | 208 if (g_sandbox_enabled && sandboxEnabled()) { |
| 211 sandbox_support_.reset( | 209 sandbox_support_.reset( |
| 212 new RendererWebKitPlatformSupportImpl::SandboxSupport); | 210 new RendererWebKitPlatformSupportImpl::SandboxSupport); |
| 213 } else { | 211 } else { |
| 214 DVLOG(1) << "Disabling sandbox support for testing."; | 212 DVLOG(1) << "Disabling sandbox support for testing."; |
| 215 } | 213 } |
| 216 | 214 |
| 217 // ChildThread may not exist in some tests. | 215 // ChildThread may not exist in some tests. |
| 218 if (ChildThread::current()) { | 216 if (ChildThread::current()) { |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 return DatabaseUtil::DatabaseGetFileSize(vfs_file_name, | 598 return DatabaseUtil::DatabaseGetFileSize(vfs_file_name, |
| 601 sync_message_filter_.get()); | 599 sync_message_filter_.get()); |
| 602 } | 600 } |
| 603 | 601 |
| 604 long long RendererWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( | 602 long long RendererWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( |
| 605 const WebString& origin_identifier) { | 603 const WebString& origin_identifier) { |
| 606 return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier, | 604 return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier, |
| 607 sync_message_filter_.get()); | 605 sync_message_filter_.get()); |
| 608 } | 606 } |
| 609 | 607 |
| 610 WebKit::WebSharedWorkerRepository* | |
| 611 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { | |
| 612 #if !defined(OS_ANDROID) | |
| 613 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
| 614 switches::kDisableSharedWorkers)) { | |
| 615 return shared_worker_repository_.get(); | |
| 616 } else { | |
| 617 return NULL; | |
| 618 } | |
| 619 #else | |
| 620 // Shared workers are unsupported on Android. Returning NULL will prevent the | |
| 621 // window.SharedWorker constructor from being exposed. http://crbug.com/154571 | |
| 622 return NULL; | |
| 623 #endif | |
| 624 } | |
| 625 | |
| 626 bool RendererWebKitPlatformSupportImpl::canAccelerate2dCanvas() { | 608 bool RendererWebKitPlatformSupportImpl::canAccelerate2dCanvas() { |
| 627 RenderThreadImpl* thread = RenderThreadImpl::current(); | 609 RenderThreadImpl* thread = RenderThreadImpl::current(); |
| 628 GpuChannelHost* host = thread->EstablishGpuChannelSync( | 610 GpuChannelHost* host = thread->EstablishGpuChannelSync( |
| 629 CAUSE_FOR_GPU_LAUNCH_CANVAS_2D); | 611 CAUSE_FOR_GPU_LAUNCH_CANVAS_2D); |
| 630 if (!host) | 612 if (!host) |
| 631 return false; | 613 return false; |
| 632 | 614 |
| 633 const gpu::GPUInfo& gpu_info = host->gpu_info(); | 615 const gpu::GPUInfo& gpu_info = host->gpu_info(); |
| 634 if (gpu_info.can_lose_context || gpu_info.software_rendering) | 616 if (gpu_info.can_lose_context || gpu_info.software_rendering) |
| 635 return false; | 617 return false; |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 return; | 1042 return; |
| 1061 QuotaDispatcher::ThreadSpecificInstance( | 1043 QuotaDispatcher::ThreadSpecificInstance( |
| 1062 thread_safe_sender_.get(), | 1044 thread_safe_sender_.get(), |
| 1063 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 1045 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
| 1064 storage_partition, | 1046 storage_partition, |
| 1065 static_cast<quota::StorageType>(type), | 1047 static_cast<quota::StorageType>(type), |
| 1066 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1048 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
| 1067 } | 1049 } |
| 1068 | 1050 |
| 1069 } // namespace content | 1051 } // namespace content |
| OLD | NEW |