diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 19:28:44 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 19:28:44 +0000 |
commit | 528c56de01bbbd38788ed6cf8d2eea4c56cbe19e (patch) | |
tree | ac4f7a001affd772c4ab89701d3d46109b5f9e19 /net/http | |
parent | 5c86ada8d84f6e67d17b027d347052ef451241c4 (diff) | |
download | chromium_src-528c56de01bbbd38788ed6cf8d2eea4c56cbe19e.zip chromium_src-528c56de01bbbd38788ed6cf8d2eea4c56cbe19e.tar.gz chromium_src-528c56de01bbbd38788ed6cf8d2eea4c56cbe19e.tar.bz2 |
Move the number conversions from string_util to a new file.
Use the base namespace in the new file. Update callers.
I removed all wstring variants and also the string->number ones that ignore the return value. That encourages people to write code and forget about error handling.
TEST=included unit tests
BUG=none
Review URL: http://codereview.chromium.org/3056029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_cache.cc | 3 | ||||
-rw-r--r-- | net/http/http_network_transaction.cc | 5 | ||||
-rw-r--r-- | net/http/partial_data.cc | 7 |
3 files changed, 9 insertions, 6 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index dbd6bf1..ad72bea 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -19,6 +19,7 @@ #include "base/ref_counted.h" #include "base/stl_util-inl.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "net/base/io_buffer.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" @@ -466,7 +467,7 @@ std::string HttpCache::GenerateCacheKey(const HttpRequestInfo* request) { (*playback_cache_map_)[url] = generation + 1; // The key into the cache is GENERATION # + METHOD + URL. - std::string result = IntToString(generation); + std::string result = base::IntToString(generation); result.append(request->method); result.append(url); return result; diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index a9d557f..f54db4f 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -15,6 +15,7 @@ #include "base/stats_counters.h" #include "base/stl_util-inl.h" #include "base/string_util.h" +#include "base/string_number_conversions.h" #include "build/build_config.h" #include "googleurl/src/gurl.h" #include "net/base/connection_type_histograms.h" @@ -650,7 +651,7 @@ int HttpNetworkTransaction::DoResolveProxy() { if (g_host_mapping_rules && g_host_mapping_rules->RewriteHost(&endpoint_)) { url_canon::Replacements<char> replacements; - const std::string port_str = IntToString(endpoint_.port()); + const std::string port_str = base::IntToString(endpoint_.port()); replacements.SetPort(port_str.c_str(), url_parse::Component(0, port_str.size())); replacements.SetHost(endpoint_.host().c_str(), @@ -677,7 +678,7 @@ int HttpNetworkTransaction::DoResolveProxy() { url_canon::Replacements<char> replacements; replacements.SetScheme("https", url_parse::Component(0, strlen("https"))); - const std::string port_str = IntToString(endpoint_.port()); + const std::string port_str = base::IntToString(endpoint_.port()); replacements.SetPort(port_str.c_str(), url_parse::Component(0, port_str.size())); alternate_endpoint_url = diff --git a/net/http/partial_data.cc b/net/http/partial_data.cc index 49d68d2..8964903 100644 --- a/net/http/partial_data.cc +++ b/net/http/partial_data.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,6 +6,7 @@ #include "base/format_macros.h" #include "base/logging.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "net/base/net_errors.h" #include "net/disk_cache/disk_cache.h" @@ -25,9 +26,9 @@ void AddRangeHeader(int64 start, int64 end, HttpRequestHeaders* headers) { DCHECK(start >= 0 || end >= 0); std::string my_start, my_end; if (start >= 0) - my_start = Int64ToString(start); + my_start = base::Int64ToString(start); if (end >= 0) - my_end = Int64ToString(end); + my_end = base::Int64ToString(end); headers->SetHeader( HttpRequestHeaders::kRange, |