diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 04:16:27 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 04:16:27 +0000 |
commit | ad8e04ac88be37d5ccb6c2cf61f52b224dca493c (patch) | |
tree | 9bcb878643bdd9e5af6749fff469b2552e569907 /webkit | |
parent | 5af8043eb24ad60251d8a4e33192e3e6f59246a3 (diff) | |
download | chromium_src-ad8e04ac88be37d5ccb6c2cf61f52b224dca493c.zip chromium_src-ad8e04ac88be37d5ccb6c2cf61f52b224dca493c.tar.gz chromium_src-ad8e04ac88be37d5ccb6c2cf61f52b224dca493c.tar.bz2 |
Convert implicit scoped_refptr constructor calls to explicit ones, part 1
This CL was created automatically by this clang rewriter: http://codereview.appspot.com/2776043/ . I manually fixed a few rough spots of the rewriter output (doh1-3) and fixed all presubmit errors.
BUG=28083
TEST=None
Review URL: http://codereview.chromium.org/4192012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64573 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
26 files changed, 216 insertions, 216 deletions
diff --git a/webkit/appcache/appcache_group_unittest.cc b/webkit/appcache/appcache_group_unittest.cc index 128fbc7..c42722c 100644 --- a/webkit/appcache/appcache_group_unittest.cc +++ b/webkit/appcache/appcache_group_unittest.cc @@ -99,39 +99,39 @@ class AppCacheGroupTest : public testing::Test { TEST(AppCacheGroupTest, AddRemoveCache) { MockAppCacheService service; - scoped_refptr<AppCacheGroup> group = - new AppCacheGroup(&service, GURL("http://foo.com"), 111); + scoped_refptr<AppCacheGroup> group( + new AppCacheGroup(&service, GURL("http://foo.com"), 111)); base::Time now = base::Time::Now(); - scoped_refptr<AppCache> cache1 = new AppCache(&service, 111); + scoped_refptr<AppCache> cache1(new AppCache(&service, 111)); cache1->set_complete(true); cache1->set_update_time(now); group->AddCache(cache1); EXPECT_EQ(cache1, group->newest_complete_cache()); // Adding older cache does not change newest complete cache. - scoped_refptr<AppCache> cache2 = new AppCache(&service, 222); + scoped_refptr<AppCache> cache2(new AppCache(&service, 222)); cache2->set_complete(true); cache2->set_update_time(now - base::TimeDelta::FromDays(1)); group->AddCache(cache2); EXPECT_EQ(cache1, group->newest_complete_cache()); // Adding newer cache does change newest complete cache. - scoped_refptr<AppCache> cache3 = new AppCache(&service, 333); + scoped_refptr<AppCache> cache3(new AppCache(&service, 333)); cache3->set_complete(true); cache3->set_update_time(now + base::TimeDelta::FromDays(1)); group->AddCache(cache3); EXPECT_EQ(cache3, group->newest_complete_cache()); // Adding cache with same update time uses one with larger ID. - scoped_refptr<AppCache> cache4 = new AppCache(&service, 444); + scoped_refptr<AppCache> cache4(new AppCache(&service, 444)); cache4->set_complete(true); cache4->set_update_time(now + base::TimeDelta::FromDays(1)); // same as 3 group->AddCache(cache4); EXPECT_EQ(cache4, group->newest_complete_cache()); - scoped_refptr<AppCache> cache5 = new AppCache(&service, 55); // smaller id + scoped_refptr<AppCache> cache5(new AppCache(&service, 55)); // smaller id cache5->set_complete(true); cache5->set_update_time(now + base::TimeDelta::FromDays(1)); // same as 4 group->AddCache(cache5); @@ -209,8 +209,8 @@ TEST(AppCacheGroupTest, CleanupUnusedGroup) { TEST(AppCacheGroupTest, StartUpdate) { MockAppCacheService service; - scoped_refptr<AppCacheGroup> group = - new AppCacheGroup(&service, GURL("http://foo.com"), 111); + scoped_refptr<AppCacheGroup> group( + new AppCacheGroup(&service, GURL("http://foo.com"), 111)); // Set state to checking to prevent update job from executing fetches. group->update_status_ = AppCacheGroup::CHECKING; @@ -230,8 +230,8 @@ TEST(AppCacheGroupTest, StartUpdate) { TEST(AppCacheGroupTest, CancelUpdate) { MockAppCacheService service; - scoped_refptr<AppCacheGroup> group = - new AppCacheGroup(&service, GURL("http://foo.com"), 111); + scoped_refptr<AppCacheGroup> group( + new AppCacheGroup(&service, GURL("http://foo.com"), 111)); // Set state to checking to prevent update job from executing fetches. group->update_status_ = AppCacheGroup::CHECKING; @@ -249,8 +249,8 @@ TEST(AppCacheGroupTest, CancelUpdate) { TEST(AppCacheGroupTest, QueueUpdate) { MockAppCacheService service; - scoped_refptr<AppCacheGroup> group = - new AppCacheGroup(&service, GURL("http://foo.com"), 111); + scoped_refptr<AppCacheGroup> group( + new AppCacheGroup(&service, GURL("http://foo.com"), 111)); // Set state to checking to prevent update job from executing fetches. group->update_status_ = AppCacheGroup::CHECKING; diff --git a/webkit/appcache/appcache_host_unittest.cc b/webkit/appcache/appcache_host_unittest.cc index 4f83928..5d1f409 100644 --- a/webkit/appcache/appcache_host_unittest.cc +++ b/webkit/appcache/appcache_host_unittest.cc @@ -255,8 +255,8 @@ TEST_F(AppCacheHostTest, SetSwappableCache) { host.SetSwappableCache(NULL); EXPECT_FALSE(host.swappable_cache_.get()); - scoped_refptr<AppCacheGroup> group1 = - new AppCacheGroup(&service_, GURL(), service_.storage()->NewGroupId()); + scoped_refptr<AppCacheGroup> group1( + new AppCacheGroup(&service_, GURL(), service_.storage()->NewGroupId())); host.SetSwappableCache(group1); EXPECT_FALSE(host.swappable_cache_.get()); @@ -281,9 +281,9 @@ TEST_F(AppCacheHostTest, SetSwappableCache) { group1->AddCache(cache2); EXPECT_EQ(cache2, host.swappable_cache_.get()); // updated to newest - scoped_refptr<AppCacheGroup> group2 = + scoped_refptr<AppCacheGroup> group2( new AppCacheGroup(&service_, GURL("http://foo.com"), - service_.storage()->NewGroupId()); + service_.storage()->NewGroupId())); AppCache* cache3 = new AppCache(&service_, 333); cache3->set_complete(true); group2->AddCache(cache3); diff --git a/webkit/appcache/appcache_response_unittest.cc b/webkit/appcache/appcache_response_unittest.cc index bef5b4d0..3c5f692 100644 --- a/webkit/appcache/appcache_response_unittest.cc +++ b/webkit/appcache/appcache_response_unittest.cc @@ -172,7 +172,7 @@ class AppCacheResponseTest : public testing::Test { static const char kHttpHeaders[] = "HTTP/1.0 200 OK\0Content-Length: 5\0\0"; static const char* kHttpBody = "Hello"; - scoped_refptr<IOBuffer> body = new WrappedIOBuffer(kHttpBody); + scoped_refptr<IOBuffer> body(new WrappedIOBuffer(kHttpBody)); std::string raw_headers(kHttpHeaders, arraysize(kHttpHeaders)); WriteResponse(MakeHttpResponseInfo(raw_headers), body, strlen(kHttpBody)); } @@ -456,8 +456,8 @@ class AppCacheResponseTest : public testing::Test { } void WriteOneBlock(int block_number) { - scoped_refptr<IOBuffer> io_buffer = - new IOBuffer(kBlockSize); + scoped_refptr<IOBuffer> io_buffer( + new IOBuffer(kBlockSize)); FillData(block_number, io_buffer->data(), kBlockSize); WriteResponseBody(io_buffer, kBlockSize); } diff --git a/webkit/appcache/appcache_storage_impl.cc b/webkit/appcache/appcache_storage_impl.cc index 518f840..232dffb 100644 --- a/webkit/appcache/appcache_storage_impl.cc +++ b/webkit/appcache/appcache_storage_impl.cc @@ -875,7 +875,7 @@ void AppCacheStorageImpl::Initialize(const FilePath& cache_directory, db_file_path = cache_directory_.Append(kAppCacheDatabaseName); database_ = new AppCacheDatabase(db_file_path); - scoped_refptr<InitTask> task = new InitTask(this); + scoped_refptr<InitTask> task(new InitTask(this)); task->Schedule(); } @@ -888,13 +888,13 @@ void AppCacheStorageImpl::Disable() { working_set()->Disable(); if (disk_cache_.get()) disk_cache_->Disable(); - scoped_refptr<DisableDatabaseTask> task = new DisableDatabaseTask(this); + scoped_refptr<DisableDatabaseTask> task(new DisableDatabaseTask(this)); task->Schedule(); } void AppCacheStorageImpl::GetAllInfo(Delegate* delegate) { DCHECK(delegate); - scoped_refptr<GetAllInfoTask> task = new GetAllInfoTask(this); + scoped_refptr<GetAllInfoTask> task(new GetAllInfoTask(this)); task->AddDelegate(GetOrCreateDelegateReference(delegate)); task->Schedule(); } @@ -910,14 +910,14 @@ void AppCacheStorageImpl::LoadCache(int64 id, Delegate* delegate) { if (cache) { delegate->OnCacheLoaded(cache, id); if (cache->owning_group()) { - scoped_refptr<DatabaseTask> update_task = + scoped_refptr<DatabaseTask> update_task( new UpdateGroupLastAccessTimeTask( - this, cache->owning_group()->group_id(), base::Time::Now()); + this, cache->owning_group()->group_id(), base::Time::Now())); update_task->Schedule(); } return; } - scoped_refptr<CacheLoadTask> task = GetPendingCacheLoadTask(id); + scoped_refptr<CacheLoadTask> task(GetPendingCacheLoadTask(id)); if (task) { task->AddDelegate(GetOrCreateDelegateReference(delegate)); return; @@ -939,14 +939,14 @@ void AppCacheStorageImpl::LoadOrCreateGroup( AppCacheGroup* group = working_set_.GetGroup(manifest_url); if (group) { delegate->OnGroupLoaded(group, manifest_url); - scoped_refptr<DatabaseTask> update_task = + scoped_refptr<DatabaseTask> update_task( new UpdateGroupLastAccessTimeTask( - this, group->group_id(), base::Time::Now()); + this, group->group_id(), base::Time::Now())); update_task->Schedule(); return; } - scoped_refptr<GroupLoadTask> task = GetPendingGroupLoadTask(manifest_url); + scoped_refptr<GroupLoadTask> task(GetPendingGroupLoadTask(manifest_url)); if (task) { task->AddDelegate(GetOrCreateDelegateReference(delegate)); return; @@ -955,8 +955,8 @@ void AppCacheStorageImpl::LoadOrCreateGroup( if (origins_with_groups_.find(manifest_url.GetOrigin()) == origins_with_groups_.end()) { // No need to query the database, return a new group immediately. - scoped_refptr<AppCacheGroup> group = new AppCacheGroup( - service_, manifest_url, NewGroupId()); + scoped_refptr<AppCacheGroup> group(new AppCacheGroup( + service_, manifest_url, NewGroupId())); delegate->OnGroupLoaded(group, manifest_url); return; } @@ -975,8 +975,8 @@ void AppCacheStorageImpl::StoreGroupAndNewestCache( // the simple update case in a very heavy weight way (delete all and // the reinsert all over again). DCHECK(group && delegate && newest_cache); - scoped_refptr<StoreGroupAndCacheTask> task = - new StoreGroupAndCacheTask(this, group, newest_cache); + scoped_refptr<StoreGroupAndCacheTask> task( + new StoreGroupAndCacheTask(this, group, newest_cache)); task->AddDelegate(GetOrCreateDelegateReference(delegate)); task->Schedule(); } @@ -1034,8 +1034,8 @@ void AppCacheStorageImpl::FindResponseForMainRequest( } // We have to query the database, schedule a database task to do so. - scoped_refptr<FindMainResponseTask> task = - new FindMainResponseTask(this, *url_ptr, groups_in_use); + scoped_refptr<FindMainResponseTask> task( + new FindMainResponseTask(this, *url_ptr, groups_in_use)); task->AddDelegate(GetOrCreateDelegateReference(delegate)); task->Schedule(); } @@ -1106,8 +1106,8 @@ void AppCacheStorageImpl::MarkEntryAsForeign( if (entry) entry->add_types(AppCacheEntry::FOREIGN); } - scoped_refptr<MarkEntryAsForeignTask> task = - new MarkEntryAsForeignTask(this, entry_url, cache_id); + scoped_refptr<MarkEntryAsForeignTask> task( + new MarkEntryAsForeignTask(this, entry_url, cache_id)); task->Schedule(); pending_foreign_markings_.push_back(std::make_pair(entry_url, cache_id)); } @@ -1115,8 +1115,8 @@ void AppCacheStorageImpl::MarkEntryAsForeign( void AppCacheStorageImpl::MakeGroupObsolete( AppCacheGroup* group, Delegate* delegate) { DCHECK(group && delegate); - scoped_refptr<MakeGroupObsoleteTask> task = - new MakeGroupObsoleteTask(this, group); + scoped_refptr<MakeGroupObsoleteTask> task( + new MakeGroupObsoleteTask(this, group)); task->AddDelegate(GetOrCreateDelegateReference(delegate)); task->Schedule(); } @@ -1144,8 +1144,8 @@ void AppCacheStorageImpl::DoomResponses( // TODO(michaeln): There is a race here. If the browser crashes // prior to committing these rows to the database and prior to us // having deleted them from the disk cache, we'll never delete them. - scoped_refptr<InsertDeletableResponseIdsTask> task = - new InsertDeletableResponseIdsTask(this); + scoped_refptr<InsertDeletableResponseIdsTask> task( + new InsertDeletableResponseIdsTask(this)); task->response_ids_ = response_ids; task->Schedule(); } @@ -1158,15 +1158,15 @@ void AppCacheStorageImpl::DeleteResponses( } void AppCacheStorageImpl::PurgeMemory() { - scoped_refptr<CloseConnectionTask> task = new CloseConnectionTask(this); + scoped_refptr<CloseConnectionTask> task(new CloseConnectionTask(this)); task->Schedule(); } void AppCacheStorageImpl::DelayedStartDeletingUnusedResponses() { // Only if we haven't already begun. if (!did_start_deleting_responses_) { - scoped_refptr<GetDeletableResponseIdsTask> task = - new GetDeletableResponseIdsTask(this, last_deletable_response_rowid_); + scoped_refptr<GetDeletableResponseIdsTask> task( + new GetDeletableResponseIdsTask(this, last_deletable_response_rowid_)); task->Schedule(); } } @@ -1223,15 +1223,15 @@ void AppCacheStorageImpl::OnDeletedOneResponse(int rv) { const size_t kBatchSize = 50U; if (deleted_response_ids_.size() >= kBatchSize || deletable_response_ids_.empty()) { - scoped_refptr<DeleteDeletableResponseIdsTask> task = - new DeleteDeletableResponseIdsTask(this); + scoped_refptr<DeleteDeletableResponseIdsTask> task( + new DeleteDeletableResponseIdsTask(this)); task->response_ids_.swap(deleted_response_ids_); task->Schedule(); } if (deletable_response_ids_.empty()) { - scoped_refptr<GetDeletableResponseIdsTask> task = - new GetDeletableResponseIdsTask(this, last_deletable_response_rowid_); + scoped_refptr<GetDeletableResponseIdsTask> task( + new GetDeletableResponseIdsTask(this, last_deletable_response_rowid_)); task->Schedule(); return; } diff --git a/webkit/appcache/appcache_storage_impl_unittest.cc b/webkit/appcache/appcache_storage_impl_unittest.cc index 5fccade..6c153a5 100644 --- a/webkit/appcache/appcache_storage_impl_unittest.cc +++ b/webkit/appcache/appcache_storage_impl_unittest.cc @@ -316,7 +316,7 @@ class AppCacheStorageImplTest : public testing::Test { // Setup some preconditions. Make an 'unstored' cache for // us to load. The ctor should put it in the working set. int64 cache_id = storage()->NewCacheId(); - scoped_refptr<AppCache> cache = new AppCache(service(), cache_id); + scoped_refptr<AppCache> cache(new AppCache(service(), cache_id)); // Conduct the test. storage()->LoadCache(cache_id, delegate()); diff --git a/webkit/appcache/appcache_storage_unittest.cc b/webkit/appcache/appcache_storage_unittest.cc index bdb1111..9e9e57e 100644 --- a/webkit/appcache/appcache_storage_unittest.cc +++ b/webkit/appcache/appcache_storage_unittest.cc @@ -21,7 +21,7 @@ class AppCacheStorageTest : public testing::Test { TEST_F(AppCacheStorageTest, AddRemoveCache) { MockAppCacheService service; - scoped_refptr<AppCache> cache = new AppCache(&service, 111); + scoped_refptr<AppCache> cache(new AppCache(&service, 111)); EXPECT_EQ(cache.get(), service.storage()->working_set()->GetCache(111)); @@ -37,7 +37,7 @@ TEST_F(AppCacheStorageTest, AddRemoveCache) { TEST_F(AppCacheStorageTest, AddRemoveGroup) { MockAppCacheService service; - scoped_refptr<AppCacheGroup> group = new AppCacheGroup(&service, GURL(), 111); + scoped_refptr<AppCacheGroup> group(new AppCacheGroup(&service, GURL(), 111)); EXPECT_EQ(group.get(), service.storage()->working_set()->GetGroup(GURL())); @@ -52,10 +52,10 @@ TEST_F(AppCacheStorageTest, AddRemoveGroup) { TEST_F(AppCacheStorageTest, AddRemoveResponseInfo) { MockAppCacheService service; - scoped_refptr<AppCacheResponseInfo> info = + scoped_refptr<AppCacheResponseInfo> info( new AppCacheResponseInfo(&service, GURL(), 111, new net::HttpResponseInfo, - kUnkownResponseDataSize); + kUnkownResponseDataSize)); EXPECT_EQ(info.get(), service.storage()->working_set()->GetResponseInfo(111)); diff --git a/webkit/appcache/appcache_unittest.cc b/webkit/appcache/appcache_unittest.cc index 8fcde53..d0583f8 100644 --- a/webkit/appcache/appcache_unittest.cc +++ b/webkit/appcache/appcache_unittest.cc @@ -34,7 +34,7 @@ TEST(AppCacheTest, CleanupUnusedCache) { TEST(AppCacheTest, AddModifyRemoveEntry) { MockAppCacheService service; - scoped_refptr<AppCache> cache = new AppCache(&service, 111); + scoped_refptr<AppCache> cache(new AppCache(&service, 111)); EXPECT_TRUE(cache->entries().empty()); EXPECT_EQ(0L, cache->cache_size()); @@ -79,7 +79,7 @@ TEST(AppCacheTest, AddModifyRemoveEntry) { TEST(AppCacheTest, InitializeWithManifest) { MockAppCacheService service; - scoped_refptr<AppCache> cache = new AppCache(&service, 1234); + scoped_refptr<AppCache> cache(new AppCache(&service, 1234)); EXPECT_TRUE(cache->fallback_namespaces_.empty()); EXPECT_TRUE(cache->online_whitelist_namespaces_.empty()); EXPECT_FALSE(cache->online_whitelist_all_); @@ -144,7 +144,7 @@ TEST(AppCacheTest, FindResponseForRequest) { FallbackNamespace(kFallbackNamespaceUrl2, kFallbackEntryUrl2)); // Create a cache with some namespaces and entries. - scoped_refptr<AppCache> cache = new AppCache(&service, 1234); + scoped_refptr<AppCache> cache(new AppCache(&service, 1234)); cache->InitializeWithManifest(&manifest); cache->AddEntry( kFallbackEntryUrl1, diff --git a/webkit/appcache/appcache_update_job.cc b/webkit/appcache/appcache_update_job.cc index 3aeb497..94d8a05 100644 --- a/webkit/appcache/appcache_update_job.cc +++ b/webkit/appcache/appcache_update_job.cc @@ -353,9 +353,9 @@ void AppCacheUpdateJob::OnResponseStarted(URLRequest *request) { service_->storage()->CreateResponseWriter(manifest_url_), this, request); stored_response_ids_.push_back(info->response_writer_->response_id()); - scoped_refptr<HttpResponseInfoIOBuffer> io_buffer = + scoped_refptr<HttpResponseInfoIOBuffer> io_buffer( new HttpResponseInfoIOBuffer( - new net::HttpResponseInfo(request->response_info())); + new net::HttpResponseInfo(request->response_info()))); info->response_writer_->WriteInfo(io_buffer, &info->write_callback_); } else { ReadResponseData(request); @@ -782,8 +782,8 @@ void AppCacheUpdateJob::HandleManifestRefetchCompleted(URLRequest* request) { manifest_response_writer_.reset( service_->storage()->CreateResponseWriter(manifest_url_)); stored_response_ids_.push_back(manifest_response_writer_->response_id()); - scoped_refptr<HttpResponseInfoIOBuffer> io_buffer = - new HttpResponseInfoIOBuffer(manifest_response_info_.release()); + scoped_refptr<HttpResponseInfoIOBuffer> io_buffer( + new HttpResponseInfoIOBuffer(manifest_response_info_.release())); manifest_response_writer_->WriteInfo(io_buffer, &manifest_info_write_callback_); } @@ -798,8 +798,8 @@ void AppCacheUpdateJob::HandleManifestRefetchCompleted(URLRequest* request) { void AppCacheUpdateJob::OnManifestInfoWriteComplete(int result) { if (result > 0) { - scoped_refptr<net::StringIOBuffer> io_buffer = - new net::StringIOBuffer(manifest_data_); + scoped_refptr<net::StringIOBuffer> io_buffer( + new net::StringIOBuffer(manifest_data_)); manifest_response_writer_->WriteData(io_buffer, manifest_data_.length(), &manifest_data_write_callback_); } else { diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc index 948c8a0..eddb8e4 100644 --- a/webkit/appcache/appcache_update_job_unittest.cc +++ b/webkit/appcache/appcache_update_job_unittest.cc @@ -997,8 +997,8 @@ class AppCacheUpdateJobTest : public testing::Test, // Seed storage with expected manifest data. const std::string seed_data(kManifest1Contents); - scoped_refptr<net::StringIOBuffer> io_buffer = - new net::StringIOBuffer(seed_data); + scoped_refptr<net::StringIOBuffer> io_buffer( + new net::StringIOBuffer(seed_data)); write_callback_.reset( new net::CompletionCallbackImpl<AppCacheUpdateJobTest>(this, &AppCacheUpdateJobTest::StartUpdateAfterSeedingStorageData)); @@ -1100,8 +1100,8 @@ class AppCacheUpdateJobTest : public testing::Test, // Seed storage with expected manifest data different from manifest1. const std::string seed_data("different"); - scoped_refptr<net::StringIOBuffer> io_buffer = - new net::StringIOBuffer(seed_data); + scoped_refptr<net::StringIOBuffer> io_buffer( + new net::StringIOBuffer(seed_data)); write_callback_.reset( new net::CompletionCallbackImpl<AppCacheUpdateJobTest>(this, &AppCacheUpdateJobTest::StartUpdateAfterSeedingStorageData)); @@ -1162,8 +1162,8 @@ class AppCacheUpdateJobTest : public testing::Test, response_info->request_time = base::Time::Now(); response_info->response_time = base::Time::Now(); response_info->headers = headers; // adds ref to headers - scoped_refptr<HttpResponseInfoIOBuffer> io_buffer = - new HttpResponseInfoIOBuffer(response_info); // adds ref to info + scoped_refptr<HttpResponseInfoIOBuffer> io_buffer( + new HttpResponseInfoIOBuffer(response_info)); // adds ref to info write_callback_.reset( new net::CompletionCallbackImpl<AppCacheUpdateJobTest>(this, &AppCacheUpdateJobTest::StartUpdateAfterSeedingStorageData)); @@ -1220,8 +1220,8 @@ class AppCacheUpdateJobTest : public testing::Test, response_info->request_time = base::Time::Now(); response_info->response_time = base::Time::Now(); response_info->headers = headers; // adds ref to headers - scoped_refptr<HttpResponseInfoIOBuffer> io_buffer = - new HttpResponseInfoIOBuffer(response_info); // adds ref to info + scoped_refptr<HttpResponseInfoIOBuffer> io_buffer( + new HttpResponseInfoIOBuffer(response_info)); // adds ref to info write_callback_.reset( new net::CompletionCallbackImpl<AppCacheUpdateJobTest>(this, &AppCacheUpdateJobTest::StartUpdateAfterSeedingStorageData)); @@ -1278,8 +1278,8 @@ class AppCacheUpdateJobTest : public testing::Test, response_info->request_time = base::Time::Now(); response_info->response_time = base::Time::Now(); response_info->headers = headers; // adds ref to headers - scoped_refptr<HttpResponseInfoIOBuffer> io_buffer = - new HttpResponseInfoIOBuffer(response_info); // adds ref to info + scoped_refptr<HttpResponseInfoIOBuffer> io_buffer( + new HttpResponseInfoIOBuffer(response_info)); // adds ref to info write_callback_.reset( new net::CompletionCallbackImpl<AppCacheUpdateJobTest>(this, &AppCacheUpdateJobTest::StartUpdateAfterSeedingStorageData)); @@ -1829,9 +1829,9 @@ class AppCacheUpdateJobTest : public testing::Test, group_ = new AppCacheGroup( service_.get(), kManifestUrl, service_->storage()->NewGroupId()); - scoped_refptr<AppCache> cache = + scoped_refptr<AppCache> cache( MakeCacheForGroup(service_->storage()->NewCacheId(), - kManifestResponseId); + kManifestResponseId)); MockFrontend* frontend = MakeMockFrontend(); AppCacheHost* host = MakeHost(1, frontend); @@ -2686,8 +2686,8 @@ class AppCacheUpdateJobTest : public testing::Test, new net::HttpResponseHeaders(std::string(data, arraysize(data))); net::HttpResponseInfo* response_info = new net::HttpResponseInfo(); response_info->headers = headers; // adds ref to headers - scoped_refptr<HttpResponseInfoIOBuffer> io_buffer = - new HttpResponseInfoIOBuffer(response_info); // adds ref to info + scoped_refptr<HttpResponseInfoIOBuffer> io_buffer( + new HttpResponseInfoIOBuffer(response_info)); // adds ref to info write_callback_.reset( new net::CompletionCallbackImpl<AppCacheUpdateJobTest>(this, &AppCacheUpdateJobTest::StartUpdateAfterSeedingStorageData)); @@ -2744,8 +2744,8 @@ class AppCacheUpdateJobTest : public testing::Test, new net::HttpResponseHeaders(std::string(data, arraysize(data))); net::HttpResponseInfo* response_info = new net::HttpResponseInfo(); response_info->headers = headers; // adds ref to headers - scoped_refptr<HttpResponseInfoIOBuffer> io_buffer = - new HttpResponseInfoIOBuffer(response_info); // adds ref to info + scoped_refptr<HttpResponseInfoIOBuffer> io_buffer( + new HttpResponseInfoIOBuffer(response_info)); // adds ref to info write_callback_.reset( new net::CompletionCallbackImpl<AppCacheUpdateJobTest>(this, &AppCacheUpdateJobTest::StartUpdateAfterSeedingStorageData)); @@ -2895,9 +2895,9 @@ class AppCacheUpdateJobTest : public testing::Test, const std::string& raw_headers) { net::HttpResponseInfo* http_info = new net::HttpResponseInfo(); http_info->headers = new net::HttpResponseHeaders(raw_headers); - scoped_refptr<AppCacheResponseInfo> info = + scoped_refptr<AppCacheResponseInfo> info( new AppCacheResponseInfo(service_.get(), manifest_url, - response_id, http_info, 0); + response_id, http_info, 0)); response_infos_.push_back(info); return info; } @@ -3219,9 +3219,9 @@ base::WaitableEvent* AppCacheUpdateJobTest::io_thread_shutdown_event_ = NULL; TEST_F(AppCacheUpdateJobTest, AlreadyChecking) { MockAppCacheService service; - scoped_refptr<AppCacheGroup> group = + scoped_refptr<AppCacheGroup> group( new AppCacheGroup(&service, GURL("http://manifesturl.com"), - service.storage()->NewGroupId()); + service.storage()->NewGroupId())); AppCacheUpdateJob update(&service, group); @@ -3247,9 +3247,9 @@ TEST_F(AppCacheUpdateJobTest, AlreadyChecking) { TEST_F(AppCacheUpdateJobTest, AlreadyDownloading) { MockAppCacheService service; - scoped_refptr<AppCacheGroup> group = + scoped_refptr<AppCacheGroup> group( new AppCacheGroup(&service, GURL("http://manifesturl.com"), - service.storage()->NewGroupId()); + service.storage()->NewGroupId())); AppCacheUpdateJob update(&service, group); diff --git a/webkit/appcache/appcache_url_request_job_unittest.cc b/webkit/appcache/appcache_url_request_job_unittest.cc index f3a3ed2..2475c79 100644 --- a/webkit/appcache/appcache_url_request_job_unittest.cc +++ b/webkit/appcache/appcache_url_request_job_unittest.cc @@ -104,8 +104,8 @@ class AppCacheURLRequestJobTest : public testing::Test { void ReadSome(URLRequest* request) { DCHECK(amount_received_ + kBlockSize <= kNumBlocks * kBlockSize); - scoped_refptr<IOBuffer> wrapped_buffer = - new net::WrappedIOBuffer(received_data_->data() + amount_received_); + scoped_refptr<IOBuffer> wrapped_buffer( + new net::WrappedIOBuffer(received_data_->data() + amount_received_)); int bytes_read = 0; EXPECT_FALSE(request->Read(wrapped_buffer, kBlockSize, &bytes_read)); EXPECT_EQ(0, bytes_read); @@ -264,7 +264,7 @@ class AppCacheURLRequestJobTest : public testing::Test { // Wrappers to call AppCacheResponseReader/Writer Read and Write methods void WriteBasicResponse() { - scoped_refptr<IOBuffer> body = new WrappedIOBuffer(kHttpBasicBody); + scoped_refptr<IOBuffer> body(new WrappedIOBuffer(kHttpBasicBody)); std::string raw_headers(kHttpBasicHeaders, arraysize(kHttpBasicHeaders)); WriteResponse(MakeHttpResponseInfo(raw_headers), body, strlen(kHttpBasicBody)); @@ -603,7 +603,7 @@ class AppCacheURLRequestJobTest : public testing::Test { // 3, 1k blocks static const char kHttpHeaders[] = "HTTP/1.0 200 OK\0Content-Length: 3072\0\0"; - scoped_refptr<IOBuffer> body = new IOBuffer(kBlockSize * 3); + scoped_refptr<IOBuffer> body(new IOBuffer(kBlockSize * 3)); char* p = body->data(); for (int i = 0; i < 3; ++i, p += kBlockSize) FillData(i + 1, p, kBlockSize); diff --git a/webkit/appcache/mock_appcache_storage.cc b/webkit/appcache/mock_appcache_storage.cc index 6bf3e8d..a50dca6 100644 --- a/webkit/appcache/mock_appcache_storage.cc +++ b/webkit/appcache/mock_appcache_storage.cc @@ -171,7 +171,7 @@ void MockAppCacheStorage::ProcessLoadCache( void MockAppCacheStorage::ProcessLoadOrCreateGroup( const GURL& manifest_url, scoped_refptr<DelegateReference> delegate_ref) { - scoped_refptr<AppCacheGroup> group = working_set_.GetGroup(manifest_url); + scoped_refptr<AppCacheGroup> group(working_set_.GetGroup(manifest_url)); // Newly created groups are not put in the stored_groups collection // until StoreGroupAndNewestCache is called. diff --git a/webkit/appcache/mock_appcache_storage_unittest.cc b/webkit/appcache/mock_appcache_storage_unittest.cc index 5be333a..3bd8ca6 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); diff --git a/webkit/blob/blob_storage_controller.cc b/webkit/blob/blob_storage_controller.cc index e813be2..de70774 100644 --- a/webkit/blob/blob_storage_controller.cc +++ b/webkit/blob/blob_storage_controller.cc @@ -19,7 +19,7 @@ BlobStorageController::~BlobStorageController() { void BlobStorageController::RegisterBlobUrl( const GURL& url, const BlobData* blob_data) { - scoped_refptr<BlobData> target_blob_data = new BlobData(); + scoped_refptr<BlobData> target_blob_data(new BlobData()); target_blob_data->set_content_type(blob_data->content_type()); target_blob_data->set_content_disposition(blob_data->content_disposition()); diff --git a/webkit/blob/blob_storage_controller_unittest.cc b/webkit/blob/blob_storage_controller_unittest.cc index e977585..6d6f0d1 100644 --- a/webkit/blob/blob_storage_controller_unittest.cc +++ b/webkit/blob/blob_storage_controller_unittest.cc @@ -21,19 +21,19 @@ TEST(BlobStorageControllerTest, RegisterBlobUrl) { base::Time::FromString(L"Tue, 15 Nov 1994, 12:45:26 GMT", &time1); base::Time::FromString(L"Mon, 14 Nov 1994, 11:30:49 GMT", &time2); - scoped_refptr<BlobData> blob_data1 = new BlobData(); + scoped_refptr<BlobData> blob_data1(new BlobData()); blob_data1->AppendData("Data1"); blob_data1->AppendData("Data2"); blob_data1->AppendFile(FilePath(FILE_PATH_LITERAL("File1.txt")), 10, 1024, time1); - scoped_refptr<BlobData> blob_data2 = new BlobData(); + scoped_refptr<BlobData> blob_data2(new BlobData()); blob_data2->AppendData("Data3"); blob_data2->AppendBlob(GURL("blob://url_1"), 8, 100); blob_data2->AppendFile(FilePath(FILE_PATH_LITERAL("File2.txt")), 0, 20, time2); - scoped_refptr<BlobData> canonicalized_blob_data2 = new BlobData(); + scoped_refptr<BlobData> canonicalized_blob_data2(new BlobData()); canonicalized_blob_data2->AppendData("Data3"); canonicalized_blob_data2->AppendData("Data2", 3, 2); canonicalized_blob_data2->AppendFile(FilePath(FILE_PATH_LITERAL("File1.txt")), @@ -86,7 +86,7 @@ TEST(BlobStorageControllerTest, ResolveBlobReferencesInUploadData) { scoped_ptr<BlobStorageController> blob_storage_controller( new BlobStorageController()); - scoped_refptr<BlobData> blob_data = new BlobData(); + scoped_refptr<BlobData> blob_data(new BlobData()); GURL blob_url0("blob://url_0"); blob_storage_controller->RegisterBlobUrl(blob_url0, blob_data); @@ -122,7 +122,7 @@ TEST(BlobStorageControllerTest, ResolveBlobReferencesInUploadData) { FilePath(FILE_PATH_LITERAL("foo1.txt")), 0, 20, time2); // Test no blob reference. - scoped_refptr<UploadData> upload_data = new UploadData(); + scoped_refptr<UploadData> upload_data(new UploadData()); upload_data->AppendBytes( &upload_element1.bytes().at(0), upload_element1.bytes().size()); diff --git a/webkit/blob/blob_url_request_job_unittest.cc b/webkit/blob/blob_url_request_job_unittest.cc index ad4ecb4..2fb2337 100644 --- a/webkit/blob/blob_url_request_job_unittest.cc +++ b/webkit/blob/blob_url_request_job_unittest.cc @@ -271,13 +271,13 @@ class BlobURLRequestJobTest : public testing::Test { // Test Cases --------------------------------------------------------------- void TestGetSimpleDataRequest() { - scoped_refptr<BlobData> blob_data = new BlobData(); + scoped_refptr<BlobData> blob_data(new BlobData()); blob_data->AppendData(kTestData1); TestSuccessRequest(blob_data, kTestData1); } void TestGetSimpleFileRequest() { - scoped_refptr<BlobData> blob_data = new BlobData(); + scoped_refptr<BlobData> blob_data(new BlobData()); blob_data->AppendFile(temp_file1_, 0, -1, base::Time()); TestSuccessRequest(blob_data, kTestFileData1); } @@ -285,13 +285,13 @@ class BlobURLRequestJobTest : public testing::Test { void TestGetNonExistentFileRequest() { FilePath non_existent_file = temp_file1_.InsertBeforeExtension(FILE_PATH_LITERAL("-na")); - scoped_refptr<BlobData> blob_data = new BlobData(); + scoped_refptr<BlobData> blob_data(new BlobData()); blob_data->AppendFile(non_existent_file, 0, -1, base::Time()); TestErrorRequest(blob_data, 404); } void TestGetChangedFileRequest() { - scoped_refptr<BlobData> blob_data = new BlobData(); + scoped_refptr<BlobData> blob_data(new BlobData()); base::Time old_time = temp_file_modification_time1_ - base::TimeDelta::FromSeconds(10); blob_data->AppendFile(temp_file1_, 0, 3, old_time); @@ -299,21 +299,21 @@ class BlobURLRequestJobTest : public testing::Test { } void TestGetSlicedDataRequest() { - scoped_refptr<BlobData> blob_data = new BlobData(); + scoped_refptr<BlobData> blob_data(new BlobData()); blob_data->AppendData(kTestData2, 2, 4); std::string result(kTestData2 + 2, 4); TestSuccessRequest(blob_data, result); } void TestGetSlicedFileRequest() { - scoped_refptr<BlobData> blob_data = new BlobData(); + scoped_refptr<BlobData> blob_data(new BlobData()); blob_data->AppendFile(temp_file1_, 2, 4, temp_file_modification_time1_); std::string result(kTestFileData1 + 2, 4); TestSuccessRequest(blob_data, result); } scoped_refptr<BlobData> BuildComplicatedData(std::string* expected_result) { - scoped_refptr<BlobData> blob_data = new BlobData(); + scoped_refptr<BlobData> blob_data(new BlobData()); blob_data->AppendData(kTestData1, 1, 2); blob_data->AppendFile(temp_file1_, 2, 3, temp_file_modification_time1_); blob_data->AppendData(kTestData2, 3, 4); @@ -356,7 +356,7 @@ class BlobURLRequestJobTest : public testing::Test { } void TestExtraHeaders() { - scoped_refptr<BlobData> blob_data = new BlobData(); + scoped_refptr<BlobData> blob_data(new BlobData()); blob_data->set_content_type(kTestContentType); blob_data->set_content_disposition(kTestContentDisposition); blob_data->AppendData(kTestData1); diff --git a/webkit/blob/deletable_file_reference.cc b/webkit/blob/deletable_file_reference.cc index 9f49943..87ef4cc 100644 --- a/webkit/blob/deletable_file_reference.cc +++ b/webkit/blob/deletable_file_reference.cc @@ -42,8 +42,8 @@ scoped_refptr<DeletableFileReference> DeletableFileReference::GetOrCreate( return scoped_refptr<DeletableFileReference>(result.first->second); // Wasn't in the map, create a new reference and store the pointer. - scoped_refptr<DeletableFileReference> reference = - new DeletableFileReference(path, file_thread); + scoped_refptr<DeletableFileReference> reference( + new DeletableFileReference(path, file_thread)); result.first->second = reference.get(); return reference; } diff --git a/webkit/fileapi/file_system_path_manager.cc b/webkit/fileapi/file_system_path_manager.cc index a81c254..c974dba 100644 --- a/webkit/fileapi/file_system_path_manager.cc +++ b/webkit/fileapi/file_system_path_manager.cc @@ -216,9 +216,9 @@ void FileSystemPathManager::GetFileSystemRootPath( .AppendASCII(type_string); std::string name = storage_identifier + ":" + type_string; - scoped_refptr<GetFileSystemRootPathTask> task = + scoped_refptr<GetFileSystemRootPathTask> task( new GetFileSystemRootPathTask(file_message_loop_, - name, callback.release()); + name, callback.release())); task->Start(origin_url, origin_base_path, create); } diff --git a/webkit/glue/media/buffered_data_source_unittest.cc b/webkit/glue/media/buffered_data_source_unittest.cc index 929d8d9..81103b2 100644 --- a/webkit/glue/media/buffered_data_source_unittest.cc +++ b/webkit/glue/media/buffered_data_source_unittest.cc @@ -608,8 +608,8 @@ class BufferedDataSourceTest : public testing::Test { // There is no need to provide a message loop to data source. data_source_->set_host(&host_); - scoped_refptr<NiceMock<MockBufferedResourceLoader> > first_loader = - new NiceMock<MockBufferedResourceLoader>(); + scoped_refptr<NiceMock<MockBufferedResourceLoader> > first_loader( + new NiceMock<MockBufferedResourceLoader>()); // Creates the mock loader to be injected. loader_ = first_loader; diff --git a/webkit/glue/plugins/npapi_extension_thunk.cc b/webkit/glue/plugins/npapi_extension_thunk.cc index 4779535..05a9c5d 100644 --- a/webkit/glue/plugins/npapi_extension_thunk.cc +++ b/webkit/glue/plugins/npapi_extension_thunk.cc @@ -28,7 +28,7 @@ static NPAPI::PluginInstance* FindInstance(NPP id) { static NPError Device2DQueryCapability(NPP id, int32_t capability, int32_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { plugin->webplugin()->delegate()->Device2DQueryCapability(capability, value); return NPERR_NO_ERROR; @@ -40,7 +40,7 @@ static NPError Device2DQueryCapability(NPP id, int32_t capability, static NPError Device2DQueryConfig(NPP id, const NPDeviceConfig* request, NPDeviceConfig* obtain) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DQueryConfig( static_cast<const NPDeviceContext2DConfig*>(request), @@ -52,7 +52,7 @@ static NPError Device2DQueryConfig(NPP id, static NPError Device2DInitializeContext(NPP id, const NPDeviceConfig* config, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DInitializeContext( static_cast<const NPDeviceContext2DConfig*>(config), @@ -65,7 +65,7 @@ static NPError Device2DSetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t value) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DSetStateContext( static_cast<NPDeviceContext2D*>(context), state, value); @@ -77,7 +77,7 @@ static NPError Device2DGetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DGetStateContext( static_cast<NPDeviceContext2D*>(context), state, value); @@ -89,7 +89,7 @@ static NPError Device2DFlushContext(NPP id, NPDeviceContext* context, NPDeviceFlushContextCallbackPtr callback, void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { NPError err = plugin->webplugin()->delegate()->Device2DFlushContext( id, static_cast<NPDeviceContext2D*>(context), callback, user_data); @@ -109,7 +109,7 @@ static NPError Device2DFlushContext(NPP id, static NPError Device2DDestroyContext(NPP id, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DDestroyContext( static_cast<NPDeviceContext2D*>(context)); @@ -141,7 +141,7 @@ static NPError Device2DMapBuffer(NPP id, static NPError Device3DQueryCapability(NPP id, int32_t capability, int32_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { plugin->webplugin()->delegate()->Device3DQueryCapability(capability, value); return NPERR_NO_ERROR; @@ -153,7 +153,7 @@ static NPError Device3DQueryCapability(NPP id, int32_t capability, static NPError Device3DQueryConfig(NPP id, const NPDeviceConfig* request, NPDeviceConfig* obtain) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DQueryConfig( static_cast<const NPDeviceContext3DConfig*>(request), @@ -165,7 +165,7 @@ static NPError Device3DQueryConfig(NPP id, static NPError Device3DInitializeContext(NPP id, const NPDeviceConfig* config, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DInitializeContext( static_cast<const NPDeviceContext3DConfig*>(config), @@ -178,7 +178,7 @@ static NPError Device3DSetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t value) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DSetStateContext( static_cast<NPDeviceContext3D*>(context), state, value); @@ -190,7 +190,7 @@ static NPError Device3DGetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DGetStateContext( static_cast<NPDeviceContext3D*>(context), state, value); @@ -202,7 +202,7 @@ static NPError Device3DFlushContext(NPP id, NPDeviceContext* context, NPDeviceFlushContextCallbackPtr callback, void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DFlushContext( id, static_cast<NPDeviceContext3D*>(context), callback, user_data); @@ -212,7 +212,7 @@ static NPError Device3DFlushContext(NPP id, static NPError Device3DDestroyContext(NPP id, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DDestroyContext( static_cast<NPDeviceContext3D*>(context)); @@ -224,7 +224,7 @@ static NPError Device3DCreateBuffer(NPP id, NPDeviceContext* context, size_t size, int32_t* buffer_id) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DCreateBuffer( static_cast<NPDeviceContext3D*>(context), size, buffer_id); @@ -235,7 +235,7 @@ static NPError Device3DCreateBuffer(NPP id, static NPError Device3DDestroyBuffer(NPP id, NPDeviceContext* context, int32_t buffer_id) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DDestroyBuffer( static_cast<NPDeviceContext3D*>(context), buffer_id); @@ -247,7 +247,7 @@ static NPError Device3DMapBuffer(NPP id, NPDeviceContext* context, int32_t buffer_id, NPDeviceBuffer* buffer) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DMapBuffer( static_cast<NPDeviceContext3D*>(context), buffer_id, buffer); @@ -258,7 +258,7 @@ static NPError Device3DMapBuffer(NPP id, // Experimental 3D device API -------------------------------------------------- static NPError Device3DGetNumConfigs(NPP id, int32_t* num_configs) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DGetNumConfigs(num_configs); } @@ -268,7 +268,7 @@ static NPError Device3DGetNumConfigs(NPP id, int32_t* num_configs) { static NPError Device3DGetConfigAttribs(NPP id, int32_t config, int32_t* attrib_list) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DGetConfigAttribs( config, @@ -281,7 +281,7 @@ static NPError Device3DCreateContext(NPP id, int32_t config, const int32_t* attrib_list, NPDeviceContext** context) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DCreateContext( config, @@ -299,7 +299,7 @@ static NPError Device3DSynchronizeContext( int32_t* output_attrib_list, NPDeviceSynchronizeContextCallbackPtr callback, void* callback_data) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DSynchronizeContext( id, @@ -319,7 +319,7 @@ static NPError Device3DRegisterCallback( int32_t callback_type, NPDeviceGenericCallbackPtr callback, void* callback_data) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DRegisterCallback( id, @@ -335,7 +335,7 @@ static NPError Device3DRegisterCallback( static NPError DeviceAudioQueryCapability(NPP id, int32_t capability, int32_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { plugin->webplugin()->delegate()->DeviceAudioQueryCapability(capability, value); @@ -348,7 +348,7 @@ static NPError DeviceAudioQueryCapability(NPP id, int32_t capability, static NPError DeviceAudioQueryConfig(NPP id, const NPDeviceConfig* request, NPDeviceConfig* obtain) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->DeviceAudioQueryConfig( static_cast<const NPDeviceContextAudioConfig*>(request), @@ -360,7 +360,7 @@ static NPError DeviceAudioQueryConfig(NPP id, static NPError DeviceAudioInitializeContext(NPP id, const NPDeviceConfig* config, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->DeviceAudioInitializeContext( static_cast<const NPDeviceContextAudioConfig*>(config), @@ -373,7 +373,7 @@ static NPError DeviceAudioSetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t value) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->DeviceAudioSetStateContext( static_cast<NPDeviceContextAudio*>(context), state, value); @@ -385,7 +385,7 @@ static NPError DeviceAudioGetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); return plugin->webplugin()->delegate()->DeviceAudioGetStateContext( static_cast<NPDeviceContextAudio*>(context), state, value); } @@ -394,14 +394,14 @@ static NPError DeviceAudioFlushContext(NPP id, NPDeviceContext* context, NPDeviceFlushContextCallbackPtr callback, void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); return plugin->webplugin()->delegate()->DeviceAudioFlushContext( id, static_cast<NPDeviceContextAudio*>(context), callback, user_data); } static NPError DeviceAudioDestroyContext(NPP id, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); return plugin->webplugin()->delegate()->DeviceAudioDestroyContext( static_cast<NPDeviceContextAudio*>(context)); } @@ -477,7 +477,7 @@ static NPError ChooseFile(NPP id, NPChooseFileMode mode, NPChooseFileCallback callback, void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (!plugin) return NPERR_GENERIC_ERROR; @@ -490,7 +490,7 @@ static NPError ChooseFile(NPP id, } static void NumberOfFindResultsChanged(NPP id, int total, bool final_result) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) { plugin->webplugin()->delegate()->NumberOfFindResultsChanged( total, final_result); @@ -498,13 +498,13 @@ static void NumberOfFindResultsChanged(NPP id, int total, bool final_result) { } static void SelectedFindResultChanged(NPP id, int index) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->webplugin()->delegate()->SelectedFindResultChanged(index); } static NPWidgetExtensions* GetWidgetExtensions(NPP id) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (!plugin) return NULL; @@ -512,7 +512,7 @@ static NPWidgetExtensions* GetWidgetExtensions(NPP id) { } static NPError NPSetCursor(NPP id, NPCursorType type) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (!plugin) return NPERR_GENERIC_ERROR; @@ -521,7 +521,7 @@ static NPError NPSetCursor(NPP id, NPCursorType type) { } static NPFontExtensions* GetFontExtensions(NPP id) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (!plugin) return NULL; diff --git a/webkit/glue/plugins/plugin_host.cc b/webkit/glue/plugins/plugin_host.cc index add6c03..6345fb1 100644 --- a/webkit/glue/plugins/plugin_host.cc +++ b/webkit/glue/plugins/plugin_host.cc @@ -280,7 +280,7 @@ extern "C" { // Allocates memory from the host's memory space. void* NPN_MemAlloc(uint32_t size) { - scoped_refptr<NPAPI::PluginHost> host = NPAPI::PluginHost::Singleton(); + scoped_refptr<NPAPI::PluginHost> host(NPAPI::PluginHost::Singleton()); if (host != NULL) { // Note: We must use the same allocator/deallocator // that is used by the javascript library, as some of the @@ -293,7 +293,7 @@ void* NPN_MemAlloc(uint32_t size) { // Deallocates memory from the host's memory space void NPN_MemFree(void* ptr) { - scoped_refptr<NPAPI::PluginHost> host = NPAPI::PluginHost::Singleton(); + scoped_refptr<NPAPI::PluginHost> host(NPAPI::PluginHost::Singleton()); if (host != NULL) { if (ptr != NULL && ptr != reinterpret_cast<void*>(-1)) free(ptr); @@ -318,8 +318,8 @@ NPError NPN_RequestRead(NPStream* stream, NPByteRange* range_list) { if (!stream || !range_list) return NPERR_GENERIC_ERROR; - scoped_refptr<NPAPI::PluginInstance> plugin = - reinterpret_cast<NPAPI::PluginInstance*>(stream->ndata); + scoped_refptr<NPAPI::PluginInstance> plugin( + reinterpret_cast<NPAPI::PluginInstance*>(stream->ndata)); if (!plugin.get()) return NPERR_GENERIC_ERROR; @@ -336,7 +336,7 @@ static NPError GetURLNotify(NPP id, if (!url) return NPERR_INVALID_URL; - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (!plugin.get()) { NOTREACHED(); return NPERR_GENERIC_ERROR; @@ -401,7 +401,7 @@ static NPError PostURLNotify(NPP id, if (!url) return NPERR_INVALID_URL; - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (!plugin.get()) { NOTREACHED(); return NPERR_GENERIC_ERROR; @@ -548,7 +548,7 @@ NPError NPN_DestroyStream(NPP id, NPStream* stream, NPReason reason) { // // - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin.get() == NULL) { NOTREACHED(); return NPERR_GENERIC_ERROR; @@ -610,7 +610,7 @@ void NPN_InvalidateRect(NPP id, NPRect *invalidRect) { // plug-ins at regularly timed intervals. To force a paint message, the // plug-in can call NPN_ForceRedraw after calling this method. - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); DCHECK(plugin.get() != NULL); if (plugin.get() && plugin->webplugin()) { if (invalidRect) { @@ -644,7 +644,7 @@ void NPN_InvalidateRegion(NPP id, NPRegion invalidRegion) { // TODO: this is overkill--add platform-specific region handling (at the // very least, fetch the region's bounding box and pass it to InvalidateRect). - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); DCHECK(plugin.get() != NULL); if (plugin.get() && plugin->webplugin()) plugin->webplugin()->Invalidate(); @@ -673,7 +673,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { switch (static_cast<int>(variable)) { case NPNVWindowNPObject: { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); NPObject *np_object = plugin->webplugin()->GetWindowScriptNPObject(); // Return value is expected to be retained, as // described here: @@ -689,7 +689,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { break; } case NPNVPluginElementNPObject: { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); NPObject *np_object = plugin->webplugin()->GetPluginElement(); // Return value is expected to be retained, as // described here: @@ -743,7 +743,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { } case NPNVprivateModeBool: { NPBool* private_mode = reinterpret_cast<NPBool*>(value); - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); *private_mode = plugin->webplugin()->IsOffTheRecord(); rv = NPERR_NO_ERROR; break; @@ -758,7 +758,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { // we still need to worry about future standard change that may conflict // with the variable definition, in order to avoid duplicate case clauses // in this big switch statement. - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin->plugin_lib()->plugin_info().path.value() == kDefaultPluginLibraryName) { plugin->webplugin()->OnMissingPluginStatus( @@ -769,7 +769,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { #if defined(OS_MACOSX) case NPNVpluginDrawingModel: { // return the drawing model that was negotiated when we initialized. - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); *reinterpret_cast<int*>(value) = plugin->drawing_model(); rv = NPERR_NO_ERROR; break; @@ -838,7 +838,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { NPError NPN_SetValue(NPP id, NPPVariable variable, void* value) { // Allows the plugin to set various modes - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); switch(variable) { case NPPVpluginWindowBool: { // Sets windowless mode for display of the plugin @@ -923,13 +923,13 @@ void* NPN_GetJavaPeer(NPP) { } void NPN_PushPopupsEnabledState(NPP id, NPBool enabled) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->PushPopupsEnabledState(enabled ? true : false); } void NPN_PopPopupsEnabledState(NPP id) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->PopPopupsEnabledState(); } @@ -937,7 +937,7 @@ void NPN_PopPopupsEnabledState(NPP id) { void NPN_PluginThreadAsyncCall(NPP id, void (*func)(void*), void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->PluginThreadAsyncCall(func, user_data); } @@ -965,7 +965,7 @@ NPError NPN_GetValueForURL(NPP id, break; } case NPNURLVCookie: { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (!plugin) return NPERR_GENERIC_ERROR; @@ -1005,7 +1005,7 @@ NPError NPN_SetValueForURL(NPP id, switch (variable) { case NPNURLVCookie: { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (!plugin) return NPERR_GENERIC_ERROR; @@ -1051,7 +1051,7 @@ uint32_t NPN_ScheduleTimer(NPP id, uint32_t interval, NPBool repeat, void (*func)(NPP id, uint32_t timer_id)) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (!plugin) return 0; @@ -1059,7 +1059,7 @@ uint32_t NPN_ScheduleTimer(NPP id, } void NPN_UnscheduleTimer(NPP id, uint32_t timer_id) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->UnscheduleTimer(timer_id); } @@ -1068,7 +1068,7 @@ NPError NPN_PopUpContextMenu(NPP id, NPMenu* menu) { if (!menu) return NPERR_INVALID_PARAM; - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin.get()) { return plugin->PopUpContextMenu(menu); } @@ -1080,7 +1080,7 @@ NPBool NPN_ConvertPoint(NPP id, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); if (plugin.get()) { return plugin->ConvertPoint(sourceX, sourceY, sourceSpace, destX, destY, destSpace); diff --git a/webkit/glue/plugins/plugin_lib_unittest.cc b/webkit/glue/plugins/plugin_lib_unittest.cc index 5ac6bdc..45c4bb6 100644 --- a/webkit/glue/plugins/plugin_lib_unittest.cc +++ b/webkit/glue/plugins/plugin_lib_unittest.cc @@ -25,7 +25,7 @@ TEST(PluginLibLoading, UnloadAllPlugins) { PluginLibTest::CreatePluginLib(FilePath())); // Try with a single plugin lib. - scoped_refptr<PluginLibTest> plugin_lib1 = new PluginLibTest(); + scoped_refptr<PluginLibTest> plugin_lib1(new PluginLibTest()); NPAPI::PluginLib::UnloadAllPlugins(); // Need to create it again, it should have been destroyed above. @@ -34,7 +34,7 @@ TEST(PluginLibLoading, UnloadAllPlugins) { // Try with two plugin libs. plugin_lib1 = new PluginLibTest(); - scoped_refptr<PluginLibTest> plugin_lib2 = new PluginLibTest(); + scoped_refptr<PluginLibTest> plugin_lib2(new PluginLibTest()); NPAPI::PluginLib::UnloadAllPlugins(); // Need to create it again, it should have been destroyed above. diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc index c54bbc8..6907c6f 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl.cc @@ -32,8 +32,8 @@ WebPluginDelegateImpl* WebPluginDelegateImpl::Create( const FilePath& filename, const std::string& mime_type, gfx::PluginWindowHandle containing_view) { - scoped_refptr<NPAPI::PluginLib> plugin_lib = - NPAPI::PluginLib::CreatePluginLib(filename); + scoped_refptr<NPAPI::PluginLib> plugin_lib( + NPAPI::PluginLib::CreatePluginLib(filename)); if (plugin_lib.get() == NULL) return NULL; @@ -41,8 +41,8 @@ WebPluginDelegateImpl* WebPluginDelegateImpl::Create( if (err != NPERR_NO_ERROR) return NULL; - scoped_refptr<NPAPI::PluginInstance> instance = - plugin_lib->CreateInstance(mime_type); + scoped_refptr<NPAPI::PluginInstance> instance( + plugin_lib->CreateInstance(mime_type)); return new WebPluginDelegateImpl(containing_view, instance.get()); } diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index d49e732..019a664 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -267,12 +267,12 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( &WebMediaPlayerImpl::Proxy::NetworkEventCallback)); // A simple data source that keeps all data in memory. - scoped_refptr<SimpleDataSource> simple_data_source = - new SimpleDataSource(MessageLoop::current(), bridge_factory_simple); + scoped_refptr<SimpleDataSource> simple_data_source( + new SimpleDataSource(MessageLoop::current(), bridge_factory_simple)); // A sophisticated data source that does memory caching. - scoped_refptr<BufferedDataSource> buffered_data_source = - new BufferedDataSource(MessageLoop::current(), bridge_factory_buffered); + scoped_refptr<BufferedDataSource> buffered_data_source( + new BufferedDataSource(MessageLoop::current(), bridge_factory_buffered)); proxy_->SetDataSource(buffered_data_source); if (use_simple_data_source) { @@ -633,8 +633,8 @@ WebKit::WebVideoFrame* WebMediaPlayerImpl::getCurrentFrame() { void WebMediaPlayerImpl::putCurrentFrame( WebKit::WebVideoFrame* web_video_frame) { if (web_video_frame) { - scoped_refptr<media::VideoFrame> video_frame = - WebVideoFrameImpl::toVideoFrame(web_video_frame); + scoped_refptr<media::VideoFrame> video_frame( + WebVideoFrameImpl::toVideoFrame(web_video_frame)); proxy_->PutCurrentFrame(video_frame); delete web_video_frame; } diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc index f1aae3d..e2dbf4c 100644 --- a/webkit/support/webkit_support.cc +++ b/webkit/support/webkit_support.cc @@ -289,8 +289,8 @@ WebKit::WebMediaPlayer* CreateMediaPlayer(WebFrame* frame, appcache_host ? appcache_host->host_id() : appcache::kNoHostId, 0); - scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer = - new webkit_glue::VideoRendererImpl(false); + scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( + new webkit_glue::VideoRendererImpl(false)); collection.push_back(video_renderer); return new webkit_glue::WebMediaPlayerImpl( diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc index 954b258..623683b 100644 --- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc +++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc @@ -855,7 +855,7 @@ void SimpleResourceLoaderBridge::SetCookie(const GURL& url, return; } - scoped_refptr<CookieSetter> cookie_setter = new CookieSetter(); + scoped_refptr<CookieSetter> cookie_setter(new CookieSetter()); g_io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( cookie_setter.get(), &CookieSetter::Set, url, cookie)); } @@ -870,7 +870,7 @@ std::string SimpleResourceLoaderBridge::GetCookies( return std::string(); } - scoped_refptr<CookieGetter> getter = new CookieGetter(); + scoped_refptr<CookieGetter> getter(new CookieGetter()); g_io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( getter.get(), &CookieGetter::Get, url)); diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index e6d43f1..a5a76ed 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -740,8 +740,8 @@ WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( appcache_host ? appcache_host->host_id() : appcache::kNoHostId, 0); - scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer = - new webkit_glue::VideoRendererImpl(false); + scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( + new webkit_glue::VideoRendererImpl(false)); collection.push_back(video_renderer); return new webkit_glue::WebMediaPlayerImpl( |