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

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

Issue 10197007: Change webkit/{fileapi,quota} code to use TaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 8 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/mock_quota_manager.h ('k') | webkit/quota/quota_manager.h » ('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 #include "webkit/quota/mock_quota_manager.h" 5 #include "webkit/quota/mock_quota_manager.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/single_thread_task_runner.h"
13 #include "googleurl/src/gurl.h" 14 #include "googleurl/src/gurl.h"
14 #include "webkit/quota/quota_client.h"
15 #include "webkit/quota/quota_manager.h"
16 #include "webkit/quota/quota_task.h"
17 #include "webkit/quota/quota_types.h"
18 15
19 namespace quota { 16 namespace quota {
20 17
21 class MockQuotaManager::GetModifiedSinceTask : public QuotaThreadTask { 18 class MockQuotaManager::GetModifiedSinceTask : public QuotaThreadTask {
22 public: 19 public:
23 GetModifiedSinceTask(MockQuotaManager* manager, 20 GetModifiedSinceTask(MockQuotaManager* manager,
24 const std::set<GURL>& origins, 21 const std::set<GURL>& origins,
25 StorageType type, 22 StorageType type,
26 const GetOriginsCallback& callback) 23 const GetOriginsCallback& callback)
27 : QuotaThreadTask(manager, manager->io_thread_), 24 : QuotaThreadTask(manager, manager->io_thread_.get()),
28 origins_(origins), 25 origins_(origins),
29 type_(type), 26 type_(type),
30 callback_(callback) { 27 callback_(callback) {
31 } 28 }
32 29
33 protected: 30 protected:
34 virtual ~GetModifiedSinceTask() {} 31 virtual ~GetModifiedSinceTask() {}
35 32
36 // QuotaThreadTask: 33 // QuotaThreadTask:
37 virtual void RunOnTargetThread() OVERRIDE {} 34 virtual void RunOnTargetThread() OVERRIDE {}
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 type(type), 86 type(type),
90 quota_client_mask(quota_client_mask), 87 quota_client_mask(quota_client_mask),
91 modified(modified) { 88 modified(modified) {
92 } 89 }
93 90
94 MockQuotaManager::OriginInfo::~OriginInfo() {} 91 MockQuotaManager::OriginInfo::~OriginInfo() {}
95 92
96 MockQuotaManager::MockQuotaManager( 93 MockQuotaManager::MockQuotaManager(
97 bool is_incognito, 94 bool is_incognito,
98 const FilePath& profile_path, 95 const FilePath& profile_path,
99 base::MessageLoopProxy* io_thread, 96 base::SingleThreadTaskRunner* io_thread,
100 base::MessageLoopProxy* db_thread, 97 base::SequencedTaskRunner* db_thread,
101 SpecialStoragePolicy* special_storage_policy) 98 SpecialStoragePolicy* special_storage_policy)
102 : QuotaManager(is_incognito, profile_path, io_thread, db_thread, 99 : QuotaManager(is_incognito, profile_path, io_thread, db_thread,
103 special_storage_policy) { 100 special_storage_policy) {
104 } 101 }
105 102
106 bool MockQuotaManager::AddOrigin( 103 bool MockQuotaManager::AddOrigin(
107 const GURL& origin, 104 const GURL& origin,
108 StorageType type, 105 StorageType type,
109 int quota_client_mask, 106 int quota_client_mask,
110 base::Time modified) { 107 base::Time modified) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 origins_.erase(current); 154 origins_.erase(current);
158 break; 155 break;
159 } 156 }
160 } 157 }
161 make_scoped_refptr(new DeleteOriginDataTask(this, callback))->Start(); 158 make_scoped_refptr(new DeleteOriginDataTask(this, callback))->Start();
162 } 159 }
163 160
164 MockQuotaManager::~MockQuotaManager() {} 161 MockQuotaManager::~MockQuotaManager() {}
165 162
166 } // namespace quota 163 } // namespace quota
OLDNEW
« no previous file with comments | « webkit/quota/mock_quota_manager.h ('k') | webkit/quota/quota_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698