diff options
author | Chris Craik <ccraik@google.com> | 2011-10-13 13:49:12 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-13 13:49:12 -0700 |
commit | 36871a877257fe861e4a31c5f4b81693ee2dd027 (patch) | |
tree | 2f8d4f486aad09345a6d4d18ee5d773b7117d559 /chrome | |
parent | 47f5154a4217fb3626326224fc1c7d3c9918dd09 (diff) | |
download | external_chromium-36871a877257fe861e4a31c5f4b81693ee2dd027.zip external_chromium-36871a877257fe861e4a31c5f4b81693ee2dd027.tar.gz external_chromium-36871a877257fe861e4a31c5f4b81693ee2dd027.tar.bz2 |
Causing webviews to hang.
Revert "Fix SQLitePersistentCookieStore's getDbThread() to be threadsafe"
This reverts commit 47f5154a4217fb3626326224fc1c7d3c9918dd09
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/net/sqlite_persistent_cookie_store.cc | 33 |
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 |