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

Unified Diff: webkit/appcache/mock_appcache_storage_unittest.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 2 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
« no previous file with comments | « webkit/appcache/appcache_url_request_job_unittest.cc ('k') | webkit/blob/blob_url_request_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/mock_appcache_storage_unittest.cc
diff --git a/webkit/appcache/mock_appcache_storage_unittest.cc b/webkit/appcache/mock_appcache_storage_unittest.cc
index 3ac85430449a3591b310b075dc487a84f98c6df7..8acea8a215a17cb6960d3c6526d981dd14437775 100644
--- a/webkit/appcache/mock_appcache_storage_unittest.cc
+++ b/webkit/appcache/mock_appcache_storage_unittest.cc
@@ -168,9 +168,9 @@ TEST_F(MockAppCacheStorageTest, LoadGroupAndCache_FarHit) {
int64 cache_id = storage->NewCacheId();
scoped_refptr<AppCache> cache(new AppCache(&service, cache_id));
cache->set_complete(true);
- group->AddCache(cache);
- storage->AddStoredGroup(group);
- storage->AddStoredCache(cache);
+ group->AddCache(cache.get());
+ storage->AddStoredGroup(group.get());
+ storage->AddStoredCache(cache.get());
// Drop the references from above so the only refs to these
// objects are from within the storage class. This is to make
@@ -225,7 +225,7 @@ TEST_F(MockAppCacheStorageTest, StoreNewGroup) {
MockStorageDelegate delegate;
EXPECT_TRUE(storage->stored_caches_.empty());
EXPECT_TRUE(storage->stored_groups_.empty());
- storage->StoreGroupAndNewestCache(group, cache, &delegate);
+ storage->StoreGroupAndNewestCache(group.get(), cache.get(), &delegate);
EXPECT_FALSE(delegate.stored_group_success_);
EXPECT_TRUE(storage->stored_caches_.empty());
EXPECT_TRUE(storage->stored_groups_.empty());
@@ -251,9 +251,9 @@ TEST_F(MockAppCacheStorageTest, StoreExistingGroup) {
int64 old_cache_id = storage->NewCacheId();
scoped_refptr<AppCache> old_cache(new AppCache(&service, old_cache_id));
old_cache->set_complete(true);
- group->AddCache(old_cache);
- storage->AddStoredGroup(group);
- storage->AddStoredCache(old_cache);
+ group->AddCache(old_cache.get());
+ storage->AddStoredGroup(group.get());
+ storage->AddStoredCache(old_cache.get());
int64 new_cache_id = storage->NewCacheId();
scoped_refptr<AppCache> new_cache(new AppCache(&service, new_cache_id));
// Hold our refs to simulate the UpdateJob holding these refs.
@@ -262,20 +262,20 @@ TEST_F(MockAppCacheStorageTest, StoreExistingGroup) {
MockStorageDelegate delegate;
EXPECT_EQ(size_t(1), storage->stored_caches_.size());
EXPECT_EQ(size_t(1), storage->stored_groups_.size());
- EXPECT_TRUE(storage->IsCacheStored(old_cache));
- EXPECT_FALSE(storage->IsCacheStored(new_cache));
- storage->StoreGroupAndNewestCache(group, new_cache, &delegate);
+ EXPECT_TRUE(storage->IsCacheStored(old_cache.get()));
+ EXPECT_FALSE(storage->IsCacheStored(new_cache.get()));
+ storage->StoreGroupAndNewestCache(group.get(), new_cache.get(), &delegate);
EXPECT_FALSE(delegate.stored_group_success_);
EXPECT_EQ(size_t(1), storage->stored_caches_.size());
EXPECT_EQ(size_t(1), storage->stored_groups_.size());
- EXPECT_TRUE(storage->IsCacheStored(old_cache));
- EXPECT_FALSE(storage->IsCacheStored(new_cache));
+ EXPECT_TRUE(storage->IsCacheStored(old_cache.get()));
+ EXPECT_FALSE(storage->IsCacheStored(new_cache.get()));
MessageLoop::current()->RunAllPending(); // Do async task execution.
EXPECT_TRUE(delegate.stored_group_success_);
EXPECT_EQ(size_t(1), storage->stored_caches_.size());
EXPECT_EQ(size_t(1), storage->stored_groups_.size());
- EXPECT_FALSE(storage->IsCacheStored(old_cache));
- EXPECT_TRUE(storage->IsCacheStored(new_cache));
+ EXPECT_FALSE(storage->IsCacheStored(old_cache.get()));
+ EXPECT_TRUE(storage->IsCacheStored(new_cache.get()));
EXPECT_EQ(new_cache.get(), group->newest_complete_cache());
EXPECT_TRUE(new_cache->is_complete());
}
@@ -294,9 +294,9 @@ TEST_F(MockAppCacheStorageTest, StoreExistingGroupExistingCache) {
int64 cache_id = storage->NewCacheId();
scoped_refptr<AppCache> cache(new AppCache(&service, cache_id));
cache->set_complete(true);
- group->AddCache(cache);
- storage->AddStoredGroup(group);
- storage->AddStoredCache(cache);
+ group->AddCache(cache.get());
+ storage->AddStoredGroup(group.get());
+ storage->AddStoredCache(cache.get());
// Hold our refs to simulate the UpdateJob holding these refs.
// Change the group's newest cache.
@@ -308,8 +308,8 @@ TEST_F(MockAppCacheStorageTest, StoreExistingGroupExistingCache) {
MockStorageDelegate delegate;
EXPECT_EQ(size_t(1), storage->stored_caches_.size());
EXPECT_EQ(size_t(1), storage->stored_groups_.size());
- EXPECT_TRUE(storage->IsCacheStored(cache));
- storage->StoreGroupAndNewestCache(group, cache, &delegate);
+ EXPECT_TRUE(storage->IsCacheStored(cache.get()));
+ storage->StoreGroupAndNewestCache(group.get(), cache.get(), &delegate);
EXPECT_FALSE(delegate.stored_group_success_);
EXPECT_EQ(size_t(1), storage->stored_caches_.size());
EXPECT_EQ(size_t(1), storage->stored_groups_.size());
@@ -317,7 +317,7 @@ TEST_F(MockAppCacheStorageTest, StoreExistingGroupExistingCache) {
EXPECT_TRUE(delegate.stored_group_success_);
EXPECT_EQ(size_t(1), storage->stored_caches_.size());
EXPECT_EQ(size_t(1), storage->stored_groups_.size());
- EXPECT_TRUE(storage->IsCacheStored(cache));
+ EXPECT_TRUE(storage->IsCacheStored(cache.get()));
EXPECT_EQ(cache, group->newest_complete_cache());
EXPECT_TRUE(cache->GetEntry(entry_url));
}
@@ -336,9 +336,9 @@ TEST_F(MockAppCacheStorageTest, MakeGroupObsolete) {
int64 cache_id = storage->NewCacheId();
scoped_refptr<AppCache> cache(new AppCache(&service, cache_id));
cache->set_complete(true);
- group->AddCache(cache);
- storage->AddStoredGroup(group);
- storage->AddStoredCache(cache);
+ group->AddCache(cache.get());
+ storage->AddStoredGroup(group.get());
+ storage->AddStoredCache(cache.get());
// Hold our refs to simulate the UpdateJob holding these refs.
// Conduct the test.
@@ -348,7 +348,7 @@ TEST_F(MockAppCacheStorageTest, MakeGroupObsolete) {
EXPECT_EQ(size_t(1), storage->stored_groups_.size());
EXPECT_FALSE(cache->HasOneRef());
EXPECT_FALSE(group->HasOneRef());
- storage->MakeGroupObsolete(group, &delegate);
+ storage->MakeGroupObsolete(group.get(), &delegate);
EXPECT_FALSE(group->is_obsolete());
EXPECT_EQ(size_t(1), storage->stored_caches_.size());
EXPECT_EQ(size_t(1), storage->stored_groups_.size());
@@ -427,9 +427,9 @@ TEST_F(MockAppCacheStorageTest, BasicFindMainResponse) {
cache->set_complete(true);
scoped_refptr<AppCacheGroup> group(
new AppCacheGroup(&service, kManifestUrl, 111));
- group->AddCache(cache);
- storage->AddStoredGroup(group);
- storage->AddStoredCache(cache);
+ group->AddCache(cache.get());
+ storage->AddStoredGroup(group.get());
+ storage->AddStoredCache(cache.get());
// Conduct the test.
MockStorageDelegate delegate;
@@ -480,9 +480,9 @@ TEST_F(MockAppCacheStorageTest, BasicFindMainFallbackResponse) {
scoped_refptr<AppCacheGroup> group(
new AppCacheGroup(&service, kManifestUrl, 111));
- group->AddCache(cache);
- storage->AddStoredGroup(group);
- storage->AddStoredCache(cache);
+ group->AddCache(cache.get());
+ storage->AddStoredGroup(group.get());
+ storage->AddStoredCache(cache.get());
// The test url is in both fallback namespace urls, but should match
// the longer of the two.
@@ -527,9 +527,9 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseWithMultipleCandidates) {
cache->set_complete(true);
scoped_refptr<AppCacheGroup> group(
new AppCacheGroup(&service, kManifestUrl1, 111));
- group->AddCache(cache);
- storage->AddStoredGroup(group);
- storage->AddStoredCache(cache);
+ group->AddCache(cache.get());
+ storage->AddStoredGroup(group.get());
+ storage->AddStoredCache(cache.get());
// Drop our references to cache1 so it appears as "not in use".
cache = NULL;
group = NULL;
@@ -540,9 +540,9 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseWithMultipleCandidates) {
kEntryUrl, AppCacheEntry(AppCacheEntry::EXPLICIT, kResponseId2));
cache->set_complete(true);
group = new AppCacheGroup(&service, kManifestUrl2, 222);
- group->AddCache(cache);
- storage->AddStoredGroup(group);
- storage->AddStoredCache(cache);
+ group->AddCache(cache.get());
+ storage->AddStoredGroup(group.get());
+ storage->AddStoredCache(cache.get());
// Conduct the test, we should find the response from the second cache
// since it's "in use".
@@ -586,9 +586,9 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseExclusions) {
cache->set_complete(true);
scoped_refptr<AppCacheGroup> group(
new AppCacheGroup(&service, kManifestUrl, 111));
- group->AddCache(cache);
- storage->AddStoredGroup(group);
- storage->AddStoredCache(cache);
+ group->AddCache(cache.get());
+ storage->AddStoredGroup(group.get());
+ storage->AddStoredCache(cache.get());
MockStorageDelegate delegate;
« no previous file with comments | « webkit/appcache/appcache_url_request_job_unittest.cc ('k') | webkit/blob/blob_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698