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

Side by Side Diff: chromeos/dbus/services/proxy_resolution_service_provider.cc

Issue 1556773002: Convert Pass()→std::move() in //chromeos (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chromeos/dbus/services/proxy_resolution_service_provider.h" 5 #include "chromeos/dbus/services/proxy_resolution_service_provider.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/thread_task_runner_handle.h" 12 #include "base/thread_task_runner_handle.h"
11 #include "dbus/bus.h" 13 #include "dbus/bus.h"
12 #include "dbus/message.h" 14 #include "dbus/message.h"
13 #include "net/base/load_flags.h" 15 #include "net/base/load_flags.h"
14 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
15 #include "net/proxy/proxy_service.h" 17 #include "net/proxy/proxy_service.h"
16 #include "net/url_request/url_request_context.h" 18 #include "net/url_request/url_request_context.h"
(...skipping 27 matching lines...) Expand all
44 std::string source_url_; // URL being resolved. 46 std::string source_url_; // URL being resolved.
45 net::ProxyInfo proxy_info_; // ProxyInfo resolved for source_url_. 47 net::ProxyInfo proxy_info_; // ProxyInfo resolved for source_url_.
46 std::string error_; // Error from proxy resolution. 48 std::string error_; // Error from proxy resolution.
47 base::Closure notify_task_; // Task to notify of resolution result. 49 base::Closure notify_task_; // Task to notify of resolution result.
48 50
49 private: 51 private:
50 DISALLOW_COPY_AND_ASSIGN(Request); 52 DISALLOW_COPY_AND_ASSIGN(Request);
51 }; 53 };
52 54
53 explicit ProxyResolverImpl(scoped_ptr<ProxyResolverDelegate> delegate) 55 explicit ProxyResolverImpl(scoped_ptr<ProxyResolverDelegate> delegate)
54 : delegate_(delegate.Pass()), 56 : delegate_(std::move(delegate)),
55 origin_thread_(base::ThreadTaskRunnerHandle::Get()), 57 origin_thread_(base::ThreadTaskRunnerHandle::Get()),
56 weak_ptr_factory_(this) { 58 weak_ptr_factory_(this) {}
57 }
58 59
59 ~ProxyResolverImpl() override { 60 ~ProxyResolverImpl() override {
60 DCHECK(OnOriginThread()); 61 DCHECK(OnOriginThread());
61 62
62 for (std::set<Request*>::iterator iter = all_requests_.begin(); 63 for (std::set<Request*>::iterator iter = all_requests_.begin();
63 iter != all_requests_.end(); ++iter) { 64 iter != all_requests_.end(); ++iter) {
64 Request* request = *iter; 65 Request* request = *iter;
65 LOG(WARNING) << "Pending request for " << request->source_url_; 66 LOG(WARNING) << "Pending request for " << request->source_url_;
66 delete request; 67 delete request;
67 } 68 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 LOG(WARNING) << "Called after the object is deleted"; 261 LOG(WARNING) << "Called after the object is deleted";
261 response_sender.Run(scoped_ptr<dbus::Response>()); 262 response_sender.Run(scoped_ptr<dbus::Response>());
262 return; 263 return;
263 } 264 }
264 provider_weak_ptr->ResolveProxyHandler(method_call, response_sender); 265 provider_weak_ptr->ResolveProxyHandler(method_call, response_sender);
265 } 266 }
266 267
267 ProxyResolutionServiceProvider* ProxyResolutionServiceProvider::Create( 268 ProxyResolutionServiceProvider* ProxyResolutionServiceProvider::Create(
268 scoped_ptr<ProxyResolverDelegate> delegate) { 269 scoped_ptr<ProxyResolverDelegate> delegate) {
269 return new ProxyResolutionServiceProvider( 270 return new ProxyResolutionServiceProvider(
270 new ProxyResolverImpl(delegate.Pass())); 271 new ProxyResolverImpl(std::move(delegate)));
271 } 272 }
272 273
273 ProxyResolverInterface::~ProxyResolverInterface() { 274 ProxyResolverInterface::~ProxyResolverInterface() {
274 } 275 }
275 276
276 } // namespace chromeos 277 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/services/display_power_service_provider.cc ('k') | chromeos/dbus/services/service_provider_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698