diff options
8 files changed, 21 insertions, 17 deletions
diff --git a/chrome/browser/browsing_data/browsing_data_database_helper.cc b/chrome/browser/browsing_data/browsing_data_database_helper.cc index 32b7c51..21708eb 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper.cc @@ -12,6 +12,7 @@ #include "chrome/browser/browsing_data/browsing_data_helper.h" #include "chrome/browser/profiles/profile.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/storage_partition.h" #include "net/base/completion_callback.h" #include "net/base/net_errors.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h" @@ -43,7 +44,8 @@ BrowsingDataDatabaseHelper::DatabaseInfo::~DatabaseInfo() {} BrowsingDataDatabaseHelper::BrowsingDataDatabaseHelper(Profile* profile) : is_fetching_(false), - tracker_(BrowserContext::GetDatabaseTracker(profile)) { + tracker_(BrowserContext:: + GetDefaultStoragePartition(profile)->GetDatabaseTracker()) { } BrowsingDataDatabaseHelper::~BrowsingDataDatabaseHelper() { diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc index d9ecb91..c7b1dd3 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc @@ -12,6 +12,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" +#include "content/public/browser/storage_partition.h" #include "content/public/test/test_browser_thread.h" using content::BrowserContext; @@ -30,7 +31,8 @@ class BrowsingDataDatabaseHelperTest : public InProcessBrowserTest { public: virtual void CreateDatabases() { webkit_database::DatabaseTracker* db_tracker = - BrowserContext::GetDatabaseTracker(browser()->profile()); + BrowserContext::GetDefaultStoragePartition(browser()->profile())-> + GetDatabaseTracker(); string16 db_name = ASCIIToUTF16("db"); string16 description = ASCIIToUTF16("db_description"); int64 size; diff --git a/chrome/browser/extensions/data_deleter.cc b/chrome/browser/extensions/data_deleter.cc index 0abe1e0..92d0d3a 100644 --- a/chrome/browser/extensions/data_deleter.cc +++ b/chrome/browser/extensions/data_deleter.cc @@ -81,7 +81,10 @@ DataDeleter::DataDeleter( const GURL& storage_origin, bool is_storage_isolated) : extension_id_(extension_id) { - database_tracker_ = BrowserContext::GetDatabaseTracker(profile); + // TODO(michaeln): Delete from the right StoragePartition. + // http://crbug.com/85127 + database_tracker_ = BrowserContext::GetDefaultStoragePartition(profile)-> + GetDatabaseTracker(); // Pick the right request context depending on whether it's an extension, // isolated app, or regular app. if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 06ba129..7d5682e 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -74,6 +74,7 @@ #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/plugin_service.h" +#include "content/public/browser/storage_partition.h" #include "content/public/common/content_constants.h" #include "content/public/test/test_browser_thread.h" #include "googleurl/src/gurl.h" @@ -3427,7 +3428,8 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { // Open a database. webkit_database::DatabaseTracker* db_tracker = - BrowserContext::GetDatabaseTracker(profile_.get()); + BrowserContext::GetDefaultStoragePartition(profile_.get())-> + GetDatabaseTracker(); string16 db_name = UTF8ToUTF16("db"); string16 description = UTF8ToUTF16("db_description"); int64 size; @@ -3538,7 +3540,8 @@ TEST_F(ExtensionServiceTest, ClearAppData) { // Open a database. webkit_database::DatabaseTracker* db_tracker = - BrowserContext::GetDatabaseTracker(profile_.get()); + BrowserContext::GetDefaultStoragePartition(profile_.get())-> + GetDatabaseTracker(); string16 db_name = UTF8ToUTF16("db"); string16 description = UTF8ToUTF16("db_description"); int64 size; diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc index 79cc086..3341284 100644 --- a/content/browser/browser_context.cc +++ b/content/browser/browser_context.cc @@ -109,13 +109,6 @@ IndexedDBContext* BrowserContext::GetIndexedDBContext( return GetDefaultStoragePartition(browser_context)->GetIndexedDBContext(); } -webkit_database::DatabaseTracker* BrowserContext::GetDatabaseTracker( - BrowserContext* browser_context) { - // TODO(ajwong): Change this API to require a SiteInstance instead of - // using GetDefaultStoragePartition(). - return GetDefaultStoragePartition(browser_context)->GetDatabaseTracker(); -} - appcache::AppCacheService* BrowserContext::GetAppCacheService( BrowserContext* browser_context) { // TODO(ajwong): Change this API to require a SiteInstance instead of @@ -176,7 +169,8 @@ void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) { } void BrowserContext::SaveSessionState(BrowserContext* browser_context) { - GetDatabaseTracker(browser_context)->SetForceKeepSessionState(); + GetDefaultStoragePartition(browser_context)->GetDatabaseTracker()-> + SetForceKeepSessionState(); if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { BrowserThread::PostTask( diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 61b813a..48c0cf4 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -578,7 +578,7 @@ void RenderProcessHostImpl::CreateMessageFilters() { channel_->AddFilter(new FileUtilitiesMessageFilter(GetID())); channel_->AddFilter(new MimeRegistryMessageFilter()); channel_->AddFilter(new DatabaseMessageFilter( - BrowserContext::GetDatabaseTracker(browser_context))); + storage_partition_impl_->GetDatabaseTracker())); #if defined(OS_MACOSX) channel_->AddFilter(new TextInputClientMessageFilter(GetID())); #elif defined(OS_WIN) diff --git a/content/browser/resource_context_impl.cc b/content/browser/resource_context_impl.cc index e59692f..4fd0393 100644 --- a/content/browser/resource_context_impl.cc +++ b/content/browser/resource_context_impl.cc @@ -18,6 +18,7 @@ #include "content/browser/tcmalloc_internals_request_job.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/storage_partition.h" #include "content/public/common/url_constants.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" @@ -259,7 +260,8 @@ void InitializeResourceContext(BrowserContext* browser_context) { resource_context->SetUserData( kDatabaseTrackerKeyName, new UserDataAdapter<webkit_database::DatabaseTracker>( - BrowserContext::GetDatabaseTracker(browser_context))); + BrowserContext::GetDefaultStoragePartition(browser_context)-> + GetDatabaseTracker())); resource_context->SetUserData( kAppCacheServiceKeyName, new UserDataAdapter<ChromeAppCacheService>( diff --git a/content/public/browser/browser_context.h b/content/public/browser/browser_context.h index d87881b..06fb8fe 100644 --- a/content/public/browser/browser_context.h +++ b/content/public/browser/browser_context.h @@ -56,8 +56,6 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { static DownloadManager* GetDownloadManager(BrowserContext* browser_context); static IndexedDBContext* GetIndexedDBContext(BrowserContext* browser_context); - static webkit_database::DatabaseTracker* GetDatabaseTracker( - BrowserContext* browser_context); static appcache::AppCacheService* GetAppCacheService( BrowserContext* browser_context); static fileapi::FileSystemContext* GetFileSystemContext( |