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

Unified Diff: webkit/appcache/mock_appcache_storage_unittest.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 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/mock_appcache_storage.cc ('k') | webkit/blob/blob_storage_controller.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 5be333a6a3b39baf784957d3ebecde184d67fa41..3bd8ca63928b5705856ff12edf59804bc1d19543 100644
--- a/webkit/appcache/mock_appcache_storage_unittest.cc
+++ b/webkit/appcache/mock_appcache_storage_unittest.cc
@@ -92,7 +92,7 @@ TEST_F(MockAppCacheStorageTest, LoadCache_NearHit) {
// Setup some preconditions. Make an 'unstored' cache for
// us to load. The ctor should put it in the working set.
int64 cache_id = service.storage()->NewCacheId();
- scoped_refptr<AppCache> cache = new AppCache(&service, cache_id);
+ scoped_refptr<AppCache> cache(new AppCache(&service, cache_id));
// Conduct the test.
MockStorageDelegate delegate;
@@ -157,10 +157,10 @@ TEST_F(MockAppCacheStorageTest, LoadGroupAndCache_FarHit) {
// Setup some preconditions. Create a group and newest cache that
// appears to be "stored" and "not currently in use".
GURL manifest_url("http://blah/");
- scoped_refptr<AppCacheGroup> group =
- new AppCacheGroup(&service, manifest_url, 111);
+ scoped_refptr<AppCacheGroup> group(
+ new AppCacheGroup(&service, manifest_url, 111));
int64 cache_id = storage->NewCacheId();
- scoped_refptr<AppCache> cache = new AppCache(&service, cache_id);
+ scoped_refptr<AppCache> cache(new AppCache(&service, cache_id));
cache->set_complete(true);
group->AddCache(cache);
storage->AddStoredGroup(group);
@@ -208,10 +208,10 @@ TEST_F(MockAppCacheStorageTest, StoreNewGroup) {
// Setup some preconditions. Create a group and newest cache that
// appears to be "unstored".
GURL manifest_url("http://blah/");
- scoped_refptr<AppCacheGroup> group =
- new AppCacheGroup(&service, manifest_url, 111);
+ scoped_refptr<AppCacheGroup> group(
+ new AppCacheGroup(&service, manifest_url, 111));
int64 cache_id = storage->NewCacheId();
- scoped_refptr<AppCache> cache = new AppCache(&service, cache_id);
+ scoped_refptr<AppCache> cache(new AppCache(&service, cache_id));
// Hold a ref to the cache simulate the UpdateJob holding that ref,
// and hold a ref to the group to simulate the CacheHost holding that ref.
@@ -240,16 +240,16 @@ TEST_F(MockAppCacheStorageTest, StoreExistingGroup) {
// Setup some preconditions. Create a group and old complete cache
// that appear to be "stored", and a newest unstored complete cache.
GURL manifest_url("http://blah/");
- scoped_refptr<AppCacheGroup> group =
- new AppCacheGroup(&service, manifest_url, 111);
+ scoped_refptr<AppCacheGroup> group(
+ new AppCacheGroup(&service, manifest_url, 111));
int64 old_cache_id = storage->NewCacheId();
- scoped_refptr<AppCache> old_cache = new AppCache(&service, old_cache_id);
+ 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);
int64 new_cache_id = storage->NewCacheId();
- scoped_refptr<AppCache> new_cache = new AppCache(&service, new_cache_id);
+ scoped_refptr<AppCache> new_cache(new AppCache(&service, new_cache_id));
// Hold our refs to simulate the UpdateJob holding these refs.
// Conduct the test.
@@ -283,10 +283,10 @@ TEST_F(MockAppCacheStorageTest, StoreExistingGroupExistingCache) {
// Setup some preconditions. Create a group and a complete cache that
// appear to be "stored".
GURL manifest_url("http://blah");
- scoped_refptr<AppCacheGroup> group =
- new AppCacheGroup(&service, manifest_url, 111);
+ scoped_refptr<AppCacheGroup> group(
+ new AppCacheGroup(&service, manifest_url, 111));
int64 cache_id = storage->NewCacheId();
- scoped_refptr<AppCache> cache = new AppCache(&service, cache_id);
+ scoped_refptr<AppCache> cache(new AppCache(&service, cache_id));
cache->set_complete(true);
group->AddCache(cache);
storage->AddStoredGroup(group);
@@ -325,10 +325,10 @@ TEST_F(MockAppCacheStorageTest, MakeGroupObsolete) {
// Setup some preconditions. Create a group and newest cache that
// appears to be "stored" and "currently in use".
GURL manifest_url("http://blah/");
- scoped_refptr<AppCacheGroup> group =
- new AppCacheGroup(&service, manifest_url, 111);
+ scoped_refptr<AppCacheGroup> group(
+ new AppCacheGroup(&service, manifest_url, 111));
int64 cache_id = storage->NewCacheId();
- scoped_refptr<AppCache> cache = new AppCache(&service, cache_id);
+ scoped_refptr<AppCache> cache(new AppCache(&service, cache_id));
cache->set_complete(true);
group->AddCache(cache);
storage->AddStoredGroup(group);
@@ -370,7 +370,7 @@ TEST_F(MockAppCacheStorageTest, MarkEntryAsForeign) {
// Setup some preconditions. Create a cache with an entry.
GURL entry_url("http://blah/entry");
int64 cache_id = storage->NewCacheId();
- scoped_refptr<AppCache> cache = new AppCache(&service, cache_id);
+ scoped_refptr<AppCache> cache(new AppCache(&service, cache_id));
cache->AddEntry(entry_url, AppCacheEntry(AppCacheEntry::EXPLICIT));
// Conduct the test.
@@ -414,12 +414,12 @@ TEST_F(MockAppCacheStorageTest, BasicFindMainResponse) {
const GURL kEntryUrl("http://blah/entry");
const GURL kManifestUrl("http://blah/manifest");
const int64 kResponseId = 1;
- scoped_refptr<AppCache> cache = new AppCache(&service, kCacheId);
+ scoped_refptr<AppCache> cache(new AppCache(&service, kCacheId));
cache->AddEntry(
kEntryUrl, AppCacheEntry(AppCacheEntry::EXPLICIT, kResponseId));
cache->set_complete(true);
- scoped_refptr<AppCacheGroup> group =
- new AppCacheGroup(&service, kManifestUrl, 111);
+ scoped_refptr<AppCacheGroup> group(
+ new AppCacheGroup(&service, kManifestUrl, 111));
group->AddCache(cache);
storage->AddStoredGroup(group);
storage->AddStoredCache(cache);
@@ -461,7 +461,7 @@ TEST_F(MockAppCacheStorageTest, BasicFindMainFallbackResponse) {
manifest.fallback_namespaces.push_back(
FallbackNamespace(kFallbackNamespaceUrl2, kFallbackEntryUrl2));
- scoped_refptr<AppCache> cache = new AppCache(&service, kCacheId);
+ scoped_refptr<AppCache> cache(new AppCache(&service, kCacheId));
cache->InitializeWithManifest(&manifest);
cache->AddEntry(
kFallbackEntryUrl1, AppCacheEntry(AppCacheEntry::FALLBACK, kResponseId1));
@@ -469,8 +469,8 @@ TEST_F(MockAppCacheStorageTest, BasicFindMainFallbackResponse) {
kFallbackEntryUrl2, AppCacheEntry(AppCacheEntry::FALLBACK, kResponseId2));
cache->set_complete(true);
- scoped_refptr<AppCacheGroup> group =
- new AppCacheGroup(&service, kManifestUrl, 111);
+ scoped_refptr<AppCacheGroup> group(
+ new AppCacheGroup(&service, kManifestUrl, 111));
group->AddCache(cache);
storage->AddStoredGroup(group);
storage->AddStoredCache(cache);
@@ -511,12 +511,12 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseWithMultipleCandidates) {
const int64 kResponseId2 = 2;
// The first cache.
- scoped_refptr<AppCache> cache = new AppCache(&service, kCacheId1);
+ scoped_refptr<AppCache> cache(new AppCache(&service, kCacheId1));
cache->AddEntry(
kEntryUrl, AppCacheEntry(AppCacheEntry::EXPLICIT, kResponseId1));
cache->set_complete(true);
- scoped_refptr<AppCacheGroup> group =
- new AppCacheGroup(&service, kManifestUrl1, 111);
+ scoped_refptr<AppCacheGroup> group(
+ new AppCacheGroup(&service, kManifestUrl1, 111));
group->AddCache(cache);
storage->AddStoredGroup(group);
storage->AddStoredCache(cache);
@@ -567,15 +567,15 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseExclusions) {
Manifest manifest;
manifest.online_whitelist_namespaces.push_back(kOnlineNamespaceUrl);
- scoped_refptr<AppCache> cache = new AppCache(&service, kCacheId);
+ scoped_refptr<AppCache> cache(new AppCache(&service, kCacheId));
cache->InitializeWithManifest(&manifest);
cache->AddEntry(
kEntryUrl,
AppCacheEntry(AppCacheEntry::EXPLICIT | AppCacheEntry::FOREIGN,
kResponseId));
cache->set_complete(true);
- scoped_refptr<AppCacheGroup> group =
- new AppCacheGroup(&service, kManifestUrl, 111);
+ scoped_refptr<AppCacheGroup> group(
+ new AppCacheGroup(&service, kManifestUrl, 111));
group->AddCache(cache);
storage->AddStoredGroup(group);
storage->AddStoredCache(cache);
« no previous file with comments | « webkit/appcache/mock_appcache_storage.cc ('k') | webkit/blob/blob_storage_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698