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

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

Issue 1983773002: Cache SearchEngineType of TemplateURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-extracting-terms-from-template-url
Patch Set: Fix typo Created 4 years, 6 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 30 matching lines...) Expand all
41 #include "chrome/browser/tab_contents/tab_util.h" 41 #include "chrome/browser/tab_contents/tab_util.h"
42 #include "chrome/browser/ui/login/login_handler.h" 42 #include "chrome/browser/ui/login/login_handler.h"
43 #include "chrome/common/chrome_switches.h" 43 #include "chrome/common/chrome_switches.h"
44 #include "chrome/common/features.h" 44 #include "chrome/common/features.h"
45 #include "chrome/common/url_constants.h" 45 #include "chrome/common/url_constants.h"
46 #include "components/content_settings/core/browser/host_content_settings_map.h" 46 #include "components/content_settings/core/browser/host_content_settings_map.h"
47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data .h" 47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data .h"
48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
49 #include "components/google/core/browser/google_util.h" 49 #include "components/google/core/browser/google_util.h"
50 #include "components/policy/core/common/cloud/policy_header_io_helper.h" 50 #include "components/policy/core/common/cloud/policy_header_io_helper.h"
51 #include "components/search_engines/template_url_prepopulate_data.h"
52 #include "components/search_engines/template_url_service.h" 51 #include "components/search_engines/template_url_service.h"
53 #include "components/variations/net/variations_http_headers.h" 52 #include "components/variations/net/variations_http_headers.h"
54 #include "content/public/browser/browser_thread.h" 53 #include "content/public/browser/browser_thread.h"
55 #include "content/public/browser/navigation_data.h" 54 #include "content/public/browser/navigation_data.h"
56 #include "content/public/browser/notification_service.h" 55 #include "content/public/browser/notification_service.h"
57 #include "content/public/browser/plugin_service.h" 56 #include "content/public/browser/plugin_service.h"
58 #include "content/public/browser/plugin_service_filter.h" 57 #include "content/public/browser/plugin_service_filter.h"
59 #include "content/public/browser/render_process_host.h" 58 #include "content/public/browser/render_process_host.h"
60 #include "content/public/browser/render_view_host.h" 59 #include "content/public/browser/render_view_host.h"
61 #include "content/public/browser/resource_context.h" 60 #include "content/public/browser/resource_context.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // be shown. As of April 2016, only Bing and Google have remote NTPs. 305 // be shown. As of April 2016, only Bing and Google have remote NTPs.
307 if (url.SchemeIsHTTPOrHTTPS()) { 306 if (url.SchemeIsHTTPOrHTTPS()) {
308 TemplateURLService* template_url_service = 307 TemplateURLService* template_url_service =
309 TemplateURLServiceFactory::GetForProfile(profile); 308 TemplateURLServiceFactory::GetForProfile(profile);
310 if (!template_url_service) 309 if (!template_url_service)
311 return; 310 return;
312 TemplateURL* default_provider = 311 TemplateURL* default_provider =
313 template_url_service->GetDefaultSearchProvider(); 312 template_url_service->GetDefaultSearchProvider();
314 if (!default_provider) 313 if (!default_provider)
315 return; 314 return;
316 if (TemplateURLPrepopulateData::GetEngineType( 315 if (default_provider->GetEngineType(
317 *default_provider, template_url_service->search_terms_data()) == 316 template_url_service->search_terms_data()) ==
318 SearchEngineType::SEARCH_ENGINE_GOOGLE) { 317 SearchEngineType::SEARCH_ENGINE_GOOGLE) {
319 if (net_error == net::OK) { 318 if (net_error == net::OK) {
320 UMA_HISTOGRAM_LONG_TIMES("Net.NTP.Google.RequestTime2.Success", 319 UMA_HISTOGRAM_LONG_TIMES("Net.NTP.Google.RequestTime2.Success",
321 request_loading_time); 320 request_loading_time);
322 } else if (net_error == net::ERR_ABORTED) { 321 } else if (net_error == net::ERR_ABORTED) {
323 UMA_HISTOGRAM_LONG_TIMES("Net.NTP.Google.RequestTime2.ErrAborted", 322 UMA_HISTOGRAM_LONG_TIMES("Net.NTP.Google.RequestTime2.ErrAborted",
324 request_loading_time); 323 request_loading_time);
325 } 324 }
326 } else { 325 } else {
327 if (net_error == net::OK) { 326 if (net_error == net::OK) {
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data = 842 data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data =
844 data_reduction_proxy::DataReductionProxyData::GetData(*request); 843 data_reduction_proxy::DataReductionProxyData::GetData(*request);
845 // DeepCopy the DataReductionProxyData from the URLRequest to prevent the 844 // DeepCopy the DataReductionProxyData from the URLRequest to prevent the
846 // URLRequest and DataReductionProxyData from both having ownership of the 845 // URLRequest and DataReductionProxyData from both having ownership of the
847 // same object. This copy will be shortlived as it will be deep copied again 846 // same object. This copy will be shortlived as it will be deep copied again
848 // when content makes a clone of NavigationData for the UI thread. 847 // when content makes a clone of NavigationData for the UI thread.
849 if (data_reduction_proxy_data) 848 if (data_reduction_proxy_data)
850 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy()); 849 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy());
851 return data; 850 return data;
852 } 851 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/search/local_ntp_source.cc » ('j') | components/search_engines/prepopulated_engines.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698