Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Unified Diff: net/url_request/url_request_filter.cc

Issue 1869503003: Convert //net and //chromecast to std::unordered_* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix cast Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_filter.cc
diff --git a/net/url_request/url_request_filter.cc b/net/url_request/url_request_filter.cc
index 83248e2fba78a921d7c3e7d1b1adb96415eae405..be11b177822ca9c3b0be22a0e2e08388e4d3b1db 100644
--- a/net/url_request/url_request_filter.cc
+++ b/net/url_request/url_request_filter.cc
@@ -57,9 +57,8 @@ void URLRequestFilter::AddHostnameInterceptor(
#ifndef NDEBUG
// Check to see if we're masking URLs in the url_interceptor_map_.
- for (URLInterceptorMap::const_iterator it = url_interceptor_map_.begin();
- it != url_interceptor_map_.end(); ++it) {
- const GURL& url = GURL(it->first);
+ for (const auto& pair : url_interceptor_map_) {
+ const GURL& url = GURL(pair.first);
HostnameInterceptorMap::const_iterator host_it =
hostname_interceptor_map_.find(make_pair(url.scheme(), url.host()));
if (host_it != hostname_interceptor_map_.end())
@@ -86,7 +85,7 @@ bool URLRequestFilter::AddUrlInterceptor(
if (!url.is_valid())
return false;
DCHECK_EQ(0u, url_interceptor_map_.count(url.spec()));
- url_interceptor_map_.set(url.spec(), std::move(interceptor));
+ url_interceptor_map_[url.spec()] = std::move(interceptor);
// Check to see if this URL is masked by a hostname handler.
DCHECK_EQ(0u, hostname_interceptor_map_.count(make_pair(url.scheme(),
@@ -97,7 +96,7 @@ bool URLRequestFilter::AddUrlInterceptor(
void URLRequestFilter::RemoveUrlHandler(const GURL& url) {
DCHECK(OnMessageLoopForInterceptorRemoval());
- int removed = url_interceptor_map_.erase(url.spec());
+ size_t removed = url_interceptor_map_.erase(url.spec());
DCHECK(removed);
// Note that we don't unregister from the URLRequest ProtocolFactory as
// this would leave no protocol factory for the remaining hostname and URL

Powered by Google App Engine
This is Rietveld 408576698