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

Unified Diff: net/base/host_resolver.h

Issue 8533011: Remove unused HostResolver::Observer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove id from AsyncHostResolver; add double-cancelation check; comments' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/host_resolver_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver.h
diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h
index cfd1c6e11fac97b3dedd01824d42feb1a0a1d665..b47fa8160fd083fda87c0853ac9e5a93455a4d7e 100644
--- a/net/base/host_resolver.h
+++ b/net/base/host_resolver.h
@@ -9,7 +9,6 @@
#include <string>
#include "base/memory/scoped_ptr.h"
-#include "googleurl/src/gurl.h"
#include "net/base/address_family.h"
#include "net/base/completion_callback.h"
#include "net/base/host_port_pair.h"
@@ -71,9 +70,6 @@ class NET_EXPORT HostResolver {
RequestPriority priority() const { return priority_; }
void set_priority(RequestPriority priority) { priority_ = priority; }
- const GURL& referrer() const { return referrer_; }
- void set_referrer(const GURL& referrer) { referrer_ = referrer; }
-
private:
// The hostname to resolve, and the port to use in resulting sockaddrs.
HostPortPair host_port_pair_;
@@ -92,31 +88,6 @@ class NET_EXPORT HostResolver {
// The priority for the request.
RequestPriority priority_;
-
- // Optional data for consumption by observers. This is the URL of the
- // page that lead us to the navigation, for DNS prefetcher's benefit.
- GURL referrer_;
- };
-
- // Interface for observing the requests that flow through a HostResolver.
- class Observer {
- public:
- virtual ~Observer() {}
-
- // Called at the start of HostResolver::Resolve(). |id| is a unique number
- // given to the request, so it can be matched up with a corresponding call
- // to OnFinishResolutionWithStatus() or OnCancelResolution().
- virtual void OnStartResolution(int id, const RequestInfo& info) = 0;
-
- // Called on completion of request |id|. Note that if the request was
- // cancelled, OnCancelResolution() will be called instead.
- virtual void OnFinishResolutionWithStatus(int id, bool was_resolved,
- const RequestInfo& info) = 0;
-
- // Called when request |id| has been cancelled. A request is "cancelled"
- // if either the HostResolver is destroyed while a resolution is in
- // progress, or HostResolver::CancelRequest() is called.
- virtual void OnCancelResolution(int id, const RequestInfo& info) = 0;
};
// Opaque type used to cancel a request.
@@ -170,17 +141,11 @@ class NET_EXPORT HostResolver {
const BoundNetLog& net_log) = 0;
// Cancels the specified request. |req| is the handle returned by Resolve().
- // After a request is cancelled, its completion callback will not be called.
+ // After a request is canceled, its completion callback will not be called.
+ // CancelRequest must NOT be called after the request's completion callback
+ // has already run or the request was canceled.
virtual void CancelRequest(RequestHandle req) = 0;
- // Adds an observer to this resolver. The observer will be notified of the
- // start and completion of all requests (excluding cancellation). |observer|
- // must remain valid for the duration of this HostResolver's lifetime.
- virtual void AddObserver(Observer* observer) = 0;
-
- // Unregisters an observer previously added by AddObserver().
- virtual void RemoveObserver(Observer* observer) = 0;
-
// Sets the default AddressFamily to use when requests have left it
// unspecified. For example, this could be used to restrict resolution
// results to AF_INET by passing in ADDRESS_FAMILY_IPV4, or to
« no previous file with comments | « no previous file | net/base/host_resolver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698