summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-02-18 14:52:01 +0000
committerKristian Monsen <kristianm@google.com>2011-02-18 16:19:08 +0000
commit50bb8b7f64c84a88670da4ed4e47cf9a1a374814 (patch)
treebd0c9601fbdc56ca8e4856f49dc11621f751f581 /chrome
parent9d6f8a4fbbdbaf61802f8e41de8afb692a0e3408 (diff)
downloadexternal_chromium-50bb8b7f64c84a88670da4ed4e47cf9a1a374814.zip
external_chromium-50bb8b7f64c84a88670da4ed4e47cf9a1a374814.tar.gz
external_chromium-50bb8b7f64c84a88670da4ed4e47cf9a1a374814.tar.bz2
Part of fix for bug 3424424 Browser hanging
Make sure we always post completed message. Change-Id: I21a57176858bdf90e8a974cfea82ddc5ef104935
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/net/sqlite_persistent_cookie_store.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/net/sqlite_persistent_cookie_store.cc b/chrome/browser/net/sqlite_persistent_cookie_store.cc
index e9b1af1..db116b8 100644
--- a/chrome/browser/net/sqlite_persistent_cookie_store.cc
+++ b/chrome/browser/net/sqlite_persistent_cookie_store.cc
@@ -325,8 +325,12 @@ void SQLitePersistentCookieStore::Backend::Commit() {
void SQLitePersistentCookieStore::Backend::Flush(Task* completion_task) {
// Keep this #ifdef when upstreaming to Chromium.
#if defined(ANDROID)
- if (!getDbThread())
+ if (!getDbThread()) {
+ if (completion_task)
+ MessageLoop::current()->PostTask(FROM_HERE, completion_task);
return;
+ }
+
MessageLoop* loop = getDbThread()->message_loop();
loop->PostTask(FROM_HERE, NewRunnableMethod(
this, &Backend::Commit, completion_task));
@@ -596,6 +600,10 @@ void SQLitePersistentCookieStore::DeleteCookie(
void SQLitePersistentCookieStore::Flush(Task* completion_callback) {
if (backend_.get())
backend_->Flush(completion_callback);
+ else {
+ if (completion_callback)
+ MessageLoop::current()->PostTask(FROM_HERE, completion_callback);
+ }
}
#endif