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

Side by Side Diff: webkit/quota/quota_task.h

Issue 10832407: Quota double-delete fix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thread checker Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/quota/quota_task.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | webkit/quota/quota_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698