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

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

Issue 1004093003: Write the predictor state on shutdown on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/android/chromium_application.cc ('k') | no next file » | 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 #include "chrome/browser/net/predictor.h" 5 #include "chrome/browser/net/predictor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <set> 9 #include <set>
10 #include <sstream> 10 #include <sstream>
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 void Predictor::SaveDnsPrefetchStateForNextStartupAndTrim( 861 void Predictor::SaveDnsPrefetchStateForNextStartupAndTrim(
862 base::ListValue* startup_list, 862 base::ListValue* startup_list,
863 base::ListValue* referral_list, 863 base::ListValue* referral_list,
864 base::WaitableEvent* completion) { 864 base::WaitableEvent* completion) {
865 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 865 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
866 if (initial_observer_.get()) 866 if (initial_observer_.get())
867 initial_observer_->GetInitialDnsResolutionList(startup_list); 867 initial_observer_->GetInitialDnsResolutionList(startup_list);
868 868
869 // Do at least one trim at shutdown, in case the user wasn't running long 869 // Do at least one trim at shutdown, in case the user wasn't running long
870 // enough to do any regular trimming of referrers. 870 // enough to do any regular trimming of referrers.
871 // TODO(lizeb): Should trimming really be done at each shutdown? This could be
872 // a frequent occurrence on Android.
871 TrimReferrersNow(); 873 TrimReferrersNow();
872 SerializeReferrers(referral_list); 874 SerializeReferrers(referral_list);
873 875
874 completion->Signal(); 876 completion->Signal();
875 } 877 }
876 878
877 void Predictor::PreconnectUrl(const GURL& url, 879 void Predictor::PreconnectUrl(const GURL& url,
878 const GURL& first_party_for_cookies, 880 const GURL& first_party_for_cookies,
879 UrlInfo::ResolutionMotivation motivation, 881 UrlInfo::ResolutionMotivation motivation,
880 int count) { 882 int count) {
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 } 1378 }
1377 1379
1378 void SimplePredictor::ShutdownOnUIThread() { 1380 void SimplePredictor::ShutdownOnUIThread() {
1379 SetShutdown(true); 1381 SetShutdown(true);
1380 } 1382 }
1381 1383
1382 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } 1384 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; }
1383 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } 1385 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; }
1384 1386
1385 } // namespace chrome_browser_net 1387 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/android/chromium_application.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698