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

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

Issue 10817004: Adds speculative prefetching of resources. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_
6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_
7 7
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 10
(...skipping 22 matching lines...) Expand all
33 int render_process_id; 33 int render_process_id;
34 int render_view_id; 34 int render_view_id;
35 GURL main_frame_url; 35 GURL main_frame_url;
36 36
37 // NOTE: Even though we store the creation time here, it is not used during 37 // NOTE: Even though we store the creation time here, it is not used during
38 // comparison of two NavigationIDs because it cannot always be determined 38 // comparison of two NavigationIDs because it cannot always be determined
39 // correctly. 39 // correctly.
40 base::TimeTicks creation_time; 40 base::TimeTicks creation_time;
41 }; 41 };
42 42
43 // Represents the config for the resource prefetch prediction algorithm. It is
44 // useful for running experiments.
45 struct ResourcePrefetchPredictorConfig {
46 // Initializes the config with default values.
47 ResourcePrefetchPredictorConfig();
48
49 // If a navigation hasn't seen a load complete event in this much time, it
50 // is considered abandoned.
51 int max_navigation_lifetime_seconds; // Default 60
dominich 2012/07/23 16:04:41 i don't think you should put the defaults here. An
Shishir 2012/08/01 22:35:24 Done.
52 // Size of LRU caches for the Url data.
dominich 2012/07/23 16:04:41 nit: URL
Shishir 2012/08/01 22:35:24 Done.
53 size_t max_urls_to_track; // Default 500
54 // The number of times, we should have seen a visit to this Url in history
dominich 2012/07/23 16:04:41 nit: URL
Shishir 2012/08/01 22:35:24 Done.
55 // to start tracking it. This is to ensure we dont bother with oneoff
56 // entries.
57 int min_url_visit_count; // Default 3
58 // The maximum number of resources to store per entry.
59 int max_resources_per_entry; // Default 50
60 // The number of consecutive misses after we stop tracking a resource Url.
dominich 2012/07/23 16:04:41 nit: URL
Shishir 2012/08/01 22:35:24 Done.
61 int max_consecutive_misses; // Default 3
62
63 // The number of resources we should report accuracy stats on.
64 int num_resources_assumed_prefetched; // Default 25
65
66 // The minimum confidence (accuracy of hits) required for a resource to be
67 // prefetched.
68 float min_resource_confidence_to_trigger_prefetch; // Default 0.8
69 // The minimum number of times we must have a url on record to prefetch it.
70 float min_resource_hits_to_trigger_prefetch; // Default 4
dominich 2012/07/23 16:04:41 why is this float?
Shishir 2012/08/01 22:35:24 Changed to int
71
72 // Maximum number of prefetches that can be inflight for a single navigation.
73 size_t max_prefetches_inflight_per_navigation; // Default 24
74 // Maximum number of prefetches that can be inflight for a host for a single
75 // navigation.
76 int max_prefetches_inflight_per_host_per_navigation; // Default 3
dominich 2012/07/23 16:04:41 inconsistency: Both are max prefetches in-flight,
Shishir 2012/08/01 22:35:24 Its just the way they are used. One was used in co
77 };
78
43 } // namespace predictors 79 } // namespace predictors
44 80
45 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ 81 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698