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

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

Issue 2337233006: CL for src perf tryjob to run page_cycler_v2.intl_ko_th_vi benchmark on all-android platform(s)
Patch Set: Created 4 years, 3 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 14 matching lines...) Expand all
25 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" 25 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
26 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" 26 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h"
27 #include "chrome/browser/plugins/plugin_prefs.h" 27 #include "chrome/browser/plugins/plugin_prefs.h"
28 #include "chrome/browser/prerender/prerender_manager.h" 28 #include "chrome/browser/prerender/prerender_manager.h"
29 #include "chrome/browser/prerender/prerender_manager_factory.h" 29 #include "chrome/browser/prerender/prerender_manager_factory.h"
30 #include "chrome/browser/prerender/prerender_resource_throttle.h" 30 #include "chrome/browser/prerender/prerender_resource_throttle.h"
31 #include "chrome/browser/prerender/prerender_util.h" 31 #include "chrome/browser/prerender/prerender_util.h"
32 #include "chrome/browser/profiles/profile.h" 32 #include "chrome/browser/profiles/profile.h"
33 #include "chrome/browser/profiles/profile_io_data.h" 33 #include "chrome/browser/profiles/profile_io_data.h"
34 #include "chrome/browser/renderer_host/chrome_navigation_data.h" 34 #include "chrome/browser/renderer_host/chrome_navigation_data.h"
35 #include "chrome/browser/renderer_host/predictor_resource_throttle.h"
36 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" 35 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
37 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 36 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
38 #include "chrome/browser/search/search.h" 37 #include "chrome/browser/search/search.h"
39 #include "chrome/browser/search_engines/template_url_service_factory.h" 38 #include "chrome/browser/search_engines/template_url_service_factory.h"
40 #include "chrome/browser/signin/chrome_signin_helper.h" 39 #include "chrome/browser/signin/chrome_signin_helper.h"
41 #include "chrome/browser/tab_contents/tab_util.h" 40 #include "chrome/browser/tab_contents/tab_util.h"
42 #include "chrome/browser/ui/login/login_handler.h" 41 #include "chrome/browser/ui/login/login_handler.h"
43 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
44 #include "chrome/common/features.h" 43 #include "chrome/common/features.h"
45 #include "chrome/common/url_constants.h" 44 #include "chrome/common/url_constants.h"
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 extension_throttle_manager->MaybeCreateThrottle(request); 627 extension_throttle_manager->MaybeCreateThrottle(request);
629 if (extension_throttle) 628 if (extension_throttle)
630 throttles->push_back(extension_throttle.release()); 629 throttles->push_back(extension_throttle.release());
631 } 630 }
632 #endif 631 #endif
633 632
634 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); 633 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
635 if (info->GetVisibilityState() == blink::WebPageVisibilityStatePrerender) { 634 if (info->GetVisibilityState() == blink::WebPageVisibilityStatePrerender) {
636 throttles->push_back(new prerender::PrerenderResourceThrottle(request)); 635 throttles->push_back(new prerender::PrerenderResourceThrottle(request));
637 } 636 }
638
639 std::unique_ptr<PredictorResourceThrottle> predictor_throttle =
640 PredictorResourceThrottle::MaybeCreate(request, io_data);
641 if (predictor_throttle)
642 throttles->push_back(predictor_throttle.release());
643 } 637 }
644 638
645 bool ChromeResourceDispatcherHostDelegate::ShouldForceDownloadResource( 639 bool ChromeResourceDispatcherHostDelegate::ShouldForceDownloadResource(
646 const GURL& url, const std::string& mime_type) { 640 const GURL& url, const std::string& mime_type) {
647 #if defined(ENABLE_EXTENSIONS) 641 #if defined(ENABLE_EXTENSIONS)
648 // Special-case user scripts to get downloaded instead of viewed. 642 // Special-case user scripts to get downloaded instead of viewed.
649 return extensions::UserScript::IsURLUserScript(url, mime_type); 643 return extensions::UserScript::IsURLUserScript(url, mime_type);
650 #else 644 #else
651 return false; 645 return false;
652 #endif 646 #endif
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, 858 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad,
865 base::Unretained(this), url, request_loading_time)); 859 base::Unretained(this), url, request_loading_time));
866 return; 860 return;
867 } 861 }
868 862
869 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? 863 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ?
870 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); 864 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow");
871 rappor::SampleDomainAndRegistryFromGURL( 865 rappor::SampleDomainAndRegistryFromGURL(
872 g_browser_process->rappor_service(), metric_name, url); 866 g_browser_process->rappor_service(), metric_name, url);
873 } 867 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | chrome/browser/renderer_host/predictor_resource_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698