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

Side by Side Diff: content/renderer/render_frame_proxy.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
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/render_frame_proxy.h" 5 #include "content/renderer/render_frame_proxy.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "content/child/webmessageportchannel_impl.h" 13 #include "content/child/webmessageportchannel_impl.h"
14 #include "content/common/frame_messages.h" 14 #include "content/common/frame_messages.h"
15 #include "content/common/frame_replication_state.h" 15 #include "content/common/frame_replication_state.h"
16 #include "content/common/input_messages.h" 16 #include "content/common/input_messages.h"
17 #include "content/common/site_isolation_policy.h" 17 #include "content/common/site_isolation_policy.h"
18 #include "content/common/swapped_out_messages.h" 18 #include "content/common/swapped_out_messages.h"
19 #include "content/common/view_messages.h" 19 #include "content/common/view_messages.h"
20 #include "content/renderer/child_frame_compositing_helper.h" 20 #include "content/renderer/child_frame_compositing_helper.h"
21 #include "content/renderer/render_frame_impl.h" 21 #include "content/renderer/render_frame_impl.h"
22 #include "content/renderer/render_thread_impl.h" 22 #include "content/renderer/render_thread_impl.h"
23 #include "content/renderer/render_view_impl.h" 23 #include "content/renderer/render_view_impl.h"
24 #include "content/renderer/render_widget.h" 24 #include "content/renderer/render_widget.h"
25 #include "third_party/WebKit/public/platform/URLConversion.h"
25 #include "third_party/WebKit/public/platform/WebString.h" 26 #include "third_party/WebKit/public/platform/WebString.h"
26 #include "third_party/WebKit/public/web/WebLocalFrame.h" 27 #include "third_party/WebKit/public/web/WebLocalFrame.h"
27 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" 28 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
28 #include "third_party/WebKit/public/web/WebView.h" 29 #include "third_party/WebKit/public/web/WebView.h"
29 30
30 namespace content { 31 namespace content {
31 32
32 namespace { 33 namespace {
33 34
34 // Facilitates lookup of RenderFrameProxy by routing_id. 35 // Facilitates lookup of RenderFrameProxy by routing_id.
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 float scale_factor) { 435 float scale_factor) {
435 Send(new FrameHostMsg_InitializeChildFrame( 436 Send(new FrameHostMsg_InitializeChildFrame(
436 routing_id_, frame_rect, scale_factor)); 437 routing_id_, frame_rect, scale_factor));
437 } 438 }
438 439
439 void RenderFrameProxy::navigate(const blink::WebURLRequest& request, 440 void RenderFrameProxy::navigate(const blink::WebURLRequest& request,
440 bool should_replace_current_entry) { 441 bool should_replace_current_entry) {
441 FrameHostMsg_OpenURL_Params params; 442 FrameHostMsg_OpenURL_Params params;
442 params.url = request.url(); 443 params.url = request.url();
443 params.referrer = Referrer( 444 params.referrer = Referrer(
444 GURL(request.httpHeaderField(blink::WebString::fromUTF8("Referer"))), 445 blink::WebStringToGURL(
446 request.httpHeaderField(blink::WebString::fromUTF8("Referer"))),
445 request.referrerPolicy()); 447 request.referrerPolicy());
446 params.disposition = CURRENT_TAB; 448 params.disposition = CURRENT_TAB;
447 params.should_replace_current_entry = should_replace_current_entry; 449 params.should_replace_current_entry = should_replace_current_entry;
448 params.user_gesture = 450 params.user_gesture =
449 blink::WebUserGestureIndicator::isProcessingUserGesture(); 451 blink::WebUserGestureIndicator::isProcessingUserGesture();
450 blink::WebUserGestureIndicator::consumeUserGesture(); 452 blink::WebUserGestureIndicator::consumeUserGesture();
451 Send(new FrameHostMsg_OpenURL(routing_id_, params)); 453 Send(new FrameHostMsg_OpenURL(routing_id_, params));
452 } 454 }
453 455
454 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { 456 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) {
(...skipping 28 matching lines...) Expand all
483 blink::WebLocalFrame* source) { 485 blink::WebLocalFrame* source) {
484 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); 486 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID();
485 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); 487 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id));
486 } 488 }
487 489
488 void RenderFrameProxy::frameFocused() { 490 void RenderFrameProxy::frameFocused() {
489 Send(new FrameHostMsg_FrameFocused(routing_id_)); 491 Send(new FrameHostMsg_FrameFocused(routing_id_));
490 } 492 }
491 493
492 } // namespace 494 } // namespace
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698