OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/cache_storage/cache_storage_scheduler.h" | 5 #include "content/browser/cache_storage/cache_storage_scheduler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 CacheStorageScheduler::CacheStorageScheduler() : operation_running_(false) { | 17 CacheStorageScheduler::CacheStorageScheduler() : operation_running_(false) { |
18 } | 18 } |
19 | 19 |
20 CacheStorageScheduler::~CacheStorageScheduler() { | 20 CacheStorageScheduler::~CacheStorageScheduler() { |
21 } | 21 } |
22 | 22 |
23 void CacheStorageScheduler::ScheduleOperation(const base::Closure& closure) { | 23 void CacheStorageScheduler::ScheduleOperation(const base::Closure& closure) { |
(...skipping 16 matching lines...) Expand all Loading... |
40 operation_running_ = true; | 40 operation_running_ = true; |
41 // TODO(jkarlin): Run multiple operations in parallel where allowed. | 41 // TODO(jkarlin): Run multiple operations in parallel where allowed. |
42 base::Closure closure = pending_operations_.front(); | 42 base::Closure closure = pending_operations_.front(); |
43 pending_operations_.pop_front(); | 43 pending_operations_.pop_front(); |
44 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 44 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
45 base::Bind(closure)); | 45 base::Bind(closure)); |
46 } | 46 } |
47 } | 47 } |
48 | 48 |
49 } // namespace content | 49 } // namespace content |
OLD | NEW |