| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef WEBKIT_QUOTA_QUOTA_TASK_H_ | 5 #ifndef WEBKIT_QUOTA_QUOTA_TASK_H_ |
| 6 #define WEBKIT_QUOTA_QUOTA_TASK_H_ | 6 #define WEBKIT_QUOTA_QUOTA_TASK_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 friend class base::DeleteHelper<QuotaTask>; | 55 friend class base::DeleteHelper<QuotaTask>; |
| 56 friend class QuotaTaskObserver; | 56 friend class QuotaTaskObserver; |
| 57 friend class QuotaThreadTask; | 57 friend class QuotaThreadTask; |
| 58 | 58 |
| 59 void Abort(); | 59 void Abort(); |
| 60 QuotaTaskObserver* observer_; | 60 QuotaTaskObserver* observer_; |
| 61 scoped_refptr<base::SingleThreadTaskRunner> original_task_runner_; | 61 scoped_refptr<base::SingleThreadTaskRunner> original_task_runner_; |
| 62 bool delete_scheduled_; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 // For tasks that post tasks to the other thread. | 65 // For tasks that post tasks to the other thread. |
| 65 class QuotaThreadTask : public QuotaTask, | 66 class QuotaThreadTask : public QuotaTask, |
| 66 public base::RefCountedThreadSafe<QuotaThreadTask> { | 67 public base::RefCountedThreadSafe<QuotaThreadTask> { |
| 67 public: | 68 public: |
| 68 QuotaThreadTask(QuotaTaskObserver* observer, | 69 QuotaThreadTask(QuotaTaskObserver* observer, |
| 69 base::TaskRunner* target_task_runner); | 70 base::TaskRunner* target_task_runner); |
| 70 | 71 |
| 71 protected: | 72 protected: |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 108 |
| 108 void RegisterTask(QuotaTask* task); | 109 void RegisterTask(QuotaTask* task); |
| 109 void UnregisterTask(QuotaTask* task); | 110 void UnregisterTask(QuotaTask* task); |
| 110 | 111 |
| 111 typedef std::set<QuotaTask*> TaskSet; | 112 typedef std::set<QuotaTask*> TaskSet; |
| 112 TaskSet running_quota_tasks_; | 113 TaskSet running_quota_tasks_; |
| 113 }; | 114 }; |
| 114 } | 115 } |
| 115 | 116 |
| 116 #endif // WEBKIT_QUOTA_QUOTA_TASK_H_ | 117 #endif // WEBKIT_QUOTA_QUOTA_TASK_H_ |
| OLD | NEW |