OLD | NEW |
---|---|
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 <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/metrics/persistent_histogram_allocator.h" | 16 #include "base/metrics/persistent_histogram_allocator.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/renderer/searchbox/search_bouncer.h" | 24 #include "chrome/renderer/searchbox/search_bouncer.h" |
25 #include "components/data_reduction_proxy/content/common/data_reduction_proxy_me ssages.h" | 25 #include "components/data_reduction_proxy/content/common/data_reduction_proxy.mo jom.h" |
26 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" | 26 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" |
27 #include "content/public/common/content_constants.h" | 27 #include "content/public/common/content_constants.h" |
28 #include "content/public/renderer/document_state.h" | 28 #include "content/public/renderer/document_state.h" |
29 #include "content/public/renderer/render_frame.h" | 29 #include "content/public/renderer/render_frame.h" |
30 #include "content/public/renderer/render_thread.h" | 30 #include "content/public/renderer/render_thread.h" |
31 #include "content/public/renderer/render_view.h" | 31 #include "content/public/renderer/render_view.h" |
32 #include "extensions/common/url_pattern.h" | 32 #include "extensions/common/url_pattern.h" |
33 #include "net/base/url_util.h" | 33 #include "net/base/url_util.h" |
34 #include "net/http/http_response_headers.h" | 34 #include "net/http/http_response_headers.h" |
35 #include "services/shell/public/cpp/interface_provider.h" | |
35 #include "third_party/WebKit/public/platform/URLConversion.h" | 36 #include "third_party/WebKit/public/platform/URLConversion.h" |
36 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 37 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
37 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 38 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
38 #include "third_party/WebKit/public/web/WebDocument.h" | 39 #include "third_party/WebKit/public/web/WebDocument.h" |
39 #include "third_party/WebKit/public/web/WebFrame.h" | 40 #include "third_party/WebKit/public/web/WebFrame.h" |
40 #include "third_party/WebKit/public/web/WebPerformance.h" | 41 #include "third_party/WebKit/public/web/WebPerformance.h" |
41 #include "third_party/WebKit/public/web/WebView.h" | 42 #include "third_party/WebKit/public/web/WebView.h" |
42 #include "url/gurl.h" | 43 #include "url/gurl.h" |
43 | 44 |
44 #if defined(ENABLE_EXTENSIONS) | 45 #if defined(ENABLE_EXTENSIONS) |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
829 // for pages visited due to an explicit user navigation. | 830 // for pages visited due to an explicit user navigation. |
830 if (SearchBouncer::GetInstance()->IsNewTabPage(frame->document().url())) { | 831 if (SearchBouncer::GetInstance()->IsNewTabPage(frame->document().url())) { |
831 return; | 832 return; |
832 } | 833 } |
833 | 834 |
834 DocumentState* document_state = | 835 DocumentState* document_state = |
835 DocumentState::FromDataSource(frame->dataSource()); | 836 DocumentState::FromDataSource(frame->dataSource()); |
836 | 837 |
837 bool data_reduction_proxy_was_used = false; | 838 bool data_reduction_proxy_was_used = false; |
838 if (!document_state->proxy_server().IsEmpty()) { | 839 if (!document_state->proxy_server().IsEmpty()) { |
839 bool handled = | 840 data_reduction_proxy::mojom::DataReductionProxyHostPtr |
840 Send(new DataReductionProxyViewHostMsg_IsDataReductionProxy( | 841 data_reduction_proxy_host; |
841 document_state->proxy_server(), &data_reduction_proxy_was_used)); | 842 content::RenderThread::Get()->GetRemoteInterfaces()->GetInterface( |
843 mojo::GetProxy(&data_reduction_proxy_host)); | |
844 bool handled = data_reduction_proxy_host->IsDataReductionProxy( | |
dcheng
2016/08/26 19:16:20
What happens to this request if the other side is
leonhsl(Using Gerrit)
2016/08/29 06:12:06
Normally the other side will either bind or reject
| |
845 document_state->proxy_server(), &data_reduction_proxy_was_used); | |
842 // If the IPC call is not handled, then |data_reduction_proxy_was_used| | 846 // If the IPC call is not handled, then |data_reduction_proxy_was_used| |
843 // should remain |false|. | 847 // should remain |false|. |
844 DCHECK(handled || !data_reduction_proxy_was_used); | 848 DCHECK(handled || !data_reduction_proxy_was_used); |
845 } | 849 } |
846 | 850 |
847 bool came_from_websearch = IsFromGoogleSearchResult( | 851 bool came_from_websearch = IsFromGoogleSearchResult( |
848 frame->document().url(), | 852 frame->document().url(), |
849 blink::WebStringToGURL(frame->document().referrer())); | 853 blink::WebStringToGURL(frame->document().referrer())); |
850 int websearch_chrome_joint_experiment_id = kNoExperiment; | 854 int websearch_chrome_joint_experiment_id = kNoExperiment; |
851 bool is_preview = false; | 855 bool is_preview = false; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
912 Time start = document_state->start_load_time(); | 916 Time start = document_state->start_load_time(); |
913 Time finish = document_state->finish_load_time(); | 917 Time finish = document_state->finish_load_time(); |
914 // TODO(mbelshe): should we log more stats? | 918 // TODO(mbelshe): should we log more stats? |
915 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " | 919 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " |
916 << url.spec(); | 920 << url.spec(); |
917 } | 921 } |
918 | 922 |
919 void PageLoadHistograms::OnDestruct() { | 923 void PageLoadHistograms::OnDestruct() { |
920 delete this; | 924 delete this; |
921 } | 925 } |
OLD | NEW |