summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-10-13 14:12:12 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-13 14:12:12 -0700
commit68b7deaf18571a90d1abfe7e1247e16cfa72df48 (patch)
tree2f8d4f486aad09345a6d4d18ee5d773b7117d559
parentaafdbd7eeab4f9a3cdc91b2bc43008836c02126c (diff)
parent7d980efe6a2f9473c310a16bed689819ff3dee62 (diff)
downloadexternal_chromium-68b7deaf18571a90d1abfe7e1247e16cfa72df48.zip
external_chromium-68b7deaf18571a90d1abfe7e1247e16cfa72df48.tar.gz
external_chromium-68b7deaf18571a90d1abfe7e1247e16cfa72df48.tar.bz2
am 7d980efe: am df5ec85c: Merge "Causing webviews to hang." into ics-mr0
* commit '7d980efe6a2f9473c310a16bed689819ff3dee62': Causing webviews to hang.
-rw-r--r--chrome/browser/net/sqlite_persistent_cookie_store.cc33
1 files changed, 12 insertions, 21 deletions
diff --git a/chrome/browser/net/sqlite_persistent_cookie_store.cc b/chrome/browser/net/sqlite_persistent_cookie_store.cc
index 35948ca..af9e753 100644
--- a/chrome/browser/net/sqlite_persistent_cookie_store.cc
+++ b/chrome/browser/net/sqlite_persistent_cookie_store.cc
@@ -12,9 +12,6 @@
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/file_util.h"
-#ifdef ANDROID
-#include "base/lazy_instance.h"
-#endif
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -29,31 +26,25 @@
#include "googleurl/src/gurl.h"
#ifdef ANDROID
-// This class is used by CookieMonster, which is threadsafe, so this class must
-// be threadsafe too.
-base::Thread* getDbThread() {
- base::LazyInstance<base::Lock> db_thread_lock(base::LINKER_INITIALIZED);
- base::AutoLock lock(*db_thread_lock.Pointer());
-
- // FIXME: We should probably be using LazyInstance here.
- static base::Thread* db_thread = NULL;
-
- if (db_thread && db_thread->IsRunning())
- return db_thread;
+base::Thread* getDbThread()
+{
+ static base::Thread* dbThread = NULL;
+ if (dbThread && dbThread->IsRunning())
+ return dbThread;
- if (!db_thread)
- db_thread = new base::Thread("db");
+ if (!dbThread)
+ dbThread = new base::Thread("db");
- if (!db_thread)
+ if (!dbThread)
return NULL;
base::Thread::Options options;
options.message_loop_type = MessageLoop::TYPE_DEFAULT;
- if (!db_thread->StartWithOptions(options)) {
- delete db_thread;
- db_thread = NULL;
+ if (!dbThread->StartWithOptions(options)) {
+ delete dbThread;
+ dbThread = NULL;
}
- return db_thread;
+ return dbThread;
}
#endif