diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 05:45:17 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 05:45:17 +0000 |
commit | e59558b78e8c6a1b0bd916a724724b638c3c91b6 (patch) | |
tree | 712268a7e9e1cd552f309d89641b2bed5ad06322 /webkit/appcache | |
parent | 31fcd34da3797bc49160620ef8c94a38652c0587 (diff) | |
download | chromium_src-e59558b78e8c6a1b0bd916a724724b638c3c91b6.zip chromium_src-e59558b78e8c6a1b0bd916a724724b638c3c91b6.tar.gz chromium_src-e59558b78e8c6a1b0bd916a724724b638c3c91b6.tar.bz2 |
Rewrite std::string("") to std::string(), Linux edition.
This patch was generated by running the empty_string clang tool
across the Chromium Linux compilation database. Implicitly or
explicitly constructing std::string() with a "" argument is
inefficient as the caller needs to emit extra instructions to
pass an argument, and the constructor needlessly copies a byte
into internal storage. Rewriting these instances to simply call
the default constructor appears to save ~14-18 kilobytes on an
optimized release build.
BUG=none
Review URL: https://codereview.chromium.org/13145003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache')
-rw-r--r-- | webkit/appcache/appcache_update_job_unittest.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc index 86b3df6..b90e783 100644 --- a/webkit/appcache/appcache_update_job_unittest.cc +++ b/webkit/appcache/appcache_update_job_unittest.cc @@ -2649,7 +2649,7 @@ class AppCacheUpdateJobTest : public testing::Test, // First test against a cache attempt. Will start manifest fetch // synchronously. - HttpHeadersRequestTestJob::Initialize("", ""); + HttpHeadersRequestTestJob::Initialize(std::string(), std::string()); MockFrontend mock_frontend; AppCacheHost host(1, &mock_frontend, service_.get()); update->StartUpdate(&host, GURL()); @@ -2666,7 +2666,7 @@ class AppCacheUpdateJobTest : public testing::Test, net::HttpResponseInfo* response_info = new net::HttpResponseInfo(); response_info->headers = headers; // adds ref to headers - HttpHeadersRequestTestJob::Initialize("", ""); + HttpHeadersRequestTestJob::Initialize(std::string(), std::string()); update = new AppCacheUpdateJob(service_.get(), group_); group_->update_job_ = update; group_->update_status_ = AppCacheGroup::DOWNLOADING; @@ -2687,7 +2687,8 @@ class AppCacheUpdateJobTest : public testing::Test, response_info = new net::HttpResponseInfo(); response_info->headers = headers2; - HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT", ""); + HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT", + std::string()); update = new AppCacheUpdateJob(service_.get(), group_); group_->update_job_ = update; group_->update_status_ = AppCacheGroup::DOWNLOADING; @@ -2703,7 +2704,8 @@ class AppCacheUpdateJobTest : public testing::Test, void IfModifiedSinceUpgradeTest() { ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()); - HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT", ""); + HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT", + std::string()); net::URLRequestJobFactoryImpl* new_factory( new net::URLRequestJobFactoryImpl); new_factory->SetProtocolHandler("http", new IfModifiedSinceJobFactory); @@ -2765,7 +2767,7 @@ class AppCacheUpdateJobTest : public testing::Test, void IfNoneMatchUpgradeTest() { ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()); - HttpHeadersRequestTestJob::Initialize("", "\"LadeDade\""); + HttpHeadersRequestTestJob::Initialize(std::string(), "\"LadeDade\""); net::URLRequestJobFactoryImpl* new_factory( new net::URLRequestJobFactoryImpl); new_factory->SetProtocolHandler("http", new IfModifiedSinceJobFactory); @@ -2827,7 +2829,7 @@ class AppCacheUpdateJobTest : public testing::Test, void IfNoneMatchRefetchTest() { ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()); - HttpHeadersRequestTestJob::Initialize("", "\"LadeDade\""); + HttpHeadersRequestTestJob::Initialize(std::string(), "\"LadeDade\""); net::URLRequestJobFactoryImpl* new_factory( new net::URLRequestJobFactoryImpl); new_factory->SetProtocolHandler("http", new IfModifiedSinceJobFactory); |