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

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

Issue 2080513002: Deletes mojo::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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/proxy_resolver_factory_mojo.h" 5 #include "net/proxy/proxy_resolver_factory_mojo.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/callback.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/stl_util.h" 14 #include "base/stl_util.h"
14 #include "base/threading/thread_checker.h" 15 #include "base/threading/thread_checker.h"
15 #include "base/values.h" 16 #include "base/values.h"
16 #include "mojo/common/common_type_converters.h" 17 #include "mojo/common/common_type_converters.h"
17 #include "mojo/common/url_type_converters.h" 18 #include "mojo/common/url_type_converters.h"
18 #include "mojo/public/cpp/bindings/binding.h" 19 #include "mojo/public/cpp/bindings/binding.h"
19 #include "net/base/load_states.h" 20 #include "net/base/load_states.h"
20 #include "net/base/net_errors.h" 21 #include "net/base/net_errors.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 base::Unretained(this))); 347 base::Unretained(this)));
347 binding_.set_connection_error_handler( 348 binding_.set_connection_error_handler(
348 base::Bind(&ProxyResolverFactoryMojo::Job::OnConnectionError, 349 base::Bind(&ProxyResolverFactoryMojo::Job::OnConnectionError,
349 base::Unretained(this))); 350 base::Unretained(this)));
350 } 351 }
351 352
352 void OnConnectionError() { ReportResult(ERR_PAC_SCRIPT_TERMINATED); } 353 void OnConnectionError() { ReportResult(ERR_PAC_SCRIPT_TERMINATED); }
353 354
354 private: 355 private:
355 void ReportResult(int32_t error) override { 356 void ReportResult(int32_t error) override {
356 resolver_ptr_.set_connection_error_handler(mojo::Closure()); 357 resolver_ptr_.set_connection_error_handler(base::Closure());
357 binding_.set_connection_error_handler(mojo::Closure()); 358 binding_.set_connection_error_handler(base::Closure());
358 if (error == OK) { 359 if (error == OK) {
359 resolver_->reset(new ProxyResolverMojo( 360 resolver_->reset(new ProxyResolverMojo(
360 std::move(resolver_ptr_), factory_->host_resolver_, 361 std::move(resolver_ptr_), factory_->host_resolver_,
361 std::move(on_delete_callback_runner_), std::move(error_observer_), 362 std::move(on_delete_callback_runner_), std::move(error_observer_),
362 factory_->net_log_)); 363 factory_->net_log_));
363 } 364 }
364 on_delete_callback_runner_.reset(); 365 on_delete_callback_runner_.reset();
365 callback_.Run(error); 366 callback_.Run(error);
366 } 367 }
367 368
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 return ERR_PAC_SCRIPT_FAILED; 401 return ERR_PAC_SCRIPT_FAILED;
401 } 402 }
402 request->reset(new Job(this, pac_script, resolver, callback, 403 request->reset(new Job(this, pac_script, resolver, callback,
403 error_observer_factory_.is_null() 404 error_observer_factory_.is_null()
404 ? nullptr 405 ? nullptr
405 : error_observer_factory_.Run())); 406 : error_observer_factory_.Run()));
406 return ERR_IO_PENDING; 407 return ERR_IO_PENDING;
407 } 408 }
408 409
409 } // namespace net 410 } // namespace net
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl ('k') | services/shell/public/cpp/connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698