diff options
author | brettw <brettw@chromium.org> | 2015-06-12 16:46:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-12 23:47:38 +0000 |
commit | 17b32adf2de02e5a4cdf1c0195bb3b06c721b2ca (patch) | |
tree | e9f2d2a996fcf9f5f77a548f8471b0b5a5ac4142 /net | |
parent | b8cce88bf27fe0bb4614c401d7c5bdbf193c587f (diff) | |
download | chromium_src-17b32adf2de02e5a4cdf1c0195bb3b06c721b2ca.zip chromium_src-17b32adf2de02e5a4cdf1c0195bb3b06c721b2ca.tar.gz chromium_src-17b32adf2de02e5a4cdf1c0195bb3b06c721b2ca.tar.bz2 |
Move EndsWith to base namespace.
TBR=jschuh@chromium.org
Review URL: https://codereview.chromium.org/1182183003
Cr-Commit-Position: refs/heads/master@{#334284}
Diffstat (limited to 'net')
-rw-r--r-- | net/base/mime_util.cc | 4 | ||||
-rw-r--r-- | net/base/net_util.cc | 2 | ||||
-rw-r--r-- | net/http/http_network_transaction.cc | 2 | ||||
-rw-r--r-- | net/http/http_server_properties_impl.cc | 8 | ||||
-rw-r--r-- | net/quic/crypto/quic_crypto_client_config.cc | 2 | ||||
-rw-r--r-- | net/server/http_server_unittest.cc | 6 | ||||
-rw-r--r-- | net/spdy/spdy_session.cc | 2 | ||||
-rw-r--r-- | net/spdy/spdy_session_test_util.cc | 6 | ||||
-rw-r--r-- | net/tools/flip_server/mem_cache.cc | 2 | ||||
-rw-r--r-- | net/websockets/websocket_stream_cookie_test.cc | 2 |
10 files changed, 18 insertions, 18 deletions
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc index 4468fc4..dee8892 100644 --- a/net/base/mime_util.cc +++ b/net/base/mime_util.cc @@ -286,7 +286,7 @@ bool MimeUtil::MatchesMimeType(const std::string& mime_type_pattern, if (!base::StartsWithASCII(base_type, left, false)) return false; - if (!right.empty() && !EndsWith(base_type, right, false)) + if (!right.empty() && !base::EndsWith(base_type, right, false)) return false; return MatchesMimeTypeParameters(mime_type_pattern, mime_type); @@ -521,7 +521,7 @@ void GetExtensionsForMimeType( const std::string mime_type = base::StringToLowerASCII(unsafe_mime_type); base::hash_set<base::FilePath::StringType> unique_extensions; - if (EndsWith(mime_type, "/*", false)) { + if (base::EndsWith(mime_type, "/*", false)) { std::string leading_mime_type = mime_type.substr(0, mime_type.length() - 1); // Find the matching StandardType from within kStandardTypes, or fall diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 04733a8..2239cc4 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -794,7 +794,7 @@ bool HasGoogleHost(const GURL& url) { }; const std::string& host = url.host(); for (const char* suffix : kGoogleHostSuffixes) { - if (EndsWith(host, suffix, false)) + if (base::EndsWith(host, suffix, false)) return true; } return false; diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index c8b8226..f60bb57 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -1444,7 +1444,7 @@ void HttpNetworkTransaction::RecordSSLFallbackMetrics(int result) { return; const std::string& host = request_->url.host(); - bool is_google = EndsWith(host, "google.com", true) && + bool is_google = base::EndsWith(host, "google.com", true) && (host.size() == 10 || host[host.size() - 11] == '.'); if (is_google) { // Some fraction of successful connections use the fallback, but only due to diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc index d5c6559..1f667a1 100644 --- a/net/http/http_server_properties_impl.cc +++ b/net/http/http_server_properties_impl.cc @@ -89,7 +89,7 @@ void HttpServerPropertiesImpl::InitializeAlternativeServiceServers( for (AlternativeServiceMap::const_iterator it = alternative_service_map_.begin(); it != alternative_service_map_.end(); ++it) { - if (EndsWith(it->first.host(), canonical_suffixes_[i], false)) { + if (base::EndsWith(it->first.host(), canonical_suffixes_[i], false)) { canonical_host_to_origin_map_[canonical_host] = it->first; break; } @@ -226,7 +226,7 @@ std::string HttpServerPropertiesImpl::GetCanonicalSuffix( // suffix. for (size_t i = 0; i < canonical_suffixes_.size(); ++i) { std::string canonical_suffix = canonical_suffixes_[i]; - if (EndsWith(host, canonical_suffixes_[i], false)) { + if (base::EndsWith(host, canonical_suffixes_[i], false)) { return canonical_suffix; } } @@ -315,7 +315,7 @@ void HttpServerPropertiesImpl::SetAlternativeService( // canonical host. for (size_t i = 0; i < canonical_suffixes_.size(); ++i) { std::string canonical_suffix = canonical_suffixes_[i]; - if (EndsWith(origin.host(), canonical_suffixes_[i], false)) { + if (base::EndsWith(origin.host(), canonical_suffixes_[i], false)) { HostPortPair canonical_host(canonical_suffix, origin.port()); canonical_host_to_origin_map_[canonical_host] = origin; break; @@ -557,7 +557,7 @@ HttpServerPropertiesImpl::CanonicalHostMap::const_iterator HttpServerPropertiesImpl::GetCanonicalHost(HostPortPair server) const { for (size_t i = 0; i < canonical_suffixes_.size(); ++i) { std::string canonical_suffix = canonical_suffixes_[i]; - if (EndsWith(server.host(), canonical_suffixes_[i], false)) { + if (base::EndsWith(server.host(), canonical_suffixes_[i], false)) { HostPortPair canonical_host(canonical_suffix, server.port()); return canonical_host_to_origin_map_.find(canonical_host); } diff --git a/net/quic/crypto/quic_crypto_client_config.cc b/net/quic/crypto/quic_crypto_client_config.cc index 3ad3876..cd4887f 100644 --- a/net/quic/crypto/quic_crypto_client_config.cc +++ b/net/quic/crypto/quic_crypto_client_config.cc @@ -904,7 +904,7 @@ bool QuicCryptoClientConfig::PopulateFromCanonicalConfig( DCHECK(server_state->IsEmpty()); size_t i = 0; for (; i < canonical_suffixes_.size(); ++i) { - if (EndsWith(server_id.host(), canonical_suffixes_[i], false)) { + if (base::EndsWith(server_id.host(), canonical_suffixes_[i], false)) { break; } } diff --git a/net/server/http_server_unittest.cc b/net/server/http_server_unittest.cc index 09b6bf4..c76ae63 100644 --- a/net/server/http_server_unittest.cc +++ b/net/server/http_server_unittest.cc @@ -443,7 +443,7 @@ TEST_F(HttpServerTest, Send200) { std::string response; ASSERT_TRUE(client.ReadResponse(&response)); ASSERT_TRUE(base::StartsWithASCII(response, "HTTP/1.1 200 OK", true)); - ASSERT_TRUE(EndsWith(response, "Response!", true)); + ASSERT_TRUE(base::EndsWith(response, "Response!", true)); } TEST_F(HttpServerTest, SendRaw) { @@ -592,7 +592,7 @@ TEST_F(HttpServerTest, MultipleRequestsOnSameConnection) { std::string response1; ASSERT_TRUE(client.ReadResponse(&response1)); ASSERT_TRUE(base::StartsWithASCII(response1, "HTTP/1.1 200 OK", true)); - ASSERT_TRUE(EndsWith(response1, "Content for /test", true)); + ASSERT_TRUE(base::EndsWith(response1, "Content for /test", true)); client.Send("GET /test2 HTTP/1.1\r\n\r\n"); ASSERT_TRUE(RunUntilRequestsReceived(2)); @@ -613,7 +613,7 @@ TEST_F(HttpServerTest, MultipleRequestsOnSameConnection) { std::string response3; ASSERT_TRUE(client.ReadResponse(&response3)); ASSERT_TRUE(base::StartsWithASCII(response3, "HTTP/1.1 200 OK", true)); - ASSERT_TRUE(EndsWith(response3, "Content for /test3", true)); + ASSERT_TRUE(base::EndsWith(response3, "Content for /test3", true)); } class CloseOnConnectHttpServerTest : public HttpServerTest { diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index dab2aec..9ed7e65 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -2975,7 +2975,7 @@ void SpdySession::RecordProtocolErrorHistogram( SpdyProtocolErrorDetails details) { UMA_HISTOGRAM_ENUMERATION("Net.SpdySessionErrorDetails2", details, NUM_SPDY_PROTOCOL_ERROR_DETAILS); - if (EndsWith(host_port_pair().host(), "google.com", false)) { + if (base::EndsWith(host_port_pair().host(), "google.com", false)) { UMA_HISTOGRAM_ENUMERATION("Net.SpdySessionErrorDetails_Google2", details, NUM_SPDY_PROTOCOL_ERROR_DETAILS); } diff --git a/net/spdy/spdy_session_test_util.cc b/net/spdy/spdy_session_test_util.cc index d901cf6..e817ce1 100644 --- a/net/spdy/spdy_session_test_util.cc +++ b/net/spdy/spdy_session_test_util.cc @@ -28,9 +28,9 @@ void SpdySessionTestTaskObserver::WillProcessTask( void SpdySessionTestTaskObserver::DidProcessTask( const base::PendingTask& pending_task) { - if (EndsWith(pending_task.posted_from.file_name(), file_name_, true) && - EndsWith(pending_task.posted_from.function_name(), function_name_, - true)) { + if (base::EndsWith(pending_task.posted_from.file_name(), file_name_, true) && + base::EndsWith(pending_task.posted_from.function_name(), function_name_, + true)) { ++executed_count_; } } diff --git a/net/tools/flip_server/mem_cache.cc b/net/tools/flip_server/mem_cache.cc index 521f56c..b280b98 100644 --- a/net/tools/flip_server/mem_cache.cc +++ b/net/tools/flip_server/mem_cache.cc @@ -204,7 +204,7 @@ void MemoryCache::ReadAndStoreFileContents(const char* filename) { FileData* MemoryCache::GetFileData(const std::string& filename) { Files::iterator fi = files_.end(); - if (EndsWith(filename, ".html", true)) { + if (base::EndsWith(filename, ".html", true)) { fi = files_.find(filename.substr(0, filename.size() - 5) + ".http"); } if (fi == files_.end()) diff --git a/net/websockets/websocket_stream_cookie_test.cc b/net/websockets/websocket_stream_cookie_test.cc index 9b819b5..8e4d9c4 100644 --- a/net/websockets/websocket_stream_cookie_test.cc +++ b/net/websockets/websocket_stream_cookie_test.cc @@ -35,7 +35,7 @@ class TestBase : public WebSocketStreamCreateTestBase { // We assume cookie_header ends with CRLF if not empty, as // WebSocketStandardRequestWithCookies requires. Use AddCRLFIfNotEmpty // in a call site. - CHECK(cookie_header.empty() || EndsWith(cookie_header, "\r\n", true)); + CHECK(cookie_header.empty() || base::EndsWith(cookie_header, "\r\n", true)); url_request_context_host_.SetExpectations( WebSocketStandardRequestWithCookies(url.path(), url.host(), origin, |