diff options
9 files changed, 20 insertions, 18 deletions
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index b3d1028..a1a085c 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -345,7 +345,7 @@ class ExtensionTestingProfile : public TestingProfile { NewRunnableMethod( appcache_service_.get(), &ChromeAppCacheService::InitializeOnIOThread, - GetPath(), IsOffTheRecord(), + IsOffTheRecord() ? FilePath() : GetPath(), make_scoped_refptr(GetHostContentSettingsMap()), make_scoped_refptr(GetExtensionSpecialStoragePolicy()), false)); diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc index 28edd4a..47fc9f8 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc @@ -241,7 +241,7 @@ class OffTheRecordProfileImpl : public Profile, NewRunnableMethod( appcache_service_.get(), &ChromeAppCacheService::InitializeOnIOThread, - GetPath(), IsOffTheRecord(), + IsOffTheRecord() ? FilePath() : GetPath(), make_scoped_refptr(GetHostContentSettingsMap()), make_scoped_refptr(GetExtensionSpecialStoragePolicy()), false)); diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 00a1141..0726777 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -651,7 +651,7 @@ ChromeAppCacheService* ProfileImpl::GetAppCacheService() { NewRunnableMethod( appcache_service_.get(), &ChromeAppCacheService::InitializeOnIOThread, - GetPath(), IsOffTheRecord(), + IsOffTheRecord() ? FilePath() : GetPath(), make_scoped_refptr(GetHostContentSettingsMap()), make_scoped_refptr(GetExtensionSpecialStoragePolicy()), clear_local_state_on_exit_)); diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index df9bd4f..30dcbf2 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -475,7 +475,9 @@ void BrowserRenderProcessHost::CreateMessageFilters() { channel_->AddFilter( new DOMStorageMessageFilter(id(), profile()->GetWebKitContext(), profile()->GetHostContentSettingsMap())); - channel_->AddFilter(new IndexedDBDispatcherHost(id(), profile())); + channel_->AddFilter( + new IndexedDBDispatcherHost(id(), profile()->GetWebKitContext(), + profile()->GetHostContentSettingsMap())); channel_->AddFilter( GeolocationDispatcherHost::New( id(), profile()->GetGeolocationPermissionContext())); diff --git a/content/browser/appcache/chrome_appcache_service.cc b/content/browser/appcache/chrome_appcache_service.cc index 132037f..0e8a0f0 100644 --- a/content/browser/appcache/chrome_appcache_service.cc +++ b/content/browser/appcache/chrome_appcache_service.cc @@ -6,7 +6,6 @@ #include "base/file_path.h" #include "base/file_util.h" -#include "chrome/common/chrome_constants.h" #include "content/common/notification_service.h" #include "net/base/net_errors.h" #include "webkit/appcache/appcache_thread.h" @@ -34,7 +33,7 @@ ChromeAppCacheService::ChromeAppCacheService() } void ChromeAppCacheService::InitializeOnIOThread( - const FilePath& profile_path, bool is_incognito, + const FilePath& cache_path, scoped_refptr<HostContentSettingsMap> content_settings_map, scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy, bool clear_local_state_on_exit) { @@ -45,12 +44,11 @@ void ChromeAppCacheService::InitializeOnIOThread( appcache::AppCacheThread::Init(BrowserThread::DB, BrowserThread::IO); } + cache_path_ = cache_path; host_contents_settings_map_ = content_settings_map; registrar_.Add( this, NotificationType::PURGE_MEMORY, NotificationService::AllSources()); SetClearLocalStateOnExit(clear_local_state_on_exit); - if (!is_incognito) - cache_path_ = profile_path.Append(chrome::kAppCacheDirname); // Init our base class. Initialize(cache_path_, diff --git a/content/browser/appcache/chrome_appcache_service.h b/content/browser/appcache/chrome_appcache_service.h index 3308d84..8314e48 100644 --- a/content/browser/appcache/chrome_appcache_service.h +++ b/content/browser/appcache/chrome_appcache_service.h @@ -35,7 +35,7 @@ class ChromeAppCacheService ChromeAppCacheService(); void InitializeOnIOThread( - const FilePath& profile_path, bool is_incognito, + const FilePath& cache_path, // may be empty to use in-memory structures scoped_refptr<HostContentSettingsMap> content_settings_map, scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy, bool clear_local_state_on_exit); diff --git a/content/browser/appcache/chrome_appcache_service_unittest.cc b/content/browser/appcache/chrome_appcache_service_unittest.cc index a327659..3e4a975 100644 --- a/content/browser/appcache/chrome_appcache_service_unittest.cc +++ b/content/browser/appcache/chrome_appcache_service_unittest.cc @@ -47,7 +47,7 @@ TEST_F(ChromeAppCacheServiceTest, KeepOnDestruction) { BrowserThread::IO, FROM_HERE, NewRunnableMethod(appcache_service.get(), &ChromeAppCacheService::InitializeOnIOThread, - temp_dir_.path(), false, + appcache_path, scoped_refptr<HostContentSettingsMap>(NULL), scoped_refptr<quota::SpecialStoragePolicy>(NULL), false)); @@ -78,7 +78,7 @@ TEST_F(ChromeAppCacheServiceTest, RemoveOnDestruction) { BrowserThread::IO, FROM_HERE, NewRunnableMethod(appcache_service.get(), &ChromeAppCacheService::InitializeOnIOThread, - temp_dir_.path(), false, + appcache_path, scoped_refptr<HostContentSettingsMap>(NULL), scoped_refptr<quota::SpecialStoragePolicy>(NULL), true)); diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc index 2f50f6d..b0305d7 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -8,7 +8,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/metrics/user_metrics.h" -#include "chrome/browser/profiles/profile.h" #include "content/browser/browser_thread.h" #include "content/browser/in_process_webkit/indexed_db_callbacks.h" #include "content/browser/in_process_webkit/indexed_db_database_callbacks.h" @@ -61,10 +60,11 @@ void DeleteOnWebKitThread(T* obj) { } -IndexedDBDispatcherHost::IndexedDBDispatcherHost(int process_id, - Profile* profile) - : webkit_context_(profile->GetWebKitContext()), - host_content_settings_map_(profile->GetHostContentSettingsMap()), +IndexedDBDispatcherHost::IndexedDBDispatcherHost( + int process_id, WebKitContext* webkit_context, + HostContentSettingsMap* host_content_settings_map) + : webkit_context_(webkit_context), + host_content_settings_map_(host_content_settings_map), ALLOW_THIS_IN_INITIALIZER_LIST(database_dispatcher_host_( new DatabaseDispatcherHost(this))), ALLOW_THIS_IN_INITIALIZER_LIST(index_dispatcher_host_( diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.h b/content/browser/in_process_webkit/indexed_db_dispatcher_host.h index f8dd3ce..da7869b 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.h +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -37,7 +37,9 @@ class WebIDBTransaction; class IndexedDBDispatcherHost : public BrowserMessageFilter { public: // Only call the constructor from the UI thread. - IndexedDBDispatcherHost(int process_id, Profile* profile); + IndexedDBDispatcherHost( + int process_id, WebKitContext* webkit_context, + HostContentSettingsMap* host_content_settings_map); // BrowserMessageFilter implementation. virtual void OnChannelClosing(); |