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

Side by Side Diff: chrome/browser/predictors/resource_prefetch_common.cc

Issue 10817004: Adds speculative prefetching of resources. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressing Dominich's comment. Created 8 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/predictors/resource_prefetch_common.h" 5 #include "chrome/browser/predictors/resource_prefetch_common.h"
6 6
7 #include "content/public/browser/render_process_host.h" 7 #include "content/public/browser/render_process_host.h"
8 #include "content/public/browser/render_view_host.h" 8 #include "content/public/browser/render_view_host.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 DCHECK(is_valid() && rhs.is_valid()); 45 DCHECK(is_valid() && rhs.is_valid());
46 return IsSameRenderer(rhs) && main_frame_url == rhs.main_frame_url; 46 return IsSameRenderer(rhs) && main_frame_url == rhs.main_frame_url;
47 } 47 }
48 48
49 bool NavigationID::IsSameRenderer(const NavigationID& other) const { 49 bool NavigationID::IsSameRenderer(const NavigationID& other) const {
50 DCHECK(is_valid() && other.is_valid()); 50 DCHECK(is_valid() && other.is_valid());
51 return render_process_id == other.render_process_id && 51 return render_process_id == other.render_process_id &&
52 render_view_id == other.render_view_id; 52 render_view_id == other.render_view_id;
53 } 53 }
54 54
55 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig()
56 : max_navigation_lifetime_seconds(60),
57 max_urls_to_track(500),
58 min_url_visit_count(3),
59 max_resources_per_entry(50),
60 max_consecutive_misses(3),
61 min_resource_confidence_to_trigger_prefetch(0.8f),
62 min_resource_hits_to_trigger_prefetch(4),
63 max_prefetches_inflight_per_navigation(24),
64 max_prefetches_inflight_per_host_per_navigation(3) {
65 }
66
55 } // namespace predictors 67 } // namespace predictors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698