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

Unified Diff: chrome/renderer/page_load_histograms.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
Index: chrome/renderer/page_load_histograms.cc
diff --git a/chrome/renderer/page_load_histograms.cc b/chrome/renderer/page_load_histograms.cc
index 672875aad602782bc4ddec52f3422523eba73e39..e016116f92eb417f938e711aef61344b07f5419c 100644
--- a/chrome/renderer/page_load_histograms.cc
+++ b/chrome/renderer/page_load_histograms.cc
@@ -23,6 +23,7 @@
#include "chrome/renderer/searchbox/search_bouncer.h"
#include "components/data_reduction_proxy/content/common/data_reduction_proxy_messages.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
+#include "content/public/child/url_conversion.h"
#include "content/public/common/content_constants.h"
#include "content/public/renderer/document_state.h"
#include "content/public/renderer/render_frame.h"
@@ -910,14 +911,14 @@ void PageLoadHistograms::Dump(WebFrame* frame) {
DCHECK(handled || !data_reduction_proxy_was_used);
}
- bool came_from_websearch =
- IsFromGoogleSearchResult(frame->document().url(),
- GURL(frame->document().referrer()));
+ bool came_from_websearch = IsFromGoogleSearchResult(
+ frame->document().url(),
+ content::WebStringToGURL(frame->document().referrer()));
int websearch_chrome_joint_experiment_id = kNoExperiment;
bool is_preview = false;
if (came_from_websearch) {
- websearch_chrome_joint_experiment_id =
- GetQueryStringBasedExperiment(GURL(frame->document().referrer()));
+ websearch_chrome_joint_experiment_id = GetQueryStringBasedExperiment(
+ content::WebStringToGURL(frame->document().referrer()));
is_preview = ViaHeaderContains(frame, "1.1 Google Instant Proxy Preview");
}

Powered by Google App Engine
This is Rietveld 408576698