Chromium Code Reviews| 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..d64541f1a87ba4d83112573612118cff13698f8f 100644 |
| --- a/content/browser/cache_storage/cache_storage_scheduler.h |
| +++ b/content/browser/cache_storage/cache_storage_scheduler.h |
| @@ -10,11 +10,20 @@ |
| #include "base/bind.h" |
| #include "base/callback.h" |
| #include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
|
jsbell
2016/07/21 18:13:31
Needed?
jkarlin
2016/07/21 18:29:49
Done.
|
| #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 base { |
| +class SingleThreadTaskRunner; |
|
jsbell
2016/07/21 18:13:31
Needed?
jkarlin
2016/07/21 18:29:49
Done.
|
| +} |
| + |
| 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 +34,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 +72,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); |