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

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

Issue 9419033: Move creation of BrowserContext objects that live in content to content, instead of depending on th… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix memory leaks in tests Created 8 years, 10 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
===================================================================
--- content/browser/in_process_webkit/indexed_db_browsertest.cc (revision 122721)
+++ content/browser/in_process_webkit/indexed_db_browsertest.cc (working copy)
@@ -23,6 +23,7 @@
#include "webkit/quota/quota_manager.h"
#include "webkit/quota/special_storage_policy.h"
+using content::BrowserContext;
using content::BrowserThread;
using quota::QuotaManager;
using webkit_database::DatabaseUtil;
@@ -153,7 +154,7 @@
// Create some indexedDB paths.
// With the levelDB backend, these are directories.
- WebKitContext *webkit_context = profile.GetWebKitContext();
+ WebKitContext* webkit_context = BrowserContext::GetWebKitContext(&profile);
IndexedDBContext* idb_context = webkit_context->indexed_db_context();
idb_context->set_data_path_for_testing(temp_dir.path());
protected_path = idb_context->GetIndexedDBFilePath(
@@ -168,11 +169,15 @@
}
// Make sure we wait until the destructor has run.
- scoped_refptr<base::ThreadTestHelper> helper(
+ scoped_refptr<base::ThreadTestHelper> helper_io(
new base::ThreadTestHelper(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
+ ASSERT_TRUE(helper_io->Run());
+ scoped_refptr<base::ThreadTestHelper> helper_webkit(
+ new base::ThreadTestHelper(
BrowserThread::GetMessageLoopProxyForThread(
BrowserThread::WEBKIT_DEPRECATED)));
- ASSERT_TRUE(helper->Run());
+ ASSERT_TRUE(helper_webkit->Run());
ASSERT_TRUE(file_util::DirectoryExists(protected_path));
ASSERT_FALSE(file_util::DirectoryExists(unprotected_path));
@@ -200,7 +205,7 @@
// Create some indexedDB paths.
// With the levelDB backend, these are directories.
- WebKitContext *webkit_context = profile.GetWebKitContext();
+ WebKitContext* webkit_context = BrowserContext::GetWebKitContext(&profile);
IndexedDBContext* idb_context = webkit_context->indexed_db_context();
// Override the storage policy with our own.
@@ -215,12 +220,15 @@
ASSERT_TRUE(file_util::CreateDirectory(session_only_path));
}
- // Make sure we wait until the destructor has run.
- scoped_refptr<base::ThreadTestHelper> helper(
+ scoped_refptr<base::ThreadTestHelper> helper_io(
new base::ThreadTestHelper(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
+ ASSERT_TRUE(helper_io->Run());
+ scoped_refptr<base::ThreadTestHelper> helper_webkit(
+ new base::ThreadTestHelper(
BrowserThread::GetMessageLoopProxyForThread(
BrowserThread::WEBKIT_DEPRECATED)));
- ASSERT_TRUE(helper->Run());
+ ASSERT_TRUE(helper_webkit->Run());
EXPECT_TRUE(file_util::DirectoryExists(normal_path));
EXPECT_FALSE(file_util::DirectoryExists(session_only_path));
@@ -246,7 +254,7 @@
// Create some indexedDB paths.
// With the levelDB backend, these are directories.
- WebKitContext *webkit_context = profile.GetWebKitContext();
+ WebKitContext* webkit_context = BrowserContext::GetWebKitContext(&profile);
IndexedDBContext* idb_context = webkit_context->indexed_db_context();
// Override the storage policy with our own.
@@ -284,7 +292,8 @@
const int kTemporaryStorageQuotaMaxSize = kInitialQuotaKilobytes
* 1024 * QuotaManager::kPerHostTemporaryPortion;
SetTempQuota(
- kTemporaryStorageQuotaMaxSize, browser()->profile()->GetQuotaManager());
+ kTemporaryStorageQuotaMaxSize,
+ content::BrowserContext::GetQuotaManager(browser()->profile()));
}
static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) {

Powered by Google App Engine
This is Rietveld 408576698