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

Unified Diff: net/base/host_resolver_impl.h

Issue 556094: Add fine grain tracing to HostResolverImpl.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Add explicit to ctors Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: net/base/host_resolver_impl.h
===================================================================
--- net/base/host_resolver_impl.h (revision 37608)
+++ net/base/host_resolver_impl.h (working copy)
@@ -86,7 +86,6 @@
virtual void CancelRequest(RequestHandle req);
virtual void AddObserver(HostResolver::Observer* observer);
virtual void RemoveObserver(HostResolver::Observer* observer);
- virtual HostCache* GetHostCache();
// TODO(eroman): temp hack for http://crbug.com/15513
virtual void Shutdown();
@@ -95,6 +94,22 @@
default_address_family_ = address_family;
}
+ virtual bool IsHostResolverImpl() { return true; }
+
+ // Returns the cache this resolver uses, or NULL if caching is disabled.
+ HostCache* cache() { return cache_.get(); }
+
+ // Clears the request trace log.
+ void ClearRequestsTrace();
+
+ // Starts/ends capturing requests to a trace log.
+ void EnableRequestsTracing(bool enable);
+
+ bool IsRequestsTracingEnabled() const;
+
+ // Returns a copy of the requests trace log, or NULL if there is none.
+ scoped_refptr<LoadLog> GetRequestsTrace();
+
// Applies a set of constraints for requests that belong to the specified
// pool. NOTE: Don't call this after requests have been already been started.
//
@@ -114,6 +129,7 @@
class Job;
class JobPool;
class Request;
+ class RequestsTrace;
typedef std::vector<Request*> RequestsList;
typedef HostCache::Key Key;
typedef std::map<Key, scoped_refptr<Job> > JobMap;
@@ -206,6 +222,10 @@
// Observers are the only consumers of this ID number.
int next_request_id_;
+ // Monotonically increasing ID number to assign to the next job.
+ // The only consumer of this ID is the requests tracing code.
+ int next_job_id_;
+
// The procedure to use for resolving host names. This will be NULL, except
// in the case of unit-tests which inject custom host resolving behaviors.
scoped_refptr<HostResolverProc> resolver_proc_;
@@ -218,6 +238,8 @@
const scoped_refptr<NetworkChangeNotifier> network_change_notifier_;
+ scoped_refptr<RequestsTrace> requests_trace_;
+
DISALLOW_COPY_AND_ASSIGN(HostResolverImpl);
};

Powered by Google App Engine
This is Rietveld 408576698