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

Unified Diff: content/browser/loader/resource_scheduler.h

Issue 692723002: Add histograms to gather ResourceScheduler information. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed. Created 6 years, 2 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: content/browser/loader/resource_scheduler.h
diff --git a/content/browser/loader/resource_scheduler.h b/content/browser/loader/resource_scheduler.h
index b44eb7710bd65048cdbca1905b8bbed0b1ae9870..f4067fe35ccf3a1b1346d587c88326ae22a40b45 100644
--- a/content/browser/loader/resource_scheduler.h
+++ b/content/browser/loader/resource_scheduler.h
@@ -151,6 +151,15 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe {
bool IsClientVisibleForTesting(int child_id, int route_id);
private:
+ enum ClientState {
+ // Observable client.
+ ACTIVE,
+ // Non-observable client.
+ BACKGROUND,
+ // No client found.
+ UNKNOWN,
+ };
+
class RequestQueue;
class ScheduledResourceRequest;
struct RequestPriorityParams;
@@ -188,6 +197,10 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe {
size_t CountCoalescedClients() const;
+ // Returns UNKNOWN if the corresponding client is not found, else returns
+ // whether the client is ACTIVE (user-observable) or BACKGROUND.
+ ClientState GetClientState(ClientId client_id) const;
+
// Update the queue position for |request|, possibly causing it to start
// loading.
//
@@ -204,6 +217,10 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe {
// Returns the client for the given |child_id| and |route_id| combo.
Client* GetClient(int child_id, int route_id);
+ void PostHistogram(const char* base_name,
+ const char* suffix,
+ base::TimeDelta time);
+
bool should_coalesce_;
bool should_throttle_;
ClientMap client_map_;
« no previous file with comments | « no previous file | content/browser/loader/resource_scheduler.cc » ('j') | content/browser/loader/resource_scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698