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

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

Issue 2083463002: Replace //net TypeConverters with StructTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@type-converter-cleanup--gurl
Patch Set: 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/mojo_proxy_resolver_impl.h" 5 #include "net/proxy/mojo_proxy_resolver_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "net/base/net_errors.h" 12 #include "net/base/net_errors.h"
13 #include "net/log/net_log.h" 13 #include "net/log/net_log.h"
14 #include "net/proxy/mojo_proxy_resolver_v8_tracing_bindings.h" 14 #include "net/proxy/mojo_proxy_resolver_v8_tracing_bindings.h"
15 #include "net/proxy/mojo_proxy_type_converters.h"
16 #include "net/proxy/proxy_info.h" 15 #include "net/proxy/proxy_info.h"
17 #include "net/proxy/proxy_resolver_script_data.h" 16 #include "net/proxy/proxy_resolver_script_data.h"
18 #include "net/proxy/proxy_resolver_v8_tracing.h" 17 #include "net/proxy/proxy_resolver_v8_tracing.h"
19 18
20 namespace net { 19 namespace net {
21 20
22 class MojoProxyResolverImpl::Job { 21 class MojoProxyResolverImpl::Job {
23 public: 22 public:
24 Job(interfaces::ProxyResolverRequestClientPtr client, 23 Job(interfaces::ProxyResolverRequestClientPtr client,
25 MojoProxyResolverImpl* resolver, 24 MojoProxyResolverImpl* resolver,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 &MojoProxyResolverImpl::Job::OnConnectionError, base::Unretained(this))); 94 &MojoProxyResolverImpl::Job::OnConnectionError, base::Unretained(this)));
96 } 95 }
97 96
98 void MojoProxyResolverImpl::Job::GetProxyDone(int error) { 97 void MojoProxyResolverImpl::Job::GetProxyDone(int error) {
99 done_ = true; 98 done_ = true;
100 DVLOG(1) << "GetProxyForUrl(" << url_ << ") finished with error " << error 99 DVLOG(1) << "GetProxyForUrl(" << url_ << ") finished with error " << error
101 << ". " << result_.proxy_list().size() << " Proxies returned:"; 100 << ". " << result_.proxy_list().size() << " Proxies returned:";
102 for (const auto& proxy : result_.proxy_list().GetAll()) { 101 for (const auto& proxy : result_.proxy_list().GetAll()) {
103 DVLOG(1) << proxy.ToURI(); 102 DVLOG(1) << proxy.ToURI();
104 } 103 }
105 mojo::Array<interfaces::ProxyServerPtr> result; 104 if (error == OK)
106 if (error == OK) { 105 client_->ReportResult(error, result_);
107 result = mojo::Array<interfaces::ProxyServerPtr>::From( 106 else
108 result_.proxy_list().GetAll()); 107 client_->ReportResult(error, ProxyInfo());
109 } 108
110 client_->ReportResult(error, std::move(result));
111 resolver_->DeleteJob(this); 109 resolver_->DeleteJob(this);
112 } 110 }
113 111
114 void MojoProxyResolverImpl::Job::OnConnectionError() { 112 void MojoProxyResolverImpl::Job::OnConnectionError() {
115 resolver_->DeleteJob(this); 113 resolver_->DeleteJob(this);
116 } 114 }
117 115
118 } // namespace net 116 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698