| 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_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 layout = media::CHANNEL_LAYOUT_7_1; | 702 layout = media::CHANNEL_LAYOUT_7_1; |
| 703 break; | 703 break; |
| 704 default: | 704 default: |
| 705 // If the layout is not supported (more than 9 channels), falls back to | 705 // If the layout is not supported (more than 9 channels), falls back to |
| 706 // discrete mode. | 706 // discrete mode. |
| 707 layout = media::CHANNEL_LAYOUT_DISCRETE; | 707 layout = media::CHANNEL_LAYOUT_DISCRETE; |
| 708 } | 708 } |
| 709 | 709 |
| 710 int session_id = 0; | 710 int session_id = 0; |
| 711 if (input_device_id.isNull() || | 711 if (input_device_id.isNull() || |
| 712 !base::StringToInt(base::UTF16ToUTF8( | 712 !base::StringToInt(input_device_id.utf8(), &session_id)) { |
| 713 base::StringPiece16(input_device_id)), &session_id)) { | |
| 714 if (input_channels > 0) | 713 if (input_channels > 0) |
| 715 DLOG(WARNING) << "createAudioDevice(): request for audio input ignored"; | 714 DLOG(WARNING) << "createAudioDevice(): request for audio input ignored"; |
| 716 | 715 |
| 717 input_channels = 0; | 716 input_channels = 0; |
| 718 } | 717 } |
| 719 | 718 |
| 720 // For CHANNEL_LAYOUT_DISCRETE, pass the explicit channel count along with | 719 // For CHANNEL_LAYOUT_DISCRETE, pass the explicit channel count along with |
| 721 // the channel layout when creating an |AudioParameters| object. | 720 // the channel layout when creating an |AudioParameters| object. |
| 722 media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 721 media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| 723 layout, static_cast<int>(sample_rate), 16, | 722 layout, static_cast<int>(sample_rate), 16, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 752 bool refresh, | 751 bool refresh, |
| 753 const blink::WebSecurityOrigin& mainFrameOrigin, | 752 const blink::WebSecurityOrigin& mainFrameOrigin, |
| 754 blink::WebPluginListBuilder* builder) { | 753 blink::WebPluginListBuilder* builder) { |
| 755 #if BUILDFLAG(ENABLE_PLUGINS) | 754 #if BUILDFLAG(ENABLE_PLUGINS) |
| 756 std::vector<WebPluginInfo> plugins; | 755 std::vector<WebPluginInfo> plugins; |
| 757 if (!plugin_refresh_allowed_) | 756 if (!plugin_refresh_allowed_) |
| 758 refresh = false; | 757 refresh = false; |
| 759 RenderThread::Get()->Send( | 758 RenderThread::Get()->Send( |
| 760 new FrameHostMsg_GetPlugins(refresh, mainFrameOrigin, &plugins)); | 759 new FrameHostMsg_GetPlugins(refresh, mainFrameOrigin, &plugins)); |
| 761 for (const WebPluginInfo& plugin : plugins) { | 760 for (const WebPluginInfo& plugin : plugins) { |
| 762 builder->addPlugin( | 761 builder->addPlugin(WebString::fromUTF16(plugin.name), |
| 763 plugin.name, plugin.desc, | 762 WebString::fromUTF16(plugin.desc), |
| 764 plugin.path.BaseName().AsUTF16Unsafe()); | 763 blink::FilePathToWebString(plugin.path.BaseName())); |
| 765 | 764 |
| 766 for (const WebPluginMimeType& mime_type : plugin.mime_types) { | 765 for (const WebPluginMimeType& mime_type : plugin.mime_types) { |
| 767 builder->addMediaTypeToLastPlugin( | 766 builder->addMediaTypeToLastPlugin( |
| 768 WebString::fromUTF8(mime_type.mime_type), mime_type.description); | 767 WebString::fromUTF8(mime_type.mime_type), |
| 768 WebString::fromUTF16(mime_type.description)); |
| 769 | 769 |
| 770 for (const auto& extension : mime_type.file_extensions) { | 770 for (const auto& extension : mime_type.file_extensions) { |
| 771 builder->addFileExtensionToLastMediaType( | 771 builder->addFileExtensionToLastMediaType( |
| 772 WebString::fromUTF8(extension)); | 772 WebString::fromUTF8(extension)); |
| 773 } | 773 } |
| 774 } | 774 } |
| 775 } | 775 } |
| 776 #endif | 776 #endif |
| 777 } | 777 } |
| 778 | 778 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 //------------------------------------------------------------------------------ | 1100 //------------------------------------------------------------------------------ |
| 1101 | 1101 |
| 1102 blink::WebCompositorSupport* RendererBlinkPlatformImpl::compositorSupport() { | 1102 blink::WebCompositorSupport* RendererBlinkPlatformImpl::compositorSupport() { |
| 1103 return &compositor_support_; | 1103 return &compositor_support_; |
| 1104 } | 1104 } |
| 1105 | 1105 |
| 1106 //------------------------------------------------------------------------------ | 1106 //------------------------------------------------------------------------------ |
| 1107 | 1107 |
| 1108 blink::WebString RendererBlinkPlatformImpl::convertIDNToUnicode( | 1108 blink::WebString RendererBlinkPlatformImpl::convertIDNToUnicode( |
| 1109 const blink::WebString& host) { | 1109 const blink::WebString& host) { |
| 1110 return url_formatter::IDNToUnicode(host.utf8()); | 1110 return WebString::fromUTF16(url_formatter::IDNToUnicode(host.utf8())); |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 //------------------------------------------------------------------------------ | 1113 //------------------------------------------------------------------------------ |
| 1114 | 1114 |
| 1115 void RendererBlinkPlatformImpl::recordRappor(const char* metric, | 1115 void RendererBlinkPlatformImpl::recordRappor(const char* metric, |
| 1116 const blink::WebString& sample) { | 1116 const blink::WebString& sample) { |
| 1117 GetContentClient()->renderer()->RecordRappor(metric, sample.utf8()); | 1117 GetContentClient()->renderer()->RecordRappor(metric, sample.utf8()); |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 void RendererBlinkPlatformImpl::recordRapporURL(const char* metric, | 1120 void RendererBlinkPlatformImpl::recordRapporURL(const char* metric, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 return &trial_token_validator_; | 1288 return &trial_token_validator_; |
| 1289 } | 1289 } |
| 1290 | 1290 |
| 1291 void RendererBlinkPlatformImpl::workerContextCreated( | 1291 void RendererBlinkPlatformImpl::workerContextCreated( |
| 1292 const v8::Local<v8::Context>& worker) { | 1292 const v8::Local<v8::Context>& worker) { |
| 1293 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( | 1293 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( |
| 1294 worker); | 1294 worker); |
| 1295 } | 1295 } |
| 1296 | 1296 |
| 1297 } // namespace content | 1297 } // namespace content |
| OLD | NEW |