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

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: Reverting unchanged files 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 11 matching lines...) Expand all
22 #include "chrome/browser/download/download_resource_throttle.h" 22 #include "chrome/browser/download/download_resource_throttle.h"
23 #include "chrome/browser/mod_pagespeed/mod_pagespeed_metrics.h" 23 #include "chrome/browser/mod_pagespeed/mod_pagespeed_metrics.h"
24 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" 24 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
25 #include "chrome/browser/plugins/plugin_prefs.h" 25 #include "chrome/browser/plugins/plugin_prefs.h"
26 #include "chrome/browser/prerender/prerender_manager.h" 26 #include "chrome/browser/prerender/prerender_manager.h"
27 #include "chrome/browser/prerender/prerender_manager_factory.h" 27 #include "chrome/browser/prerender/prerender_manager_factory.h"
28 #include "chrome/browser/prerender/prerender_resource_throttle.h" 28 #include "chrome/browser/prerender/prerender_resource_throttle.h"
29 #include "chrome/browser/prerender/prerender_util.h" 29 #include "chrome/browser/prerender/prerender_util.h"
30 #include "chrome/browser/profiles/profile.h" 30 #include "chrome/browser/profiles/profile.h"
31 #include "chrome/browser/profiles/profile_io_data.h" 31 #include "chrome/browser/profiles/profile_io_data.h"
32 #include "chrome/browser/renderer_host/chrome_navigation_data.h"
32 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" 33 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
33 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h" 34 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h"
34 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 35 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
35 #include "chrome/browser/signin/chrome_signin_helper.h" 36 #include "chrome/browser/signin/chrome_signin_helper.h"
36 #include "chrome/browser/tab_contents/tab_util.h" 37 #include "chrome/browser/tab_contents/tab_util.h"
37 #include "chrome/browser/ui/login/login_handler.h" 38 #include "chrome/browser/ui/login/login_handler.h"
38 #include "chrome/common/chrome_switches.h" 39 #include "chrome/common/chrome_switches.h"
39 #include "chrome/common/features.h" 40 #include "chrome/common/features.h"
40 #include "chrome/common/url_constants.h" 41 #include "chrome/common/url_constants.h"
41 #include "components/content_settings/core/browser/host_content_settings_map.h" 42 #include "components/content_settings/core/browser/host_content_settings_map.h"
43 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data .h"
42 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 44 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
43 #include "components/google/core/browser/google_util.h" 45 #include "components/google/core/browser/google_util.h"
44 #include "components/policy/core/common/cloud/policy_header_io_helper.h" 46 #include "components/policy/core/common/cloud/policy_header_io_helper.h"
45 #include "components/variations/net/variations_http_headers.h" 47 #include "components/variations/net/variations_http_headers.h"
46 #include "content/public/browser/browser_thread.h" 48 #include "content/public/browser/browser_thread.h"
49 #include "content/public/browser/navigation_data.h"
47 #include "content/public/browser/notification_service.h" 50 #include "content/public/browser/notification_service.h"
48 #include "content/public/browser/plugin_service.h" 51 #include "content/public/browser/plugin_service.h"
49 #include "content/public/browser/plugin_service_filter.h" 52 #include "content/public/browser/plugin_service_filter.h"
50 #include "content/public/browser/render_process_host.h" 53 #include "content/public/browser/render_process_host.h"
51 #include "content/public/browser/render_view_host.h" 54 #include "content/public/browser/render_view_host.h"
52 #include "content/public/browser/resource_context.h" 55 #include "content/public/browser/resource_context.h"
53 #include "content/public/browser/resource_dispatcher_host.h" 56 #include "content/public/browser/resource_dispatcher_host.h"
54 #include "content/public/browser/resource_request_info.h" 57 #include "content/public/browser/resource_request_info.h"
55 #include "content/public/browser/service_worker_context.h" 58 #include "content/public/browser/service_worker_context.h"
56 #include "content/public/browser/stream_info.h" 59 #include "content/public/browser/stream_info.h"
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); 718 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request);
716 return false; 719 return false;
717 } 720 }
718 721
719 // static 722 // static
720 void ChromeResourceDispatcherHostDelegate:: 723 void ChromeResourceDispatcherHostDelegate::
721 SetExternalProtocolHandlerDelegateForTesting( 724 SetExternalProtocolHandlerDelegateForTesting(
722 ExternalProtocolHandler::Delegate* delegate) { 725 ExternalProtocolHandler::Delegate* delegate) {
723 g_external_protocol_handler_delegate = delegate; 726 g_external_protocol_handler_delegate = delegate;
724 } 727 }
728
729 content::NavigationData*
730 ChromeResourceDispatcherHostDelegate::GetNavigationData(
731 net::URLRequest* request) const {
732 ChromeNavigationData* data =
733 ChromeNavigationData::GetDataAndCreateIfNecessary(request);
734 if (request) {
735 data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data =
736 data_reduction_proxy::DataReductionProxyData::GetData(*request);
737 // DeepCopy the DataReductionProxyData from the URLRequest to prevent the
738 // URLRequest and DataReductionProxyData from both having ownership of the
739 // same object. This copy will be shortlived as it will be deep copied again
740 // when content makes a clone of NavigationData for the UI thread.
741 if (data_reduction_proxy_data)
742 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy());
mmenke 2016/05/06 18:59:36 This seems worse than the last iteration - we're r
RyanSturm 2016/05/06 20:55:44 This method wasn't intended to be called more than
743 }
744 return data;
745 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698