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

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

Issue 2537953003: WebString: makes string16 conversions explicit (part 1: blink, content) (Closed)
Patch Set: fix Created 4 years 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
« no previous file with comments | « content/renderer/render_widget.cc ('k') | content/renderer/renderer_webcookiejar_impl.cc » ('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_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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 layout = media::CHANNEL_LAYOUT_7_1; 701 layout = media::CHANNEL_LAYOUT_7_1;
702 break; 702 break;
703 default: 703 default:
704 // If the layout is not supported (more than 9 channels), falls back to 704 // If the layout is not supported (more than 9 channels), falls back to
705 // discrete mode. 705 // discrete mode.
706 layout = media::CHANNEL_LAYOUT_DISCRETE; 706 layout = media::CHANNEL_LAYOUT_DISCRETE;
707 } 707 }
708 708
709 int session_id = 0; 709 int session_id = 0;
710 if (input_device_id.isNull() || 710 if (input_device_id.isNull() ||
711 !base::StringToInt(base::UTF16ToUTF8( 711 !base::StringToInt(input_device_id.utf8(), &session_id)) {
712 base::StringPiece16(input_device_id)), &session_id)) {
713 if (input_channels > 0) 712 if (input_channels > 0)
714 DLOG(WARNING) << "createAudioDevice(): request for audio input ignored"; 713 DLOG(WARNING) << "createAudioDevice(): request for audio input ignored";
715 714
716 input_channels = 0; 715 input_channels = 0;
717 } 716 }
718 717
719 // For CHANNEL_LAYOUT_DISCRETE, pass the explicit channel count along with 718 // For CHANNEL_LAYOUT_DISCRETE, pass the explicit channel count along with
720 // the channel layout when creating an |AudioParameters| object. 719 // the channel layout when creating an |AudioParameters| object.
721 media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, 720 media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
722 layout, static_cast<int>(sample_rate), 16, 721 layout, static_cast<int>(sample_rate), 16,
(...skipping 28 matching lines...) Expand all
751 bool refresh, 750 bool refresh,
752 const blink::WebSecurityOrigin& mainFrameOrigin, 751 const blink::WebSecurityOrigin& mainFrameOrigin,
753 blink::WebPluginListBuilder* builder) { 752 blink::WebPluginListBuilder* builder) {
754 #if BUILDFLAG(ENABLE_PLUGINS) 753 #if BUILDFLAG(ENABLE_PLUGINS)
755 std::vector<WebPluginInfo> plugins; 754 std::vector<WebPluginInfo> plugins;
756 if (!plugin_refresh_allowed_) 755 if (!plugin_refresh_allowed_)
757 refresh = false; 756 refresh = false;
758 RenderThread::Get()->Send( 757 RenderThread::Get()->Send(
759 new FrameHostMsg_GetPlugins(refresh, mainFrameOrigin, &plugins)); 758 new FrameHostMsg_GetPlugins(refresh, mainFrameOrigin, &plugins));
760 for (const WebPluginInfo& plugin : plugins) { 759 for (const WebPluginInfo& plugin : plugins) {
761 builder->addPlugin( 760 builder->addPlugin(WebString::fromUTF16(plugin.name),
762 plugin.name, plugin.desc, 761 WebString::fromUTF16(plugin.desc),
763 plugin.path.BaseName().AsUTF16Unsafe()); 762 blink::FilePathToWebString(plugin.path.BaseName()));
764 763
765 for (const WebPluginMimeType& mime_type : plugin.mime_types) { 764 for (const WebPluginMimeType& mime_type : plugin.mime_types) {
766 builder->addMediaTypeToLastPlugin( 765 builder->addMediaTypeToLastPlugin(
767 WebString::fromUTF8(mime_type.mime_type), mime_type.description); 766 WebString::fromUTF8(mime_type.mime_type),
767 WebString::fromUTF16(mime_type.description));
768 768
769 for (const auto& extension : mime_type.file_extensions) { 769 for (const auto& extension : mime_type.file_extensions) {
770 builder->addFileExtensionToLastMediaType( 770 builder->addFileExtensionToLastMediaType(
771 WebString::fromUTF8(extension)); 771 WebString::fromUTF8(extension));
772 } 772 }
773 } 773 }
774 } 774 }
775 #endif 775 #endif
776 } 776 }
777 777
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 //------------------------------------------------------------------------------ 1112 //------------------------------------------------------------------------------
1113 1113
1114 blink::WebCompositorSupport* RendererBlinkPlatformImpl::compositorSupport() { 1114 blink::WebCompositorSupport* RendererBlinkPlatformImpl::compositorSupport() {
1115 return &compositor_support_; 1115 return &compositor_support_;
1116 } 1116 }
1117 1117
1118 //------------------------------------------------------------------------------ 1118 //------------------------------------------------------------------------------
1119 1119
1120 blink::WebString RendererBlinkPlatformImpl::convertIDNToUnicode( 1120 blink::WebString RendererBlinkPlatformImpl::convertIDNToUnicode(
1121 const blink::WebString& host) { 1121 const blink::WebString& host) {
1122 return url_formatter::IDNToUnicode(host.utf8()); 1122 return WebString::fromUTF16(url_formatter::IDNToUnicode(host.utf8()));
1123 } 1123 }
1124 1124
1125 //------------------------------------------------------------------------------ 1125 //------------------------------------------------------------------------------
1126 1126
1127 void RendererBlinkPlatformImpl::recordRappor(const char* metric, 1127 void RendererBlinkPlatformImpl::recordRappor(const char* metric,
1128 const blink::WebString& sample) { 1128 const blink::WebString& sample) {
1129 GetContentClient()->renderer()->RecordRappor(metric, sample.utf8()); 1129 GetContentClient()->renderer()->RecordRappor(metric, sample.utf8());
1130 } 1130 }
1131 1131
1132 void RendererBlinkPlatformImpl::recordRapporURL(const char* metric, 1132 void RendererBlinkPlatformImpl::recordRapporURL(const char* metric,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 return &trial_token_validator_; 1300 return &trial_token_validator_;
1301 } 1301 }
1302 1302
1303 void RendererBlinkPlatformImpl::workerContextCreated( 1303 void RendererBlinkPlatformImpl::workerContextCreated(
1304 const v8::Local<v8::Context>& worker) { 1304 const v8::Local<v8::Context>& worker) {
1305 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( 1305 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
1306 worker); 1306 worker);
1307 } 1307 }
1308 1308
1309 } // namespace content 1309 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | content/renderer/renderer_webcookiejar_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698