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

Unified Diff: content/browser/in_process_webkit/indexed_db_browsertest.cc

Issue 10919137: SupportsUserData is not thread safe (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed indexeddb test Created 8 years, 3 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
Index: content/browser/in_process_webkit/indexed_db_browsertest.cc
diff --git a/content/browser/in_process_webkit/indexed_db_browsertest.cc b/content/browser/in_process_webkit/indexed_db_browsertest.cc
index 61260876ebfbba2e4ec97d046871a911494e6e78..71a50f57f8e46d6d40bab6c1e3eee940b2fe475c 100644
--- a/content/browser/in_process_webkit/indexed_db_browsertest.cc
+++ b/content/browser/in_process_webkit/indexed_db_browsertest.cc
@@ -193,25 +193,28 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed,
class IndexedDBBrowserTestWithVersion0Schema : public IndexedDBBrowserTest {
public:
virtual void SetUpOnMainThread() {
+ scoped_refptr<IndexedDBContext> context =
+ BrowserContext::GetIndexedDBContext(
+ shell()->web_contents()->GetBrowserContext());
BrowserThread::PostTask(
BrowserThread::WEBKIT_DEPRECATED, FROM_HERE,
base::Bind(
&IndexedDBBrowserTestWithVersion0Schema::CopyLevelDBToProfile,
- shell()));
+ shell(),
+ context));
scoped_refptr<base::ThreadTestHelper> helper(
new base::ThreadTestHelper(BrowserThread::GetMessageLoopProxyForThread(
BrowserThread::WEBKIT_DEPRECATED)));
ASSERT_TRUE(helper->Run());
}
- static void CopyLevelDBToProfile(Shell* shell) {
+ static void CopyLevelDBToProfile(Shell* shell,
+ scoped_refptr<IndexedDBContext> context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
FilePath leveldb_dir(FILE_PATH_LITERAL("file__0.indexeddb.leveldb"));
FilePath test_data_dir =
GetTestFilePath("indexeddb", "migration_from_0").Append(leveldb_dir);
- IndexedDBContext* context = BrowserContext::GetIndexedDBContext(
- shell->web_contents()->GetBrowserContext());
IndexedDBContextImpl* context_impl =
- static_cast<IndexedDBContextImpl*>(context);
+ static_cast<IndexedDBContextImpl*>(context.get());
FilePath dest = context_impl->data_path().Append(leveldb_dir);
// If we don't create the destination directory first, the contents of the
// leveldb directory are copied directly into profile/IndexedDB instead of

Powered by Google App Engine
This is Rietveld 408576698