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

Side by Side Diff: net/dns/mapped_host_resolver.h

Issue 2116983002: Change HostResolver::Resolve() to take an std::unique_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: http_stream_factory_impl_job_controller_unittest RequestHandle* to unique_ptr Created 4 years, 4 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 #ifndef NET_DNS_MAPPED_HOST_RESOLVER_H_ 5 #ifndef NET_DNS_MAPPED_HOST_RESOLVER_H_
6 #define NET_DNS_MAPPED_HOST_RESOLVER_H_ 6 #define NET_DNS_MAPPED_HOST_RESOLVER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Takes a comma separated list of rules, and assigns them to this resolver. 42 // Takes a comma separated list of rules, and assigns them to this resolver.
43 void SetRulesFromString(const std::string& rules_string) { 43 void SetRulesFromString(const std::string& rules_string) {
44 rules_.SetRulesFromString(rules_string); 44 rules_.SetRulesFromString(rules_string);
45 } 45 }
46 46
47 // HostResolver methods: 47 // HostResolver methods:
48 int Resolve(const RequestInfo& info, 48 int Resolve(const RequestInfo& info,
49 RequestPriority priority, 49 RequestPriority priority,
50 AddressList* addresses, 50 AddressList* addresses,
51 const CompletionCallback& callback, 51 const CompletionCallback& callback,
52 RequestHandle* out_req, 52 std::unique_ptr<Request>* request,
53 const BoundNetLog& net_log) override; 53 const BoundNetLog& net_log) override;
54 int ResolveFromCache(const RequestInfo& info, 54 int ResolveFromCache(const RequestInfo& info,
55 AddressList* addresses, 55 AddressList* addresses,
56 const BoundNetLog& net_log) override; 56 const BoundNetLog& net_log) override;
57 void CancelRequest(RequestHandle req) override;
58 void SetDnsClientEnabled(bool enabled) override; 57 void SetDnsClientEnabled(bool enabled) override;
59 HostCache* GetHostCache() override; 58 HostCache* GetHostCache() override;
60 std::unique_ptr<base::Value> GetDnsConfigAsValue() const override; 59 std::unique_ptr<base::Value> GetDnsConfigAsValue() const override;
61 60
62 private: 61 private:
63 // Modify the request |info| according to |rules_|. Returns either OK or 62 // Modify the request |info| according to |rules_|. Returns either OK or
64 // the network error code that the hostname's resolution mapped to. 63 // the network error code that the hostname's resolution mapped to.
65 int ApplyRules(RequestInfo* info) const; 64 int ApplyRules(RequestInfo* info) const;
66 65
67 std::unique_ptr<HostResolver> impl_; 66 std::unique_ptr<HostResolver> impl_;
68 67
69 HostMappingRules rules_; 68 HostMappingRules rules_;
70 }; 69 };
71 70
72 } // namespace net 71 } // namespace net
73 72
74 #endif // NET_DNS_MAPPED_HOST_RESOLVER_H_ 73 #endif // NET_DNS_MAPPED_HOST_RESOLVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698