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

Unified Diff: content/browser/cache_storage/cache_storage_scheduler.h

Issue 2168123002: [CacheStorage] Add metrics to the scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit Created 4 years, 5 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/cache_storage/cache_storage_scheduler.h
diff --git a/content/browser/cache_storage/cache_storage_scheduler.h b/content/browser/cache_storage/cache_storage_scheduler.h
index e886a71593b678bd422a50dadb2fe779d1418983..bcfe2ea8f5b158d87e47d793ff1f1f67280c167d 100644
--- a/content/browser/cache_storage/cache_storage_scheduler.h
+++ b/content/browser/cache_storage/cache_storage_scheduler.h
@@ -11,10 +11,14 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/time/time.h"
+#include "content/browser/cache_storage/cache_storage_scheduler_client.h"
#include "content/common/content_export.h"
namespace content {
+class CacheStorageOperation;
+
// TODO(jkarlin): Support readers and writers so operations can run in parallel.
// TODO(jkarlin): Support operation identification so that ops can be checked in
// DCHECKs.
@@ -25,7 +29,7 @@ namespace content {
// the next operation.
class CONTENT_EXPORT CacheStorageScheduler {
public:
- CacheStorageScheduler();
+ explicit CacheStorageScheduler(CacheStorageSchedulerClient client_type);
virtual ~CacheStorageScheduler();
// Adds the operation to the tail of the queue and starts it if the scheduler
@@ -63,9 +67,10 @@ class CONTENT_EXPORT CacheStorageScheduler {
CompleteOperationAndRunNext();
}
- // The list of operations waiting on initialization.
- std::list<base::Closure> pending_operations_;
- bool operation_running_;
+ std::list<std::unique_ptr<CacheStorageOperation>> pending_operations_;
+ std::unique_ptr<CacheStorageOperation> running_operation_;
+ CacheStorageSchedulerClient client_type_;
+
base::WeakPtrFactory<CacheStorageScheduler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CacheStorageScheduler);

Powered by Google App Engine
This is Rietveld 408576698