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

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

Issue 7046019: Implement DatabaseQuotaClient's DeteleteOriginData method. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 | « webkit/quota/quota_task.h ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/quota/quota_task.h" 5 #include "webkit/quota/quota_task.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 QuotaThreadTask::~QuotaThreadTask() { 60 QuotaThreadTask::~QuotaThreadTask() {
61 } 61 }
62 62
63 void QuotaThreadTask::Run() { 63 void QuotaThreadTask::Run() {
64 target_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( 64 target_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
65 this, &QuotaThreadTask::CallRunOnTargetThread)); 65 this, &QuotaThreadTask::CallRunOnTargetThread));
66 } 66 }
67 67
68 void QuotaThreadTask::CallRunOnTargetThread() { 68 void QuotaThreadTask::CallRunOnTargetThread() {
69 DCHECK(target_message_loop_->BelongsToCurrentThread()); 69 DCHECK(target_message_loop_->BelongsToCurrentThread());
70 if (RunOnTargetThreadAsync())
71 original_message_loop()->PostTask(
72 FROM_HERE, NewRunnableMethod(this, &QuotaThreadTask::CallCompleted));
73 }
74
75 bool QuotaThreadTask::RunOnTargetThreadAsync() {
70 RunOnTargetThread(); 76 RunOnTargetThread();
71 original_message_loop()->PostTask( 77 return true;
72 FROM_HERE, NewRunnableMethod(this, &QuotaThreadTask::CallCompleted)); 78 }
79
80 void QuotaThreadTask::RunOnTargetThread() {
73 } 81 }
74 82
75 // QuotaTaskObserver ------------------------------------------------------- 83 // QuotaTaskObserver -------------------------------------------------------
76 84
77 QuotaTaskObserver::~QuotaTaskObserver() { 85 QuotaTaskObserver::~QuotaTaskObserver() {
78 std::for_each(running_quota_tasks_.begin(), 86 std::for_each(running_quota_tasks_.begin(),
79 running_quota_tasks_.end(), 87 running_quota_tasks_.end(),
80 std::mem_fun(&QuotaTask::Abort)); 88 std::mem_fun(&QuotaTask::Abort));
81 } 89 }
82 90
83 QuotaTaskObserver::QuotaTaskObserver() { 91 QuotaTaskObserver::QuotaTaskObserver() {
84 } 92 }
85 93
86 void QuotaTaskObserver::RegisterTask(QuotaTask* task) { 94 void QuotaTaskObserver::RegisterTask(QuotaTask* task) {
87 running_quota_tasks_.insert(task); 95 running_quota_tasks_.insert(task);
88 } 96 }
89 97
90 void QuotaTaskObserver::UnregisterTask(QuotaTask* task) { 98 void QuotaTaskObserver::UnregisterTask(QuotaTask* task) {
91 DCHECK(running_quota_tasks_.find(task) != running_quota_tasks_.end()); 99 DCHECK(running_quota_tasks_.find(task) != running_quota_tasks_.end());
92 running_quota_tasks_.erase(task); 100 running_quota_tasks_.erase(task);
93 } 101 }
94 102
95 } // namespace quota 103 } // namespace quota
OLDNEW
« no previous file with comments | « webkit/quota/quota_task.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698