diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 03:07:19 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 03:07:19 +0000 |
commit | 42472adb9c498f5cd01a52484618472f7cdc9f97 (patch) | |
tree | 675d4682e26d9ffc463610530606fbc8b9c27340 /webkit/quota | |
parent | 5f0ce949949d47df43553f0d98d17c4885a22a17 (diff) | |
download | chromium_src-42472adb9c498f5cd01a52484618472f7cdc9f97.zip chromium_src-42472adb9c498f5cd01a52484618472f7cdc9f97.tar.gz chromium_src-42472adb9c498f5cd01a52484618472f7cdc9f97.tar.bz2 |
Implement DatabaseQuotaClient's DeteleteOriginData method.
TEST=database_quota_client_unittest.cc
BUG=61676
Review URL: http://codereview.chromium.org/7046019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/quota')
-rw-r--r-- | webkit/quota/quota_task.cc | 12 | ||||
-rw-r--r-- | webkit/quota/quota_task.h | 14 |
2 files changed, 22 insertions, 4 deletions
diff --git a/webkit/quota/quota_task.cc b/webkit/quota/quota_task.cc index 78a8b36..1f25ddf 100644 --- a/webkit/quota/quota_task.cc +++ b/webkit/quota/quota_task.cc @@ -67,9 +67,17 @@ void QuotaThreadTask::Run() { void QuotaThreadTask::CallRunOnTargetThread() { DCHECK(target_message_loop_->BelongsToCurrentThread()); + if (RunOnTargetThreadAsync()) + original_message_loop()->PostTask( + FROM_HERE, NewRunnableMethod(this, &QuotaThreadTask::CallCompleted)); +} + +bool QuotaThreadTask::RunOnTargetThreadAsync() { RunOnTargetThread(); - original_message_loop()->PostTask( - FROM_HERE, NewRunnableMethod(this, &QuotaThreadTask::CallCompleted)); + return true; +} + +void QuotaThreadTask::RunOnTargetThread() { } // QuotaTaskObserver ------------------------------------------------------- diff --git a/webkit/quota/quota_task.h b/webkit/quota/quota_task.h index 860ec0d..6b56593 100644 --- a/webkit/quota/quota_task.h +++ b/webkit/quota/quota_task.h @@ -66,8 +66,18 @@ class QuotaThreadTask : public QuotaTask, protected: virtual ~QuotaThreadTask(); - // Called on the target message loop. - virtual void RunOnTargetThread() = 0; + // One of the following Run methods should be overriden for execution + // on the target thread. + + // A task to invoke the CallCompleted() method on the original thread will + // be scheduled immediately upon return from RunOnTargetThread(). + virtual void RunOnTargetThread(); + + // A task to invoke the CallCompleted() method on the original thread will + // only be scheduled if RunOnTargetThreadAsync returns true. If false is + // returned, the derived class should schedule a task to do so upon actual + // completion. + virtual bool RunOnTargetThreadAsync(); virtual void Run() OVERRIDE; scoped_refptr<base::MessageLoopProxy> target_message_loop() const { |