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

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
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/public/child/url_conversion.h"
20 #include "content/renderer/child_frame_compositing_helper.h" 21 #include "content/renderer/child_frame_compositing_helper.h"
21 #include "content/renderer/render_frame_impl.h" 22 #include "content/renderer/render_frame_impl.h"
22 #include "content/renderer/render_thread_impl.h" 23 #include "content/renderer/render_thread_impl.h"
23 #include "content/renderer/render_view_impl.h" 24 #include "content/renderer/render_view_impl.h"
24 #include "third_party/WebKit/public/platform/WebString.h" 25 #include "third_party/WebKit/public/platform/WebString.h"
25 #include "third_party/WebKit/public/web/WebLocalFrame.h" 26 #include "third_party/WebKit/public/web/WebLocalFrame.h"
26 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" 27 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
27 #include "third_party/WebKit/public/web/WebView.h" 28 #include "third_party/WebKit/public/web/WebView.h"
28 29
29 namespace content { 30 namespace content {
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 float scale_factor) { 425 float scale_factor) {
425 Send(new FrameHostMsg_InitializeChildFrame( 426 Send(new FrameHostMsg_InitializeChildFrame(
426 routing_id_, frame_rect, scale_factor)); 427 routing_id_, frame_rect, scale_factor));
427 } 428 }
428 429
429 void RenderFrameProxy::navigate(const blink::WebURLRequest& request, 430 void RenderFrameProxy::navigate(const blink::WebURLRequest& request,
430 bool should_replace_current_entry) { 431 bool should_replace_current_entry) {
431 FrameHostMsg_OpenURL_Params params; 432 FrameHostMsg_OpenURL_Params params;
432 params.url = request.url(); 433 params.url = request.url();
433 params.referrer = Referrer( 434 params.referrer = Referrer(
434 GURL(request.httpHeaderField(blink::WebString::fromUTF8("Referer"))), 435 WebStringToGURL(
436 request.httpHeaderField(blink::WebString::fromUTF8("Referer"))),
435 request.referrerPolicy()); 437 request.referrerPolicy());
436 params.disposition = CURRENT_TAB; 438 params.disposition = CURRENT_TAB;
437 params.should_replace_current_entry = should_replace_current_entry; 439 params.should_replace_current_entry = should_replace_current_entry;
438 params.user_gesture = 440 params.user_gesture =
439 blink::WebUserGestureIndicator::isProcessingUserGesture(); 441 blink::WebUserGestureIndicator::isProcessingUserGesture();
440 blink::WebUserGestureIndicator::consumeUserGesture(); 442 blink::WebUserGestureIndicator::consumeUserGesture();
441 Send(new FrameHostMsg_OpenURL(routing_id_, params)); 443 Send(new FrameHostMsg_OpenURL(routing_id_, params));
442 } 444 }
443 445
444 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { 446 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) {
(...skipping 24 matching lines...) Expand all
469 blink::WebLocalFrame* source) { 471 blink::WebLocalFrame* source) {
470 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); 472 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID();
471 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); 473 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id));
472 } 474 }
473 475
474 void RenderFrameProxy::frameFocused() { 476 void RenderFrameProxy::frameFocused() {
475 Send(new FrameHostMsg_FrameFocused(routing_id_)); 477 Send(new FrameHostMsg_FrameFocused(routing_id_));
476 } 478 }
477 479
478 } // namespace 480 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698