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

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

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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/proxy/mock_proxy_resolver.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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 interfaces::ProxyResolverFactoryRequestClientPtr client) 85 interfaces::ProxyResolverFactoryRequestClientPtr client)
86 : parent_(factory), 86 : parent_(factory),
87 proxy_request_(std::move(request)), 87 proxy_request_(std::move(request)),
88 factory_(proxy_resolver_factory), 88 factory_(proxy_resolver_factory),
89 client_ptr_(std::move(client)) { 89 client_ptr_(std::move(client)) {
90 client_ptr_.set_connection_error_handler( 90 client_ptr_.set_connection_error_handler(
91 base::Bind(&MojoProxyResolverFactoryImpl::Job::OnConnectionError, 91 base::Bind(&MojoProxyResolverFactoryImpl::Job::OnConnectionError,
92 base::Unretained(this))); 92 base::Unretained(this)));
93 factory_->CreateProxyResolverV8Tracing( 93 factory_->CreateProxyResolverV8Tracing(
94 pac_script, 94 pac_script,
95 base::WrapUnique(new MojoProxyResolverV8TracingBindings< 95 base::MakeUnique<MojoProxyResolverV8TracingBindings<
96 interfaces::ProxyResolverFactoryRequestClient>( 96 interfaces::ProxyResolverFactoryRequestClient>>(client_ptr_.get()),
97 client_ptr_.get())),
98 &proxy_resolver_impl_, 97 &proxy_resolver_impl_,
99 base::Bind(&MojoProxyResolverFactoryImpl::Job::OnProxyResolverCreated, 98 base::Bind(&MojoProxyResolverFactoryImpl::Job::OnProxyResolverCreated,
100 base::Unretained(this)), 99 base::Unretained(this)),
101 &request_); 100 &request_);
102 } 101 }
103 102
104 MojoProxyResolverFactoryImpl::Job::~Job() = default; 103 MojoProxyResolverFactoryImpl::Job::~Job() = default;
105 104
106 void MojoProxyResolverFactoryImpl::Job::OnConnectionError() { 105 void MojoProxyResolverFactoryImpl::Job::OnConnectionError() {
107 client_ptr_->ReportResult(ERR_PAC_SCRIPT_TERMINATED); 106 client_ptr_->ReportResult(ERR_PAC_SCRIPT_TERMINATED);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 std::move(client))); 145 std::move(client)));
147 } 146 }
148 147
149 void MojoProxyResolverFactoryImpl::RemoveJob(Job* job) { 148 void MojoProxyResolverFactoryImpl::RemoveJob(Job* job) {
150 size_t erased = jobs_.erase(job); 149 size_t erased = jobs_.erase(job);
151 DCHECK_EQ(1u, erased); 150 DCHECK_EQ(1u, erased);
152 delete job; 151 delete job;
153 } 152 }
154 153
155 } // namespace net 154 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/mock_proxy_resolver.cc ('k') | net/proxy/mojo_proxy_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698