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

Unified Diff: content/renderer/render_view_impl.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_frame_proxy.cc ('k') | content/renderer/renderer_blink_platform_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 8e6b887898ab8d916a792a0c3ac9535868d0ebe0..023295b3fc5259aee42a2fac1b4a0c2ef716f948 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -109,6 +109,7 @@
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/http/http_util.h"
#include "skia/ext/platform_canvas.h"
+#include "third_party/WebKit/public/platform/URLConversion.h"
#include "third_party/WebKit/public/platform/WebCString.h"
#include "third_party/WebKit/public/platform/WebConnectionType.h"
#include "third_party/WebKit/public/platform/WebDragData.h"
@@ -316,8 +317,10 @@ static RenderViewImpl* (*g_create_render_view_impl)(
Referrer RenderViewImpl::GetReferrerFromRequest(
WebFrame* frame,
const WebURLRequest& request) {
- return Referrer(GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
- request.referrerPolicy());
+ return Referrer(
+ blink::WebStringToGURL(request.httpHeaderField(
+ WebString::fromUTF8("Referer"))),
+ request.referrerPolicy());
}
// static
@@ -1605,10 +1608,11 @@ WebView* RenderViewImpl::createView(WebLocalFrame* creator,
params.opener_top_level_frame_url = creator->top()->document().url();
} else {
params.opener_top_level_frame_url =
- GURL(creator->top()->securityOrigin().toString());
+ blink::WebStringToGURL(creator->top()->securityOrigin().toString());
}
- GURL security_url(creator->document().securityOrigin().toString());
+ GURL security_url(blink::WebStringToGURL(
+ creator->document().securityOrigin().toString()));
if (!security_url.is_valid())
security_url = GURL();
params.opener_security_origin = security_url;
« no previous file with comments | « content/renderer/render_frame_proxy.cc ('k') | content/renderer/renderer_blink_platform_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698