summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-07 06:03:30 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-07 06:03:30 +0000
commit26430024d4ba899f13140334e0311f8b586557fa (patch)
tree64e154a9c5e5ee37642340f303531af76e56e3c2 /net
parent5a4c3f5564f8870edca6be511b33f5c38c599c94 (diff)
downloadchromium_src-26430024d4ba899f13140334e0311f8b586557fa.zip
chromium_src-26430024d4ba899f13140334e0311f8b586557fa.tar.gz
chromium_src-26430024d4ba899f13140334e0311f8b586557fa.tar.bz2
Remove 13 exit time constructors and 3 static initializers
BUG=101600,94925 TEST=none TBR=vandebo,viettrungluu Review URL: http://codereview.chromium.org/8487001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/net_util.cc3
-rw-r--r--net/http/http_mac_signature.cc2
-rw-r--r--net/spdy/spdy_settings_storage.cc2
-rw-r--r--net/url_request/url_request.cc7
-rw-r--r--net/url_request/url_request_http_job.cc6
5 files changed, 12 insertions, 8 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index f34f980..2ae1e79 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -496,7 +496,8 @@ static base::Lock lang_set_lock;
// the language |lang|.
bool IsComponentCoveredByLang(const icu::UnicodeSet& component_characters,
const std::string& lang) {
- static const icu::UnicodeSet kASCIILetters(0x61, 0x7a); // [a-z]
+ CR_DEFINE_STATIC_LOCAL(
+ const icu::UnicodeSet, kASCIILetters, ('a', 'z'));
icu::UnicodeSet* lang_set;
// We're called from both the UI thread and the history thread.
{
diff --git a/net/http/http_mac_signature.cc b/net/http/http_mac_signature.cc
index 1e3ea95..93498ef 100644
--- a/net/http/http_mac_signature.cc
+++ b/net/http/http_mac_signature.cc
@@ -132,7 +132,7 @@ bool HttpMacSignature::GenerateHeaderString(const std::string& age,
std::string HttpMacSignature::GenerateNormalizedRequest(
const std::string& age,
const std::string& nonce) {
- static const std::string kNewLine = "\n";
+ const std::string kNewLine = "\n";
std::string normalized_request = age + ":" + nonce + kNewLine;
normalized_request += method_ + kNewLine;
diff --git a/net/spdy/spdy_settings_storage.cc b/net/spdy/spdy_settings_storage.cc
index 9d79c56..f714249 100644
--- a/net/spdy/spdy_settings_storage.cc
+++ b/net/spdy/spdy_settings_storage.cc
@@ -18,7 +18,7 @@ const spdy::SpdySettings& SpdySettingsStorage::Get(
const HostPortPair& host_port_pair) const {
SettingsMap::const_iterator it = settings_map_.find(host_port_pair);
if (it == settings_map_.end()) {
- static const spdy::SpdySettings kEmpty;
+ CR_DEFINE_STATIC_LOCAL(spdy::SpdySettings, kEmpty, ());
return kEmpty;
}
return it->second;
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 0e3c984..66d629b 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
+#include "base/lazy_instance.h"
#include "base/memory/singleton.h"
#include "base/message_loop.h"
#include "base/metrics/stats_counters.h"
@@ -55,11 +56,13 @@ void StripPostSpecificHeaders(HttpRequestHeaders* headers) {
uint64 g_next_url_request_identifier = 1;
// This lock protects g_next_url_request_identifier.
-base::Lock g_next_url_request_identifier_lock;
+base::LazyInstance<base::Lock,
+ base::LeakyLazyInstanceTraits<base::Lock> >
+ g_next_url_request_identifier_lock(base::LINKER_INITIALIZED);
// Returns an prior unused identifier for URL requests.
uint64 GenerateURLRequestIdentifier() {
- base::AutoLock lock(g_next_url_request_identifier_lock);
+ base::AutoLock lock(g_next_url_request_identifier_lock.Get());
return g_next_url_request_identifier++;
}
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 33887db..889fba86 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -255,7 +255,7 @@ void URLRequestHttpJob::NotifyHeadersComplete() {
if (SdchManager::Global() &&
SdchManager::Global()->IsInSupportedDomain(request_->url())) {
- static const std::string name = "Get-Dictionary";
+ const std::string name = "Get-Dictionary";
std::string url_text;
void* iter = NULL;
// TODO(jar): We need to not fetch dictionaries the first time they are
@@ -592,7 +592,7 @@ void URLRequestHttpJob::CookieHandled() {
void URLRequestHttpJob::FetchResponseCookies(
std::vector<std::string>* cookies) {
- std::string name = "Set-Cookie";
+ const std::string name = "Set-Cookie";
std::string value;
void* iter = NULL;
@@ -614,7 +614,7 @@ void URLRequestHttpJob::ProcessStrictTransportSecurityHeader() {
const bool valid_https =
https && !IsCertStatusError(response_info_->ssl_info.cert_status);
- std::string name = "Strict-Transport-Security";
+ const std::string name = "Strict-Transport-Security";
std::string value;
int max_age;