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

Side by Side Diff: chrome/browser/net/predictor.h

Issue 357723003: Implement prediction_options. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 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
« no previous file with comments | « chrome/browser/net/prediction_options.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // A Predictor object is instantiated once in the browser process, and manages 5 // A Predictor object is instantiated once in the browser process, and manages
6 // both preresolution of hostnames, as well as TCP/IP preconnection to expected 6 // both preresolution of hostnames, as well as TCP/IP preconnection to expected
7 // subresources. 7 // subresources.
8 // Most hostname lists are provided by the renderer processes, and include URLs 8 // Most hostname lists are provided by the renderer processes, and include URLs
9 // that *might* be used in the near future by the browsing user. One goal of 9 // that *might* be used in the near future by the browsing user. One goal of
10 // this class is to cause the underlying DNS structure to lookup a hostname 10 // this class is to cause the underlying DNS structure to lookup a hostname
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 }; 73 };
74 74
75 // Predictor is constructed during Profile construction (on the UI thread), 75 // Predictor is constructed during Profile construction (on the UI thread),
76 // but it is destroyed on the IO thread when ProfileIOData goes away. All of 76 // but it is destroyed on the IO thread when ProfileIOData goes away. All of
77 // its core state and functionality happens on the IO thread. The only UI 77 // its core state and functionality happens on the IO thread. The only UI
78 // methods are initialization / shutdown related (including preconnect 78 // methods are initialization / shutdown related (including preconnect
79 // initialization), or convenience methods that internally forward calls to 79 // initialization), or convenience methods that internally forward calls to
80 // the IO thread. 80 // the IO thread.
81 class Predictor { 81 class Predictor {
82 public: 82 public:
83 // Enum describing when to allow network predictions based on connection type.
84 // The same enum must be used by the platform-dependent components.
85 // TODO(bnc): implement as per crbug.com/334602.
86 enum NetworkPredictionOptions {
87 NETWORK_PREDICTION_ALWAYS,
88 NETWORK_PREDICTION_WIFI_ONLY,
89 NETWORK_PREDICTION_NEVER
90 };
91
92 // A version number for prefs that are saved. This should be incremented when 83 // A version number for prefs that are saved. This should be incremented when
93 // we change the format so that we discard old data. 84 // we change the format so that we discard old data.
94 static const int kPredictorReferrerVersion; 85 static const int kPredictorReferrerVersion;
95 86
96 // Given that the underlying Chromium resolver defaults to a total maximum of 87 // Given that the underlying Chromium resolver defaults to a total maximum of
97 // 8 paralell resolutions, we will avoid any chance of starving navigational 88 // 8 paralell resolutions, we will avoid any chance of starving navigational
98 // resolutions by limiting the number of paralell speculative resolutions. 89 // resolutions by limiting the number of paralell speculative resolutions.
99 // This is used in the field trials and testing. 90 // This is used in the field trials and testing.
100 // TODO(jar): Move this limitation into the resolver. 91 // TODO(jar): Move this limitation into the resolver.
101 static const size_t kMaxSpeculativeParallelResolves; 92 static const size_t kMaxSpeculativeParallelResolves;
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 PrefService* user_prefs, 595 PrefService* user_prefs,
605 PrefService* local_state, 596 PrefService* local_state,
606 IOThread* io_thread, 597 IOThread* io_thread,
607 net::URLRequestContextGetter* getter) OVERRIDE; 598 net::URLRequestContextGetter* getter) OVERRIDE;
608 virtual void ShutdownOnUIThread() OVERRIDE; 599 virtual void ShutdownOnUIThread() OVERRIDE;
609 }; 600 };
610 601
611 } // namespace chrome_browser_net 602 } // namespace chrome_browser_net
612 603
613 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ 604 #endif // CHROME_BROWSER_NET_PREDICTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/prediction_options.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698