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

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

Issue 2084093002: Use lossy prefs in the net predictor, and update them more frequently (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@predictor_lru
Patch Set: Fix browser tests Created 4 years, 4 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 | « no previous file | chrome/browser/net/predictor.cc » ('j') | chrome/browser/net/predictor.cc » ('J')
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 // Renderer bundles up list and sends to this browser API via IPC. 232 // Renderer bundles up list and sends to this browser API via IPC.
233 // TODO(csharrison): Use a GURL vector instead to include port and scheme. 233 // TODO(csharrison): Use a GURL vector instead to include port and scheme.
234 void DnsPrefetchList(const std::vector<std::string>& hostnames); 234 void DnsPrefetchList(const std::vector<std::string>& hostnames);
235 235
236 // May be called from either the IO or UI thread and will PostTask 236 // May be called from either the IO or UI thread and will PostTask
237 // to the IO thread if necessary. 237 // to the IO thread if necessary.
238 void DnsPrefetchMotivatedList(const std::vector<GURL>& urls, 238 void DnsPrefetchMotivatedList(const std::vector<GURL>& urls,
239 UrlInfo::ResolutionMotivation motivation); 239 UrlInfo::ResolutionMotivation motivation);
240 240
241 // May be called from either the IO or UI thread and will PostTask 241 // Called from the UI thread in response to the load event.
242 // to the IO thread if necessary.
243 void SaveStateForNextStartup(); 242 void SaveStateForNextStartup();
244 243
245 void SaveDnsPrefetchStateForNextStartup(base::ListValue* startup_list, 244 void SaveDnsPrefetchStateForNextStartup(base::ListValue* startup_list,
246 base::ListValue* referral_list, 245 base::ListValue* referral_list);
247 base::WaitableEvent* completion);
248 246
249 // May be called from either the IO or UI thread and will PostTask 247 // May be called from either the IO or UI thread and will PostTask
250 // to the IO thread if necessary. 248 // to the IO thread if necessary.
251 void PreconnectUrl(const GURL& url, 249 void PreconnectUrl(const GURL& url,
252 const GURL& first_party_for_cookies, 250 const GURL& first_party_for_cookies,
253 UrlInfo::ResolutionMotivation motivation, 251 UrlInfo::ResolutionMotivation motivation,
254 bool allow_credentials, 252 bool allow_credentials,
255 int count); 253 int count);
256 254
257 void PreconnectUrlOnIOThread(const GURL& url, 255 void PreconnectUrlOnIOThread(const GURL& url,
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 560
563 private: 561 private:
564 // These member functions return True for unittests. 562 // These member functions return True for unittests.
565 bool CanPrefetchAndPrerender() const override; 563 bool CanPrefetchAndPrerender() const override;
566 bool CanPreresolveAndPreconnect() const override; 564 bool CanPreresolveAndPreconnect() const override;
567 }; 565 };
568 566
569 } // namespace chrome_browser_net 567 } // namespace chrome_browser_net
570 568
571 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ 569 #endif // CHROME_BROWSER_NET_PREDICTOR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/predictor.cc » ('j') | chrome/browser/net/predictor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698