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

Unified Diff: chrome/browser/android/chromium_application.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/net/predictor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/chromium_application.cc
diff --git a/chrome/browser/android/chromium_application.cc b/chrome/browser/android/chromium_application.cc
index cebc06a1da3c04a513b1e9aca7aa57934eb28217..1c3823e533e352c2029a17eb7f02af7859503057 100644
--- a/chrome/browser/android/chromium_application.cc
+++ b/chrome/browser/android/chromium_application.cc
@@ -9,6 +9,7 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/net/predictor.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_content_client.h"
@@ -32,14 +33,15 @@ void FlushCookiesOnIOThread(
}
void CommitPendingWritesForProfile(Profile* profile) {
- // Both of these calls are asynchronous. They may not finish (and may not
- // even start!) before the Android OS kills our process. But we can't wait
- // for them to finish because blocking the UI thread is illegal.
+ // These calls are asynchronous. They may not finish (and may not even
+ // start!) before the Android OS kills our process. But we can't wait for them
+ // to finish because blocking the UI thread is illegal.
profile->GetPrefs()->CommitPendingWrite();
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&FlushCookiesOnIOThread,
make_scoped_refptr(profile->GetRequestContext())));
+ profile->GetNetworkPredictor()->SaveStateForNextStartupAndTrim();
}
} // namespace
« no previous file with comments | « no previous file | chrome/browser/net/predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698