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

Side by Side Diff: net/base/host_resolver.h

Issue 209073: Merge 26476 - Fixed a few data races on reference counters.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 3 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 | « chrome/browser/history/history_marshaling.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/net/base/host_resolver.h:r69-2775
Merged /trunk/src/net/base/host_resolver.h:r26476
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_BASE_HOST_RESOLVER_H_ 5 #ifndef NET_BASE_HOST_RESOLVER_H_
6 #define NET_BASE_HOST_RESOLVER_H_ 6 #define NET_BASE_HOST_RESOLVER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/ref_counted.h" 10 #include "base/ref_counted.h"
11 #include "googleurl/src/gurl.h" 11 #include "googleurl/src/gurl.h"
12 #include "net/base/completion_callback.h" 12 #include "net/base/completion_callback.h"
13 13
14 class MessageLoop; 14 class MessageLoop;
15 15
16 namespace net { 16 namespace net {
17 17
18 class AddressList; 18 class AddressList;
19 19
20 // This class represents the task of resolving hostnames (or IP address 20 // This class represents the task of resolving hostnames (or IP address
21 // literal) to an AddressList object. 21 // literal) to an AddressList object.
22 // 22 //
23 // HostResolver can handle multiple requests at a time, so when cancelling a 23 // HostResolver can handle multiple requests at a time, so when cancelling a
24 // request the RequestHandle that was returned by Resolve() needs to be 24 // request the RequestHandle that was returned by Resolve() needs to be
25 // given. A simpler alternative for consumers that only have 1 outstanding 25 // given. A simpler alternative for consumers that only have 1 outstanding
26 // request at a time is to create a SingleRequestHostResolver wrapper around 26 // request at a time is to create a SingleRequestHostResolver wrapper around
27 // HostResolver (which will automatically cancel the single request when it 27 // HostResolver (which will automatically cancel the single request when it
28 // goes out of scope). 28 // goes out of scope).
29 class HostResolver : public base::RefCounted<HostResolver> { 29 class HostResolver : public base::RefCountedThreadSafe<HostResolver> {
30 public: 30 public:
31 // The parameters for doing a Resolve(). |hostname| and |port| are required, 31 // The parameters for doing a Resolve(). |hostname| and |port| are required,
32 // the rest are optional (and have reasonable defaults). 32 // the rest are optional (and have reasonable defaults).
33 class RequestInfo { 33 class RequestInfo {
34 public: 34 public:
35 RequestInfo(const std::string& hostname, int port) 35 RequestInfo(const std::string& hostname, int port)
36 : hostname_(hostname), 36 : hostname_(hostname),
37 port_(port), 37 port_(port),
38 allow_cached_response_(true), 38 allow_cached_response_(true),
39 is_speculative_(false) {} 39 is_speculative_(false) {}
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 }; 168 };
169 169
170 // Creates a HostResolver implementation that queries the underlying system. 170 // Creates a HostResolver implementation that queries the underlying system.
171 // (Except if a unit-test has changed the global HostResolverProc using 171 // (Except if a unit-test has changed the global HostResolverProc using
172 // ScopedHostResolverProc to intercept requests to the system). 172 // ScopedHostResolverProc to intercept requests to the system).
173 HostResolver* CreateSystemHostResolver(); 173 HostResolver* CreateSystemHostResolver();
174 174
175 } // namespace net 175 } // namespace net
176 176
177 #endif // NET_BASE_HOST_RESOLVER_H_ 177 #endif // NET_BASE_HOST_RESOLVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/history/history_marshaling.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698