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

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

Issue 1525033004: Always set the error handler closure of Binding<> after binding to a message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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 | « mojo/shell/application_instance.cc ('k') | no next file » | 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/proxy_resolver_factory_mojo.h" 5 #include "net/proxy/proxy_resolver_factory_mojo.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 : ClientMixin<interfaces::ProxyResolverRequestClient>( 189 : ClientMixin<interfaces::ProxyResolverRequestClient>(
190 resolver->host_resolver_, 190 resolver->host_resolver_,
191 resolver->error_observer_.get(), 191 resolver->error_observer_.get(),
192 resolver->net_log_, 192 resolver->net_log_,
193 net_log), 193 net_log),
194 resolver_(resolver), 194 resolver_(resolver),
195 url_(url), 195 url_(url),
196 results_(results), 196 results_(results),
197 callback_(callback), 197 callback_(callback),
198 binding_(this) { 198 binding_(this) {
199 interfaces::ProxyResolverRequestClientPtr client_ptr;
200 binding_.Bind(mojo::GetProxy(&client_ptr));
199 binding_.set_connection_error_handler(base::Bind( 201 binding_.set_connection_error_handler(base::Bind(
200 &ProxyResolverMojo::Job::OnConnectionError, base::Unretained(this))); 202 &ProxyResolverMojo::Job::OnConnectionError, base::Unretained(this)));
201
202 interfaces::ProxyResolverRequestClientPtr client_ptr;
203 binding_.Bind(mojo::GetProxy(&client_ptr));
204 resolver_->mojo_proxy_resolver_ptr_->GetProxyForUrl(mojo::String::From(url_), 203 resolver_->mojo_proxy_resolver_ptr_->GetProxyForUrl(mojo::String::From(url_),
205 client_ptr.Pass()); 204 client_ptr.Pass());
206 } 205 }
207 206
208 ProxyResolverMojo::Job::~Job() { 207 ProxyResolverMojo::Job::~Job() {
209 DCHECK(thread_checker_.CalledOnValidThread()); 208 DCHECK(thread_checker_.CalledOnValidThread());
210 if (!callback_.is_null()) 209 if (!callback_.is_null())
211 callback_.Run(ERR_PAC_SCRIPT_TERMINATED); 210 callback_.Run(ERR_PAC_SCRIPT_TERMINATED);
212 } 211 }
213 212
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 return ERR_PAC_SCRIPT_FAILED; 403 return ERR_PAC_SCRIPT_FAILED;
405 } 404 }
406 request->reset(new Job(this, pac_script, resolver, callback, 405 request->reset(new Job(this, pac_script, resolver, callback,
407 error_observer_factory_.is_null() 406 error_observer_factory_.is_null()
408 ? nullptr 407 ? nullptr
409 : error_observer_factory_.Run())); 408 : error_observer_factory_.Run()));
410 return ERR_IO_PENDING; 409 return ERR_IO_PENDING;
411 } 410 }
412 411
413 } // namespace net 412 } // namespace net
OLDNEW
« no previous file with comments | « mojo/shell/application_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698