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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/crash_logging.h" 10 #include "base/debug/crash_logging.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "components/nacl/renderer/ppb_nacl_private_impl.h" 70 #include "components/nacl/renderer/ppb_nacl_private_impl.h"
71 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" 71 #include "components/network_hints/renderer/prescient_networking_dispatcher.h"
72 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" 72 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h"
73 #include "components/password_manager/content/renderer/credential_manager_client .h" 73 #include "components/password_manager/content/renderer/credential_manager_client .h"
74 #include "components/pdf/renderer/pepper_pdf_host.h" 74 #include "components/pdf/renderer/pepper_pdf_host.h"
75 #include "components/plugins/renderer/mobile_youtube_plugin.h" 75 #include "components/plugins/renderer/mobile_youtube_plugin.h"
76 #include "components/signin/core/common/profile_management_switches.h" 76 #include "components/signin/core/common/profile_management_switches.h"
77 #include "components/version_info/version_info.h" 77 #include "components/version_info/version_info.h"
78 #include "components/visitedlink/renderer/visitedlink_slave.h" 78 #include "components/visitedlink/renderer/visitedlink_slave.h"
79 #include "components/web_cache/renderer/web_cache_render_process_observer.h" 79 #include "components/web_cache/renderer/web_cache_render_process_observer.h"
80 #include "content/public/child/url_conversion.h"
80 #include "content/public/common/content_constants.h" 81 #include "content/public/common/content_constants.h"
81 #include "content/public/common/content_switches.h" 82 #include "content/public/common/content_switches.h"
82 #include "content/public/renderer/plugin_instance_throttler.h" 83 #include "content/public/renderer/plugin_instance_throttler.h"
83 #include "content/public/renderer/render_frame.h" 84 #include "content/public/renderer/render_frame.h"
84 #include "content/public/renderer/render_thread.h" 85 #include "content/public/renderer/render_thread.h"
85 #include "content/public/renderer/render_view.h" 86 #include "content/public/renderer/render_view.h"
86 #include "content/public/renderer/render_view_visitor.h" 87 #include "content/public/renderer/render_view_visitor.h"
87 #include "extensions/common/constants.h" 88 #include "extensions/common/constants.h"
88 #include "ipc/ipc_sync_channel.h" 89 #include "ipc/ipc_sync_channel.h"
89 #include "net/base/net_errors.h" 90 #include "net/base/net_errors.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 render_frame, params)) { 550 render_frame, params)) {
550 return false; 551 return false;
551 } 552 }
552 #endif 553 #endif
553 554
554 GURL url(params.url); 555 GURL url(params.url);
555 #if defined(ENABLE_PLUGINS) 556 #if defined(ENABLE_PLUGINS)
556 ChromeViewHostMsg_GetPluginInfo_Output output; 557 ChromeViewHostMsg_GetPluginInfo_Output output;
557 WebString top_origin = frame->top()->securityOrigin().toString(); 558 WebString top_origin = frame->top()->securityOrigin().toString();
558 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( 559 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo(
559 render_frame->GetRoutingID(), url, GURL(top_origin), orig_mime_type, 560 render_frame->GetRoutingID(), url, content::WebStringToGURL(top_origin),
560 &output)); 561 orig_mime_type, &output));
561 *plugin = CreatePlugin(render_frame, frame, params, output); 562 *plugin = CreatePlugin(render_frame, frame, params, output);
562 #else // !defined(ENABLE_PLUGINS) 563 #else // !defined(ENABLE_PLUGINS)
563 564
564 #if defined(OS_ANDROID) 565 #if defined(OS_ANDROID)
565 if (plugins::MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) { 566 if (plugins::MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) {
566 base::StringPiece template_html( 567 base::StringPiece template_html(
567 ResourceBundle::GetSharedInstance().GetRawDataResource( 568 ResourceBundle::GetSharedInstance().GetRawDataResource(
568 IDR_MOBILE_YOUTUBE_PLUGIN_HTML)); 569 IDR_MOBILE_YOUTUBE_PLUGIN_HTML));
569 *plugin = (new plugins::MobileYouTubePlugin(render_frame, frame, params, 570 *plugin = (new plugins::MobileYouTubePlugin(render_frame, frame, params,
570 template_html))->plugin(); 571 template_html))->plugin();
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 // chrome.system.network.getNetworkInterfaces provides the same 1414 // chrome.system.network.getNetworkInterfaces provides the same
1414 // information. Also, the enforcement of sending and binding UDP is already done 1415 // information. Also, the enforcement of sending and binding UDP is already done
1415 // by chrome extension permission model. 1416 // by chrome extension permission model.
1416 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { 1417 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() {
1417 #if defined(ENABLE_EXTENSIONS) 1418 #if defined(ENABLE_EXTENSIONS)
1418 return !IsStandaloneExtensionProcess(); 1419 return !IsStandaloneExtensionProcess();
1419 #else 1420 #else
1420 return true; 1421 return true;
1421 #endif 1422 #endif
1422 } 1423 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698