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

Side by Side Diff: net/proxy/mojo_proxy_resolver_factory_impl.cc

Issue 2229393003: net: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/proxy/mojo_proxy_resolver_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/proxy/mojo_proxy_resolver_factory_impl.h" 5 #include "net/proxy/mojo_proxy_resolver_factory_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request) 124 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request)
125 : proxy_resolver_impl_factory_(std::move(proxy_resolver_factory)), 125 : proxy_resolver_impl_factory_(std::move(proxy_resolver_factory)),
126 binding_(this, std::move(request)) {} 126 binding_(this, std::move(request)) {}
127 127
128 MojoProxyResolverFactoryImpl::MojoProxyResolverFactoryImpl( 128 MojoProxyResolverFactoryImpl::MojoProxyResolverFactoryImpl(
129 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request) 129 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request)
130 : MojoProxyResolverFactoryImpl(ProxyResolverV8TracingFactory::Create(), 130 : MojoProxyResolverFactoryImpl(ProxyResolverV8TracingFactory::Create(),
131 std::move(request)) {} 131 std::move(request)) {}
132 132
133 MojoProxyResolverFactoryImpl::~MojoProxyResolverFactoryImpl() { 133 MojoProxyResolverFactoryImpl::~MojoProxyResolverFactoryImpl() {
134 STLDeleteElements(&jobs_); 134 base::STLDeleteElements(&jobs_);
135 } 135 }
136 136
137 void MojoProxyResolverFactoryImpl::CreateResolver( 137 void MojoProxyResolverFactoryImpl::CreateResolver(
138 const mojo::String& pac_script, 138 const mojo::String& pac_script,
139 mojo::InterfaceRequest<interfaces::ProxyResolver> request, 139 mojo::InterfaceRequest<interfaces::ProxyResolver> request,
140 interfaces::ProxyResolverFactoryRequestClientPtr client) { 140 interfaces::ProxyResolverFactoryRequestClientPtr client) {
141 // The Job will call RemoveJob on |this| when either the create request 141 // The Job will call RemoveJob on |this| when either the create request
142 // finishes or |request| or |client| encounters a connection error. 142 // finishes or |request| or |client| encounters a connection error.
143 jobs_.insert(new Job( 143 jobs_.insert(new Job(
144 this, ProxyResolverScriptData::FromUTF8(pac_script.To<std::string>()), 144 this, ProxyResolverScriptData::FromUTF8(pac_script.To<std::string>()),
145 proxy_resolver_impl_factory_.get(), std::move(request), 145 proxy_resolver_impl_factory_.get(), std::move(request),
146 std::move(client))); 146 std::move(client)));
147 } 147 }
148 148
149 void MojoProxyResolverFactoryImpl::RemoveJob(Job* job) { 149 void MojoProxyResolverFactoryImpl::RemoveJob(Job* job) {
150 size_t erased = jobs_.erase(job); 150 size_t erased = jobs_.erase(job);
151 DCHECK_EQ(1u, erased); 151 DCHECK_EQ(1u, erased);
152 delete job; 152 delete job;
153 } 153 }
154 154
155 } // namespace net 155 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/proxy/mojo_proxy_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698