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

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 7 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/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 12 matching lines...) Expand all
23 #include "chrome/browser/download/download_resource_throttle.h" 23 #include "chrome/browser/download/download_resource_throttle.h"
24 #include "chrome/browser/mod_pagespeed/mod_pagespeed_metrics.h" 24 #include "chrome/browser/mod_pagespeed/mod_pagespeed_metrics.h"
25 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" 25 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
26 #include "chrome/browser/plugins/plugin_prefs.h" 26 #include "chrome/browser/plugins/plugin_prefs.h"
27 #include "chrome/browser/prerender/prerender_manager.h" 27 #include "chrome/browser/prerender/prerender_manager.h"
28 #include "chrome/browser/prerender/prerender_manager_factory.h" 28 #include "chrome/browser/prerender/prerender_manager_factory.h"
29 #include "chrome/browser/prerender/prerender_resource_throttle.h" 29 #include "chrome/browser/prerender/prerender_resource_throttle.h"
30 #include "chrome/browser/prerender/prerender_util.h" 30 #include "chrome/browser/prerender/prerender_util.h"
31 #include "chrome/browser/profiles/profile.h" 31 #include "chrome/browser/profiles/profile.h"
32 #include "chrome/browser/profiles/profile_io_data.h" 32 #include "chrome/browser/profiles/profile_io_data.h"
33 #include "chrome/browser/renderer_host/chrome_navigation_data.h"
33 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" 34 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
34 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h" 35 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h"
35 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 36 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
36 #include "chrome/browser/search/search.h" 37 #include "chrome/browser/search/search.h"
37 #include "chrome/browser/search_engines/template_url_service_factory.h" 38 #include "chrome/browser/search_engines/template_url_service_factory.h"
38 #include "chrome/browser/signin/chrome_signin_helper.h" 39 #include "chrome/browser/signin/chrome_signin_helper.h"
39 #include "chrome/browser/tab_contents/tab_util.h" 40 #include "chrome/browser/tab_contents/tab_util.h"
40 #include "chrome/browser/ui/login/login_handler.h" 41 #include "chrome/browser/ui/login/login_handler.h"
41 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
42 #include "chrome/common/features.h" 43 #include "chrome/common/features.h"
43 #include "chrome/common/url_constants.h" 44 #include "chrome/common/url_constants.h"
44 #include "components/content_settings/core/browser/host_content_settings_map.h" 45 #include "components/content_settings/core/browser/host_content_settings_map.h"
46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data .h"
45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
46 #include "components/google/core/browser/google_util.h" 48 #include "components/google/core/browser/google_util.h"
47 #include "components/policy/core/common/cloud/policy_header_io_helper.h" 49 #include "components/policy/core/common/cloud/policy_header_io_helper.h"
48 #include "components/search_engines/template_url_prepopulate_data.h" 50 #include "components/search_engines/template_url_prepopulate_data.h"
49 #include "components/search_engines/template_url_service.h" 51 #include "components/search_engines/template_url_service.h"
50 #include "components/variations/net/variations_http_headers.h" 52 #include "components/variations/net/variations_http_headers.h"
51 #include "content/public/browser/browser_thread.h" 53 #include "content/public/browser/browser_thread.h"
54 #include "content/public/browser/navigation_data.h"
52 #include "content/public/browser/notification_service.h" 55 #include "content/public/browser/notification_service.h"
53 #include "content/public/browser/plugin_service.h" 56 #include "content/public/browser/plugin_service.h"
54 #include "content/public/browser/plugin_service_filter.h" 57 #include "content/public/browser/plugin_service_filter.h"
55 #include "content/public/browser/render_process_host.h" 58 #include "content/public/browser/render_process_host.h"
56 #include "content/public/browser/render_view_host.h" 59 #include "content/public/browser/render_view_host.h"
57 #include "content/public/browser/resource_context.h" 60 #include "content/public/browser/resource_context.h"
58 #include "content/public/browser/resource_dispatcher_host.h" 61 #include "content/public/browser/resource_dispatcher_host.h"
59 #include "content/public/browser/resource_request_info.h" 62 #include "content/public/browser/resource_request_info.h"
60 #include "content/public/browser/service_worker_context.h" 63 #include "content/public/browser/service_worker_context.h"
61 #include "content/public/browser/stream_info.h" 64 #include "content/public/browser/stream_info.h"
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); 795 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request);
793 return false; 796 return false;
794 } 797 }
795 798
796 // static 799 // static
797 void ChromeResourceDispatcherHostDelegate:: 800 void ChromeResourceDispatcherHostDelegate::
798 SetExternalProtocolHandlerDelegateForTesting( 801 SetExternalProtocolHandlerDelegateForTesting(
799 ExternalProtocolHandler::Delegate* delegate) { 802 ExternalProtocolHandler::Delegate* delegate) {
800 g_external_protocol_handler_delegate = delegate; 803 g_external_protocol_handler_delegate = delegate;
801 } 804 }
805
806 content::NavigationData*
807 ChromeResourceDispatcherHostDelegate::GetNavigationData(
808 net::URLRequest* request) const {
809 ChromeNavigationData* data =
810 ChromeNavigationData::GetDataAndCreateIfNecessary(request);
811 if (!request)
812 return data;
813
814 data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data =
815 data_reduction_proxy::DataReductionProxyData::GetData(*request);
816 // DeepCopy the DataReductionProxyData from the URLRequest to prevent the
817 // URLRequest and DataReductionProxyData from both having ownership of the
818 // same object. This copy will be shortlived as it will be deep copied again
819 // when content makes a clone of NavigationData for the UI thread.
820 if (data_reduction_proxy_data)
821 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy());
822 return data;
823 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698