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

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

Issue 11880009: Introduce AudioHardwareConfig for renderer side audio device info. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style nits. Created 7 years, 10 months 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
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/test/webrtc_audio_device_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/platform_file.h" 12 #include "base/platform_file.h"
13 #include "base/shared_memory.h" 13 #include "base/shared_memory.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "content/common/database_util.h" 15 #include "content/common/database_util.h"
16 #include "content/common/fileapi/webblobregistry_impl.h" 16 #include "content/common/fileapi/webblobregistry_impl.h"
17 #include "content/common/fileapi/webfilesystem_impl.h" 17 #include "content/common/fileapi/webfilesystem_impl.h"
18 #include "content/common/file_utilities_messages.h" 18 #include "content/common/file_utilities_messages.h"
19 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" 19 #include "content/common/indexed_db/proxy_webidbfactory_impl.h"
20 #include "content/common/mime_registry_messages.h" 20 #include "content/common/mime_registry_messages.h"
21 #include "content/common/npobject_util.h" 21 #include "content/common/npobject_util.h"
22 #include "content/common/view_messages.h" 22 #include "content/common/view_messages.h"
23 #include "content/common/webmessageportchannel_impl.h" 23 #include "content/common/webmessageportchannel_impl.h"
24 #include "content/public/common/content_switches.h" 24 #include "content/public/common/content_switches.h"
25 #include "content/public/common/gpu_info.h" 25 #include "content/public/common/gpu_info.h"
26 #include "content/public/renderer/content_renderer_client.h" 26 #include "content/public/renderer/content_renderer_client.h"
27 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" 27 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
28 #include "content/renderer/gamepad_shared_memory_reader.h" 28 #include "content/renderer/gamepad_shared_memory_reader.h"
29 #include "content/renderer/hyphenator/hyphenator.h" 29 #include "content/renderer/hyphenator/hyphenator.h"
30 #include "content/renderer/media/audio_hardware.h"
31 #include "content/renderer/media/media_stream_dependency_factory.h" 30 #include "content/renderer/media/media_stream_dependency_factory.h"
32 #include "content/renderer/media/renderer_webaudiodevice_impl.h" 31 #include "content/renderer/media/renderer_webaudiodevice_impl.h"
33 #include "content/renderer/render_thread_impl.h" 32 #include "content/renderer/render_thread_impl.h"
34 #include "content/renderer/renderer_clipboard_client.h" 33 #include "content/renderer/renderer_clipboard_client.h"
35 #include "content/renderer/websharedworkerrepository_impl.h" 34 #include "content/renderer/websharedworkerrepository_impl.h"
36 #include "googleurl/src/gurl.h" 35 #include "googleurl/src/gurl.h"
37 #include "ipc/ipc_sync_message_filter.h" 36 #include "ipc/ipc_sync_message_filter.h"
38 #include "media/audio/audio_output_device.h" 37 #include "media/audio/audio_output_device.h"
38 #include "media/base/audio_hardware_config.h"
39 #include "third_party/WebKit/Source/Platform/chromium/public/WebBlobRegistry.h" 39 #include "third_party/WebKit/Source/Platform/chromium/public/WebBlobRegistry.h"
40 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h" 40 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h"
41 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamCente r.h" 41 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamCente r.h"
42 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamCente rClient.h" 42 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamCente rClient.h"
43 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" 43 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h"
44 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" 44 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h"
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h"
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
48 #include "webkit/base/file_path_string_conversions.h" 48 #include "webkit/base/file_path_string_conversions.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 return false; 548 return false;
549 549
550 const GPUInfo& gpu_info = host->gpu_info(); 550 const GPUInfo& gpu_info = host->gpu_info();
551 if (gpu_info.can_lose_context || gpu_info.software_rendering) 551 if (gpu_info.can_lose_context || gpu_info.software_rendering)
552 return false; 552 return false;
553 553
554 return true; 554 return true;
555 } 555 }
556 556
557 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { 557 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() {
558 return GetAudioOutputSampleRate(); 558 RenderThreadImpl* thread = RenderThreadImpl::current();
559 return thread->GetAudioHardwareConfig()->GetOutputSampleRate();
559 } 560 }
560 561
561 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { 562 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() {
562 return GetAudioOutputBufferSize(); 563 RenderThreadImpl* thread = RenderThreadImpl::current();
564 return thread->GetAudioHardwareConfig()->GetOutputBufferSize();
563 } 565 }
564 566
565 // TODO(crogers): remove deprecated API as soon as WebKit calls new API. 567 // TODO(crogers): remove deprecated API as soon as WebKit calls new API.
566 WebAudioDevice* 568 WebAudioDevice*
567 RendererWebKitPlatformSupportImpl::createAudioDevice( 569 RendererWebKitPlatformSupportImpl::createAudioDevice(
568 size_t buffer_size, 570 size_t buffer_size,
569 unsigned channels, 571 unsigned channels,
570 double sample_rate, 572 double sample_rate,
571 WebAudioDevice::RenderCallback* callback) { 573 WebAudioDevice::RenderCallback* callback) {
572 return createAudioDevice(buffer_size, 0, channels, sample_rate, callback); 574 return createAudioDevice(buffer_size, 0, channels, sample_rate, callback);
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 size_t before_index, 763 size_t before_index,
762 const WebKit::WebString& locale) { 764 const WebKit::WebString& locale) {
763 // Crash if WebKit calls this function when canHyphenate returns false. 765 // Crash if WebKit calls this function when canHyphenate returns false.
764 DCHECK(locale.isEmpty() || locale.equals("en-US")); 766 DCHECK(locale.isEmpty() || locale.equals("en-US"));
765 DCHECK(hyphenator_.get()); 767 DCHECK(hyphenator_.get());
766 return hyphenator_->ComputeLastHyphenLocation(string16(characters, length), 768 return hyphenator_->ComputeLastHyphenLocation(string16(characters, length),
767 before_index); 769 before_index);
768 } 770 }
769 771
770 } // namespace content 772 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/test/webrtc_audio_device_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698