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

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

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/dns/host_resolver_proc.cc ('k') | net/dns/mock_host_resolver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_MOCK_HOST_RESOLVER_H_ 5 #ifndef NET_DNS_MOCK_HOST_RESOLVER_H_
6 #define NET_DNS_MOCK_HOST_RESOLVER_H_ 6 #define NET_DNS_MOCK_HOST_RESOLVER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // By default, MockHostResolvers include a single rule that maps all hosts to 50 // By default, MockHostResolvers include a single rule that maps all hosts to
51 // 127.0.0.1. 51 // 127.0.0.1.
52 52
53 // Base class shared by MockHostResolver and MockCachingHostResolver. 53 // Base class shared by MockHostResolver and MockCachingHostResolver.
54 class MockHostResolverBase : public HostResolver, 54 class MockHostResolverBase : public HostResolver,
55 public base::SupportsWeakPtr<MockHostResolverBase>, 55 public base::SupportsWeakPtr<MockHostResolverBase>,
56 public base::NonThreadSafe { 56 public base::NonThreadSafe {
57 public: 57 public:
58 virtual ~MockHostResolverBase(); 58 virtual ~MockHostResolverBase();
59 59
60 RuleBasedHostResolverProc* rules() { return rules_; } 60 RuleBasedHostResolverProc* rules() { return rules_.get(); }
61 void set_rules(RuleBasedHostResolverProc* rules) { rules_ = rules; } 61 void set_rules(RuleBasedHostResolverProc* rules) { rules_ = rules; }
62 62
63 // Controls whether resolutions complete synchronously or asynchronously. 63 // Controls whether resolutions complete synchronously or asynchronously.
64 void set_synchronous_mode(bool is_synchronous) { 64 void set_synchronous_mode(bool is_synchronous) {
65 synchronous_mode_ = is_synchronous; 65 synchronous_mode_ = is_synchronous;
66 } 66 }
67 67
68 // Asynchronous requests are automatically resolved by default. 68 // Asynchronous requests are automatically resolved by default.
69 // If set_ondemand_mode() is set then Resolve() returns IO_PENDING and 69 // If set_ondemand_mode() is set then Resolve() returns IO_PENDING and
70 // ResolveAllPending() must be explicitly invoked to resolve all requests 70 // ResolveAllPending() must be explicitly invoked to resolve all requests
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 void Init(HostResolverProc* proc); 245 void Init(HostResolverProc* proc);
246 246
247 private: 247 private:
248 scoped_refptr<HostResolverProc> current_proc_; 248 scoped_refptr<HostResolverProc> current_proc_;
249 scoped_refptr<HostResolverProc> previous_proc_; 249 scoped_refptr<HostResolverProc> previous_proc_;
250 }; 250 };
251 251
252 } // namespace net 252 } // namespace net
253 253
254 #endif // NET_DNS_MOCK_HOST_RESOLVER_H_ 254 #endif // NET_DNS_MOCK_HOST_RESOLVER_H_
OLDNEW
« no previous file with comments | « net/dns/host_resolver_proc.cc ('k') | net/dns/mock_host_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698