Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 8588030: Refactor the Get*Hardware* routines a bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gpu/webgraphicscontext3d_command_buffer_impl.h" 23 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h"
24 #include "content/renderer/media/audio_device.h" 24 #include "content/renderer/media/audio_device.h"
25 #include "content/renderer/media/audio_hardware.h"
25 #include "content/renderer/render_thread_impl.h" 26 #include "content/renderer/render_thread_impl.h"
26 #include "content/renderer/renderer_webaudiodevice_impl.h" 27 #include "content/renderer/renderer_webaudiodevice_impl.h"
27 #include "content/renderer/renderer_webidbfactory_impl.h" 28 #include "content/renderer/renderer_webidbfactory_impl.h"
28 #include "content/renderer/renderer_webstoragenamespace_impl.h" 29 #include "content/renderer/renderer_webstoragenamespace_impl.h"
29 #include "content/renderer/websharedworkerrepository_impl.h" 30 #include "content/renderer/websharedworkerrepository_impl.h"
30 #include "googleurl/src/gurl.h" 31 #include "googleurl/src/gurl.h"
31 #include "ipc/ipc_sync_message_filter.h" 32 #include "ipc/ipc_sync_message_filter.h"
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h" 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h"
33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D. h" 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D. h"
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 } else { 558 } else {
558 #if defined(ENABLE_GPU) 559 #if defined(ENABLE_GPU)
559 return new WebGraphicsContext3DCommandBufferImpl(); 560 return new WebGraphicsContext3DCommandBufferImpl();
560 #else 561 #else
561 return NULL; 562 return NULL;
562 #endif 563 #endif
563 } 564 }
564 } 565 }
565 566
566 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { 567 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() {
567 return AudioDevice::GetAudioHardwareSampleRate(); 568 return audio_hardware::GetOutputSampleRate();
568 } 569 }
569 570
570 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { 571 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() {
571 return AudioDevice::GetAudioHardwareBufferSize(); 572 return audio_hardware::GetOutputBufferSize();
572 } 573 }
573 574
574 WebAudioDevice* 575 WebAudioDevice*
575 RendererWebKitPlatformSupportImpl::createAudioDevice( 576 RendererWebKitPlatformSupportImpl::createAudioDevice(
576 size_t buffer_size, 577 size_t buffer_size,
577 unsigned channels, 578 unsigned channels,
578 double sample_rate, 579 double sample_rate,
579 WebAudioDevice::RenderCallback* callback) { 580 WebAudioDevice::RenderCallback* callback) {
580 return new RendererWebAudioDeviceImpl(buffer_size, 581 return new RendererWebAudioDeviceImpl(buffer_size,
581 channels, 582 channels,
(...skipping 25 matching lines...) Expand all
607 blob_registry_.reset(new WebBlobRegistryImpl(ChildThread::current())); 608 blob_registry_.reset(new WebBlobRegistryImpl(ChildThread::current()));
608 } 609 }
609 return blob_registry_.get(); 610 return blob_registry_.get();
610 } 611 }
611 612
612 WebKit::WebString RendererWebKitPlatformSupportImpl::userAgent( 613 WebKit::WebString RendererWebKitPlatformSupportImpl::userAgent(
613 const WebKit::WebURL& url) { 614 const WebKit::WebURL& url) {
614 return WebKitPlatformSupportImpl::userAgent(url); 615 return WebKitPlatformSupportImpl::userAgent(url);
615 } 616 }
616 617
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_audio_device_unittest.cc ('k') | content/test/webrtc_audio_device_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698