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/fileapi/webblobregistry_impl.h" | 14 #include "content/common/fileapi/webblobregistry_impl.h" |
15 #include "content/common/fileapi/webfilesystem_impl.h" | 15 #include "content/common/fileapi/webfilesystem_impl.h" |
16 #include "content/common/file_utilities_messages.h" | 16 #include "content/common/file_utilities_messages.h" |
17 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" | 17 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" |
18 #include "content/common/mime_registry_messages.h" | 18 #include "content/common/mime_registry_messages.h" |
19 #include "content/common/npobject_util.h" | 19 #include "content/common/npobject_util.h" |
20 #include "content/common/view_messages.h" | 20 #include "content/common/view_messages.h" |
21 #include "content/common/webmessageportchannel_impl.h" | 21 #include "content/common/webmessageportchannel_impl.h" |
22 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
| 23 #include "content/public/common/gpu_info.h" |
23 #include "content/public/renderer/content_renderer_client.h" | 24 #include "content/public/renderer/content_renderer_client.h" |
24 #include "content/renderer/gamepad_shared_memory_reader.h" | 25 #include "content/renderer/gamepad_shared_memory_reader.h" |
25 #include "content/renderer/media/audio_device.h" | 26 #include "content/renderer/media/audio_device.h" |
26 #include "content/renderer/media/audio_hardware.h" | 27 #include "content/renderer/media/audio_hardware.h" |
27 #include "content/renderer/media/renderer_webaudiodevice_impl.h" | 28 #include "content/renderer/media/renderer_webaudiodevice_impl.h" |
28 #include "content/renderer/render_thread_impl.h" | 29 #include "content/renderer/render_thread_impl.h" |
29 #include "content/renderer/render_view_impl.h" | 30 #include "content/renderer/render_view_impl.h" |
30 #include "content/renderer/renderer_clipboard_client.h" | 31 #include "content/renderer/renderer_clipboard_client.h" |
31 #include "content/renderer/renderer_webstoragenamespace_impl.h" | 32 #include "content/renderer/renderer_webstoragenamespace_impl.h" |
32 #include "content/renderer/websharedworkerrepository_impl.h" | 33 #include "content/renderer/websharedworkerrepository_impl.h" |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 WebKit::WebSharedWorkerRepository* | 579 WebKit::WebSharedWorkerRepository* |
579 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { | 580 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { |
580 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 581 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
581 switches::kDisableSharedWorkers)) { | 582 switches::kDisableSharedWorkers)) { |
582 return shared_worker_repository_.get(); | 583 return shared_worker_repository_.get(); |
583 } else { | 584 } else { |
584 return NULL; | 585 return NULL; |
585 } | 586 } |
586 } | 587 } |
587 | 588 |
| 589 bool RendererWebKitPlatformSupportImpl::canAccelerate2dCanvas() { |
| 590 RenderThreadImpl* thread = RenderThreadImpl::current(); |
| 591 GpuChannelHost* host = thread->EstablishGpuChannelSync( |
| 592 content::CAUSE_FOR_GPU_LAUNCH_CANVAS_2D); |
| 593 if (!host) |
| 594 return false; |
| 595 |
| 596 const content::GPUInfo& gpu_info = host->gpu_info(); |
| 597 if (gpu_info.can_lose_context || gpu_info.software_rendering) |
| 598 return false; |
| 599 |
| 600 return true; |
| 601 } |
| 602 |
588 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { | 603 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { |
589 return audio_hardware::GetOutputSampleRate(); | 604 return audio_hardware::GetOutputSampleRate(); |
590 } | 605 } |
591 | 606 |
592 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { | 607 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { |
593 return audio_hardware::GetOutputBufferSize(); | 608 return audio_hardware::GetOutputBufferSize(); |
594 } | 609 } |
595 | 610 |
596 WebAudioDevice* | 611 WebAudioDevice* |
597 RendererWebKitPlatformSupportImpl::createAudioDevice( | 612 RendererWebKitPlatformSupportImpl::createAudioDevice( |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 DCHECK(render_thread); | 690 DCHECK(render_thread); |
676 if (!render_thread) | 691 if (!render_thread) |
677 return NULL; | 692 return NULL; |
678 return render_thread->CreateMediaStreamCenter(client); | 693 return render_thread->CreateMediaStreamCenter(client); |
679 } | 694 } |
680 | 695 |
681 GpuChannelHostFactory* | 696 GpuChannelHostFactory* |
682 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { | 697 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
683 return RenderThreadImpl::current(); | 698 return RenderThreadImpl::current(); |
684 } | 699 } |
OLD | NEW |