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

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

Issue 8342004: base::Bind: Final cleanups in webkit/quota. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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_manager.cc ('k') | webkit/quota/quota_temporary_storage_evictor_unittest.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) 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/bind.h"
10 #include "base/message_loop.h" 11 #include "base/message_loop.h"
11 #include "base/message_loop_proxy.h" 12 #include "base/message_loop_proxy.h"
12 13
13 using base::MessageLoopProxy; 14 using base::MessageLoopProxy;
14 15
15 namespace quota { 16 namespace quota {
16 17
17 // QuotaTask --------------------------------------------------------------- 18 // QuotaTask ---------------------------------------------------------------
18 19
19 QuotaTask::~QuotaTask() { 20 QuotaTask::~QuotaTask() {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 QuotaTaskObserver* observer, 55 QuotaTaskObserver* observer,
55 scoped_refptr<MessageLoopProxy> target_message_loop) 56 scoped_refptr<MessageLoopProxy> target_message_loop)
56 : QuotaTask(observer), 57 : QuotaTask(observer),
57 target_message_loop_(target_message_loop) { 58 target_message_loop_(target_message_loop) {
58 } 59 }
59 60
60 QuotaThreadTask::~QuotaThreadTask() { 61 QuotaThreadTask::~QuotaThreadTask() {
61 } 62 }
62 63
63 void QuotaThreadTask::Run() { 64 void QuotaThreadTask::Run() {
64 target_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( 65 target_message_loop_->PostTask(
65 this, &QuotaThreadTask::CallRunOnTargetThread)); 66 FROM_HERE,
67 base::Bind(&QuotaThreadTask::CallRunOnTargetThread, this));
66 } 68 }
67 69
68 void QuotaThreadTask::CallRunOnTargetThread() { 70 void QuotaThreadTask::CallRunOnTargetThread() {
69 DCHECK(target_message_loop_->BelongsToCurrentThread()); 71 DCHECK(target_message_loop_->BelongsToCurrentThread());
70 if (RunOnTargetThreadAsync()) 72 if (RunOnTargetThreadAsync())
71 original_message_loop()->PostTask( 73 original_message_loop()->PostTask(
72 FROM_HERE, NewRunnableMethod(this, &QuotaThreadTask::CallCompleted)); 74 FROM_HERE,
75 base::Bind(&QuotaThreadTask::CallCompleted, this));
73 } 76 }
74 77
75 bool QuotaThreadTask::RunOnTargetThreadAsync() { 78 bool QuotaThreadTask::RunOnTargetThreadAsync() {
76 RunOnTargetThread(); 79 RunOnTargetThread();
77 return true; 80 return true;
78 } 81 }
79 82
80 void QuotaThreadTask::RunOnTargetThread() { 83 void QuotaThreadTask::RunOnTargetThread() {
81 } 84 }
82 85
(...skipping 11 matching lines...) Expand all
94 void QuotaTaskObserver::RegisterTask(QuotaTask* task) { 97 void QuotaTaskObserver::RegisterTask(QuotaTask* task) {
95 running_quota_tasks_.insert(task); 98 running_quota_tasks_.insert(task);
96 } 99 }
97 100
98 void QuotaTaskObserver::UnregisterTask(QuotaTask* task) { 101 void QuotaTaskObserver::UnregisterTask(QuotaTask* task) {
99 DCHECK(running_quota_tasks_.find(task) != running_quota_tasks_.end()); 102 DCHECK(running_quota_tasks_.find(task) != running_quota_tasks_.end());
100 running_quota_tasks_.erase(task); 103 running_quota_tasks_.erase(task);
101 } 104 }
102 105
103 } // namespace quota 106 } // namespace quota
OLDNEW
« no previous file with comments | « webkit/quota/quota_manager.cc ('k') | webkit/quota/quota_temporary_storage_evictor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698