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

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: Fixing nits Created 4 years, 9 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 20 matching lines...) Expand all
31 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" 31 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
32 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h" 32 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h"
33 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 33 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
34 #include "chrome/browser/signin/chrome_signin_helper.h" 34 #include "chrome/browser/signin/chrome_signin_helper.h"
35 #include "chrome/browser/tab_contents/tab_util.h" 35 #include "chrome/browser/tab_contents/tab_util.h"
36 #include "chrome/browser/ui/login/login_prompt.h" 36 #include "chrome/browser/ui/login/login_prompt.h"
37 #include "chrome/common/chrome_switches.h" 37 #include "chrome/common/chrome_switches.h"
38 #include "chrome/common/features.h" 38 #include "chrome/common/features.h"
39 #include "chrome/common/url_constants.h" 39 #include "chrome/common/url_constants.h"
40 #include "components/content_settings/core/browser/host_content_settings_map.h" 40 #include "components/content_settings/core/browser/host_content_settings_map.h"
41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig.h"
41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 42 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
42 #include "components/google/core/browser/google_util.h" 43 #include "components/google/core/browser/google_util.h"
43 #include "components/variations/net/variations_http_headers.h" 44 #include "components/variations/net/variations_http_headers.h"
44 #include "content/public/browser/browser_thread.h" 45 #include "content/public/browser/browser_thread.h"
45 #include "content/public/browser/notification_service.h" 46 #include "content/public/browser/notification_service.h"
46 #include "content/public/browser/plugin_service.h" 47 #include "content/public/browser/plugin_service.h"
47 #include "content/public/browser/plugin_service_filter.h" 48 #include "content/public/browser/plugin_service_filter.h"
48 #include "content/public/browser/render_process_host.h" 49 #include "content/public/browser/render_process_host.h"
49 #include "content/public/browser/render_view_host.h" 50 #include "content/public/browser/render_view_host.h"
50 #include "content/public/browser/resource_context.h" 51 #include "content/public/browser/resource_context.h"
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 content::ResourceContext* resource_context) { 711 content::ResourceContext* resource_context) {
711 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); 712 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
712 data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data = 713 data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data =
713 io_data->data_reduction_proxy_io_data(); 714 io_data->data_reduction_proxy_io_data();
714 715
715 if (data_reduction_proxy_io_data) 716 if (data_reduction_proxy_io_data)
716 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); 717 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request);
717 return false; 718 return false;
718 } 719 }
719 720
721 bool ChromeResourceDispatcherHostDelegate::UsedDataReductionProxy(
722 const net::HostPortPair& proxy_server,
723 content::ResourceContext* resource_context) {
724 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
725 data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data =
726 io_data->data_reduction_proxy_io_data();
727
728 if (data_reduction_proxy_io_data && data_reduction_proxy_io_data->config())
729 return data_reduction_proxy_io_data->config()->IsDataReductionProxy(
tbansal1 2016/03/10 22:49:47 use braces because the content inside the if-block
RyanSturm 2016/03/14 21:00:46 Done.
730 proxy_server, nullptr);
731 return false;
732 }
733
720 // static 734 // static
721 void ChromeResourceDispatcherHostDelegate:: 735 void ChromeResourceDispatcherHostDelegate::
722 SetExternalProtocolHandlerDelegateForTesting( 736 SetExternalProtocolHandlerDelegateForTesting(
723 ExternalProtocolHandler::Delegate* delegate) { 737 ExternalProtocolHandler::Delegate* delegate) {
724 g_external_protocol_handler_delegate = delegate; 738 g_external_protocol_handler_delegate = delegate;
725 } 739 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698