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

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

Issue 2691393002: Fix auto raw pointer deduction on linux (Closed)
Patch Set: rebase Created 3 years, 10 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
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_impl.h" 5 #include "net/proxy/mojo_proxy_resolver_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 std::vector<std::unique_ptr<Job>> pending_jobs_; 163 std::vector<std::unique_ptr<Job>> pending_jobs_;
164 }; 164 };
165 165
166 void MockProxyResolverV8Tracing::GetProxyForURL( 166 void MockProxyResolverV8Tracing::GetProxyForURL(
167 const GURL& url, 167 const GURL& url,
168 ProxyInfo* results, 168 ProxyInfo* results,
169 const CompletionCallback& callback, 169 const CompletionCallback& callback,
170 std::unique_ptr<ProxyResolver::Request>* request, 170 std::unique_ptr<ProxyResolver::Request>* request,
171 std::unique_ptr<Bindings> bindings) { 171 std::unique_ptr<Bindings> bindings) {
172 pending_jobs_.push_back(base::WrapUnique(new Job())); 172 pending_jobs_.push_back(base::WrapUnique(new Job()));
173 auto pending_job = pending_jobs_.back().get(); 173 auto* pending_job = pending_jobs_.back().get();
174 pending_job->url = url; 174 pending_job->url = url;
175 pending_job->results = results; 175 pending_job->results = results;
176 pending_job->SetCallback(callback); 176 pending_job->SetCallback(callback);
177 request->reset(new RequestImpl(pending_job, this)); 177 request->reset(new RequestImpl(pending_job, this));
178 } 178 }
179 179
180 180
181 void MockProxyResolverV8Tracing::WaitForCancel() { 181 void MockProxyResolverV8Tracing::WaitForCancel() {
182 while (std::find_if(pending_jobs_.begin(), pending_jobs_.end(), 182 while (std::find_if(pending_jobs_.begin(), pending_jobs_.end(),
183 [](const std::unique_ptr<Job>& job) { 183 [](const std::unique_ptr<Job>& job) {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 interfaces::ProxyResolverRequestClientPtr client_ptr; 333 interfaces::ProxyResolverRequestClientPtr client_ptr;
334 TestRequestClient client(mojo::MakeRequest(&client_ptr)); 334 TestRequestClient client(mojo::MakeRequest(&client_ptr));
335 335
336 resolver_->GetProxyForUrl(GURL("http://example.com"), std::move(client_ptr)); 336 resolver_->GetProxyForUrl(GURL("http://example.com"), std::move(client_ptr));
337 ASSERT_EQ(1u, mock_proxy_resolver_->pending_jobs().size()); 337 ASSERT_EQ(1u, mock_proxy_resolver_->pending_jobs().size());
338 resolver_impl_.reset(); 338 resolver_impl_.reset();
339 client.event_waiter().WaitForEvent(TestRequestClient::CONNECTION_ERROR); 339 client.event_waiter().WaitForEvent(TestRequestClient::CONNECTION_ERROR);
340 } 340 }
341 341
342 } // namespace net 342 } // namespace net
OLDNEW
« no previous file with comments | « net/http2/hpack/huffman/http2_hpack_huffman_decoder.cc ('k') | net/quic/core/quic_stream_sequencer_buffer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698