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

Side by Side 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 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/page_load_histograms.h" 5 #include "chrome/renderer/page_load_histograms.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "components/data_reduction_proxy/content/common/data_reduction_proxy_me ssages.h" 24 #include "components/data_reduction_proxy/content/common/data_reduction_proxy_me ssages.h"
25 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" 25 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
26 #include "content/public/common/content_constants.h" 26 #include "content/public/common/content_constants.h"
27 #include "content/public/renderer/document_state.h" 27 #include "content/public/renderer/document_state.h"
28 #include "content/public/renderer/render_frame.h" 28 #include "content/public/renderer/render_frame.h"
29 #include "content/public/renderer/render_thread.h" 29 #include "content/public/renderer/render_thread.h"
30 #include "content/public/renderer/render_view.h" 30 #include "content/public/renderer/render_view.h"
31 #include "extensions/common/url_pattern.h" 31 #include "extensions/common/url_pattern.h"
32 #include "net/base/url_util.h" 32 #include "net/base/url_util.h"
33 #include "net/http/http_response_headers.h" 33 #include "net/http/http_response_headers.h"
34 #include "third_party/WebKit/public/platform/URLConversion.h"
34 #include "third_party/WebKit/public/platform/WebURLRequest.h" 35 #include "third_party/WebKit/public/platform/WebURLRequest.h"
35 #include "third_party/WebKit/public/platform/WebURLResponse.h" 36 #include "third_party/WebKit/public/platform/WebURLResponse.h"
36 #include "third_party/WebKit/public/web/WebDocument.h" 37 #include "third_party/WebKit/public/web/WebDocument.h"
37 #include "third_party/WebKit/public/web/WebFrame.h" 38 #include "third_party/WebKit/public/web/WebFrame.h"
38 #include "third_party/WebKit/public/web/WebPerformance.h" 39 #include "third_party/WebKit/public/web/WebPerformance.h"
39 #include "third_party/WebKit/public/web/WebView.h" 40 #include "third_party/WebKit/public/web/WebView.h"
40 #include "url/gurl.h" 41 #include "url/gurl.h"
41 42
42 #if defined(ENABLE_EXTENSIONS) 43 #if defined(ENABLE_EXTENSIONS)
43 #include "chrome/renderer/extensions/chrome_extensions_renderer_client.h" 44 #include "chrome/renderer/extensions/chrome_extensions_renderer_client.h"
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 bool data_reduction_proxy_was_used = false; 904 bool data_reduction_proxy_was_used = false;
904 if (!document_state->proxy_server().IsEmpty()) { 905 if (!document_state->proxy_server().IsEmpty()) {
905 bool handled = 906 bool handled =
906 Send(new DataReductionProxyViewHostMsg_IsDataReductionProxy( 907 Send(new DataReductionProxyViewHostMsg_IsDataReductionProxy(
907 document_state->proxy_server(), &data_reduction_proxy_was_used)); 908 document_state->proxy_server(), &data_reduction_proxy_was_used));
908 // If the IPC call is not handled, then |data_reduction_proxy_was_used| 909 // If the IPC call is not handled, then |data_reduction_proxy_was_used|
909 // should remain |false|. 910 // should remain |false|.
910 DCHECK(handled || !data_reduction_proxy_was_used); 911 DCHECK(handled || !data_reduction_proxy_was_used);
911 } 912 }
912 913
913 bool came_from_websearch = 914 bool came_from_websearch = IsFromGoogleSearchResult(
914 IsFromGoogleSearchResult(frame->document().url(), 915 frame->document().url(),
915 GURL(frame->document().referrer())); 916 blink::WebStringToGURL(frame->document().referrer()));
916 int websearch_chrome_joint_experiment_id = kNoExperiment; 917 int websearch_chrome_joint_experiment_id = kNoExperiment;
917 bool is_preview = false; 918 bool is_preview = false;
918 if (came_from_websearch) { 919 if (came_from_websearch) {
919 websearch_chrome_joint_experiment_id = 920 websearch_chrome_joint_experiment_id = GetQueryStringBasedExperiment(
920 GetQueryStringBasedExperiment(GURL(frame->document().referrer())); 921 blink::WebStringToGURL(frame->document().referrer()));
921 is_preview = ViaHeaderContains(frame, "1.1 Google Instant Proxy Preview"); 922 is_preview = ViaHeaderContains(frame, "1.1 Google Instant Proxy Preview");
922 } 923 }
923 924
924 MaybeDumpFirstLayoutHistograms(); 925 MaybeDumpFirstLayoutHistograms();
925 926
926 content::RenderFrame* render_frame = 927 content::RenderFrame* render_frame =
927 content::RenderFrame::FromWebFrame(frame); 928 content::RenderFrame::FromWebFrame(frame);
928 929
929 // Metrics based on the timing information recorded for the Navigation Timing 930 // Metrics based on the timing information recorded for the Navigation Timing
930 // API - http://www.w3.org/TR/navigation-timing/. 931 // API - http://www.w3.org/TR/navigation-timing/.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 1044
1044 DCHECK(document_state); 1045 DCHECK(document_state);
1045 DCHECK(ds); 1046 DCHECK(ds);
1046 GURL url(ds->request().url()); 1047 GURL url(ds->request().url());
1047 Time start = document_state->start_load_time(); 1048 Time start = document_state->start_load_time();
1048 Time finish = document_state->finish_load_time(); 1049 Time finish = document_state->finish_load_time();
1049 // TODO(mbelshe): should we log more stats? 1050 // TODO(mbelshe): should we log more stats?
1050 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " 1051 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms "
1051 << url.spec(); 1052 << url.spec();
1052 } 1053 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/resource_request_policy.cc ('k') | chrome/renderer/plugins/chrome_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698