diff options
-rw-r--r-- | chrome/browser/browsing_data_appcache_helper.cc | 12 | ||||
-rw-r--r-- | chrome/browser/browsing_data_appcache_helper.h | 7 | ||||
-rw-r--r-- | chrome/browser/browsing_data_database_helper.cc | 14 | ||||
-rw-r--r-- | chrome/browser/browsing_data_database_helper.h | 7 | ||||
-rw-r--r-- | chrome/browser/browsing_data_indexed_db_helper.cc | 11 | ||||
-rw-r--r-- | chrome/browser/browsing_data_indexed_db_helper.h | 5 | ||||
-rw-r--r-- | chrome/browser/browsing_data_local_storage_helper.cc | 15 | ||||
-rw-r--r-- | chrome/browser/browsing_data_local_storage_helper.h | 7 | ||||
-rw-r--r-- | chrome/browser/collected_cookies_uitest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_specific_content_settings.cc | 10 |
10 files changed, 82 insertions, 12 deletions
diff --git a/chrome/browser/browsing_data_appcache_helper.cc b/chrome/browser/browsing_data_appcache_helper.cc index 7cd83c9..6a7e8ee 100644 --- a/chrome/browser/browsing_data_appcache_helper.cc +++ b/chrome/browser/browsing_data_appcache_helper.cc @@ -103,10 +103,20 @@ ChromeAppCacheService* BrowsingDataAppCacheHelper::GetAppCacheService() { CannedBrowsingDataAppCacheHelper::CannedBrowsingDataAppCacheHelper( Profile* profile) - : BrowsingDataAppCacheHelper(profile) { + : BrowsingDataAppCacheHelper(profile), + profile_(profile) { info_collection_ = new appcache::AppCacheInfoCollection; } +CannedBrowsingDataAppCacheHelper* CannedBrowsingDataAppCacheHelper::Clone() { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + CannedBrowsingDataAppCacheHelper* clone = + new CannedBrowsingDataAppCacheHelper(profile_); + + clone->info_collection_->infos_by_origin = info_collection_->infos_by_origin; + return clone; +} + void CannedBrowsingDataAppCacheHelper::AddAppCache(const GURL& manifest_url) { typedef std::map<GURL, appcache::AppCacheInfoVector> InfoByOrigin; InfoByOrigin& origin_map = info_collection_->infos_by_origin; diff --git a/chrome/browser/browsing_data_appcache_helper.h b/chrome/browser/browsing_data_appcache_helper.h index 38eaed4..b66b9d2 100644 --- a/chrome/browser/browsing_data_appcache_helper.h +++ b/chrome/browser/browsing_data_appcache_helper.h @@ -56,6 +56,11 @@ class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { public: explicit CannedBrowsingDataAppCacheHelper(Profile* profile); + // Return a copy of the appcache helper. Only one consumer can use the + // StartFetching method at a time, so we need to create a copy of the helper + // everytime we instantiate a cookies tree model for it. + CannedBrowsingDataAppCacheHelper* Clone(); + // Add an appcache to the set of canned caches that is returned by this // helper. void AddAppCache(const GURL& manifest_url); @@ -73,6 +78,8 @@ class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { private: virtual ~CannedBrowsingDataAppCacheHelper(); + Profile* profile_; + DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); }; diff --git a/chrome/browser/browsing_data_database_helper.cc b/chrome/browser/browsing_data_database_helper.cc index 68d1bbc..1486b5a 100644 --- a/chrome/browser/browsing_data_database_helper.cc +++ b/chrome/browser/browsing_data_database_helper.cc @@ -157,7 +157,19 @@ CannedBrowsingDataDatabaseHelper::PendingDatabaseInfo::~PendingDatabaseInfo() {} CannedBrowsingDataDatabaseHelper::CannedBrowsingDataDatabaseHelper( Profile* profile) - : BrowsingDataDatabaseHelper(profile) { + : BrowsingDataDatabaseHelper(profile), + profile_(profile) { +} + +CannedBrowsingDataDatabaseHelper* CannedBrowsingDataDatabaseHelper::Clone() { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + CannedBrowsingDataDatabaseHelper* clone = + new CannedBrowsingDataDatabaseHelper(profile_); + + base::AutoLock auto_lock(lock_); + clone->pending_database_info_ = pending_database_info_; + clone->database_info_ = database_info_; + return clone; } void CannedBrowsingDataDatabaseHelper::AddDatabase( diff --git a/chrome/browser/browsing_data_database_helper.h b/chrome/browser/browsing_data_database_helper.h index 2d870ee1..ac59f85 100644 --- a/chrome/browser/browsing_data_database_helper.h +++ b/chrome/browser/browsing_data_database_helper.h @@ -109,6 +109,11 @@ class CannedBrowsingDataDatabaseHelper : public BrowsingDataDatabaseHelper { public: explicit CannedBrowsingDataDatabaseHelper(Profile* profile); + // Return a copy of the database helper. Only one consumer can use the + // StartFetching method at a time, so we need to create a copy of the helper + // everytime we instantiate a cookies tree model for it. + CannedBrowsingDataDatabaseHelper* Clone(); + // Add a database to the set of canned databases that is returned by this // helper. void AddDatabase(const GURL& origin, @@ -150,6 +155,8 @@ class CannedBrowsingDataDatabaseHelper : public BrowsingDataDatabaseHelper { // This may mutate on WEBKIT and UI threads. std::vector<PendingDatabaseInfo> pending_database_info_; + Profile* profile_; + DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataDatabaseHelper); }; diff --git a/chrome/browser/browsing_data_indexed_db_helper.cc b/chrome/browser/browsing_data_indexed_db_helper.cc index 0a03bf2..cea41cf 100644 --- a/chrome/browser/browsing_data_indexed_db_helper.cc +++ b/chrome/browser/browsing_data_indexed_db_helper.cc @@ -208,6 +208,17 @@ CannedBrowsingDataIndexedDBHelper::CannedBrowsingDataIndexedDBHelper( DCHECK(profile); } +CannedBrowsingDataIndexedDBHelper* CannedBrowsingDataIndexedDBHelper::Clone() { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + CannedBrowsingDataIndexedDBHelper* clone = + new CannedBrowsingDataIndexedDBHelper(profile_); + + base::AutoLock auto_lock(lock_); + clone->pending_indexed_db_info_ = pending_indexed_db_info_; + clone->indexed_db_info_ = indexed_db_info_; + return clone; +} + void CannedBrowsingDataIndexedDBHelper::AddIndexedDB( const GURL& origin, const string16& description) { base::AutoLock auto_lock(lock_); diff --git a/chrome/browser/browsing_data_indexed_db_helper.h b/chrome/browser/browsing_data_indexed_db_helper.h index e0f25b6..fa49d583 100644 --- a/chrome/browser/browsing_data_indexed_db_helper.h +++ b/chrome/browser/browsing_data_indexed_db_helper.h @@ -85,6 +85,11 @@ class CannedBrowsingDataIndexedDBHelper public: explicit CannedBrowsingDataIndexedDBHelper(Profile* profile); + // Return a copy of the IndexedDB helper. Only one consumer can use the + // StartFetching method at a time, so we need to create a copy of the helper + // everytime we instantiate a cookies tree model for it. + CannedBrowsingDataIndexedDBHelper* Clone(); + // Add a indexed database to the set of canned indexed databases that is // returned by this helper. void AddIndexedDB(const GURL& origin, diff --git a/chrome/browser/browsing_data_local_storage_helper.cc b/chrome/browser/browsing_data_local_storage_helper.cc index 5ce2d8c..53fef02 100644 --- a/chrome/browser/browsing_data_local_storage_helper.cc +++ b/chrome/browser/browsing_data_local_storage_helper.cc @@ -147,7 +147,20 @@ void BrowsingDataLocalStorageHelper::DeleteLocalStorageFileInWebKitThread( CannedBrowsingDataLocalStorageHelper::CannedBrowsingDataLocalStorageHelper( Profile* profile) - : BrowsingDataLocalStorageHelper(profile) { + : BrowsingDataLocalStorageHelper(profile), + profile_(profile) { +} + +CannedBrowsingDataLocalStorageHelper* +CannedBrowsingDataLocalStorageHelper::Clone() { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + CannedBrowsingDataLocalStorageHelper* clone = + new CannedBrowsingDataLocalStorageHelper(profile_); + + base::AutoLock auto_lock(lock_); + clone->pending_local_storage_info_ = pending_local_storage_info_; + clone->local_storage_info_ = local_storage_info_; + return clone; } void CannedBrowsingDataLocalStorageHelper::AddLocalStorage( diff --git a/chrome/browser/browsing_data_local_storage_helper.h b/chrome/browser/browsing_data_local_storage_helper.h index e1db472..80dbc04 100644 --- a/chrome/browser/browsing_data_local_storage_helper.h +++ b/chrome/browser/browsing_data_local_storage_helper.h @@ -110,6 +110,11 @@ class CannedBrowsingDataLocalStorageHelper public: explicit CannedBrowsingDataLocalStorageHelper(Profile* profile); + // Return a copy of the local storage helper. Only one consumer can use the + // StartFetching method at a time, so we need to create a copy of the helper + // everytime we instantiate a cookies tree model for it. + CannedBrowsingDataLocalStorageHelper* Clone(); + // Add a local storage to the set of canned local storages that is returned // by this helper. void AddLocalStorage(const GURL& origin); @@ -137,6 +142,8 @@ class CannedBrowsingDataLocalStorageHelper // May mutate on WEBKIT and UI threads. std::vector<GURL> pending_local_storage_info_; + Profile* profile_; + DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataLocalStorageHelper); }; diff --git a/chrome/browser/collected_cookies_uitest.cc b/chrome/browser/collected_cookies_uitest.cc index ce60e04..5b2f597 100644 --- a/chrome/browser/collected_cookies_uitest.cc +++ b/chrome/browser/collected_cookies_uitest.cc @@ -20,8 +20,7 @@ const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); typedef UITest CollectedCookiesTest; -// Flaky, http://crbug.com/62311. -TEST_F(CollectedCookiesTest, FLAKY_DoubleDisplay) { +TEST_F(CollectedCookiesTest, DoubleDisplay) { net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); @@ -43,8 +42,7 @@ TEST_F(CollectedCookiesTest, FLAKY_DoubleDisplay) { ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); } -// Flaky, http://crbug.com/62311. -TEST_F(CollectedCookiesTest, FLAKY_NavigateAway) { +TEST_F(CollectedCookiesTest, NavigateAway) { net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); diff --git a/chrome/browser/tab_contents/tab_specific_content_settings.cc b/chrome/browser/tab_contents/tab_specific_content_settings.cc index 8fe5240..6e72e31 100644 --- a/chrome/browser/tab_contents/tab_specific_content_settings.cc +++ b/chrome/browser/tab_contents/tab_specific_content_settings.cc @@ -316,9 +316,9 @@ void TabSpecificContentSettings::LocalSharedObjectsContainer::Reset() { CookiesTreeModel* TabSpecificContentSettings::LocalSharedObjectsContainer::GetCookiesTreeModel() { return new CookiesTreeModel(cookies_, - databases_, - local_storages_, - session_storages_, - appcaches_, - indexed_dbs_); + databases_->Clone(), + local_storages_->Clone(), + session_storages_->Clone(), + appcaches_->Clone(), + indexed_dbs_->Clone()); } |