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/blob | |
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/blob')
-rw-r--r-- | webkit/blob/blob_storage_controller.cc | 2 | ||||
-rw-r--r-- | webkit/blob/blob_storage_controller_unittest.cc | 10 | ||||
-rw-r--r-- | webkit/blob/blob_url_request_job_unittest.cc | 16 | ||||
-rw-r--r-- | webkit/blob/deletable_file_reference.cc | 4 |
4 files changed, 16 insertions, 16 deletions
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; } |