From 36871a877257fe861e4a31c5f4b81693ee2dd027 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Thu, 13 Oct 2011 13:49:12 -0700 Subject: Causing webviews to hang. Revert "Fix SQLitePersistentCookieStore's getDbThread() to be threadsafe" This reverts commit 47f5154a4217fb3626326224fc1c7d3c9918dd09 --- .../browser/net/sqlite_persistent_cookie_store.cc | 33 ++++++++-------------- 1 file 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 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 -- cgit v1.1