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

Side by Side Diff: content/browser/quota/mock_quota_manager.cc

Issue 1782053004: Change how the quota system computes the total poolsize for temporary storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 3 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/quota/mock_quota_manager.h" 5 #include "content/browser/quota/mock_quota_manager.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 26 matching lines...) Expand all
37 MockQuotaManager::MockQuotaManager( 37 MockQuotaManager::MockQuotaManager(
38 bool is_incognito, 38 bool is_incognito,
39 const base::FilePath& profile_path, 39 const base::FilePath& profile_path,
40 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, 40 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread,
41 const scoped_refptr<base::SequencedTaskRunner>& db_thread, 41 const scoped_refptr<base::SequencedTaskRunner>& db_thread,
42 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy) 42 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy)
43 : QuotaManager(is_incognito, 43 : QuotaManager(is_incognito,
44 profile_path, 44 profile_path,
45 io_thread, 45 io_thread,
46 db_thread, 46 db_thread,
47 special_storage_policy), 47 special_storage_policy,
48 weak_factory_(this) { 48 storage::GetQuotaSettingsFunc()),
49 } 49 weak_factory_(this) {}
50 50
51 void MockQuotaManager::GetUsageAndQuota( 51 void MockQuotaManager::GetUsageAndQuota(const GURL& origin,
52 const GURL& origin, 52 storage::StorageType type,
53 storage::StorageType type, 53 const UsageAndQuotaCallback& callback) {
54 const GetUsageAndQuotaCallback& callback) {
55 StorageInfo& info = usage_and_quota_map_[std::make_pair(origin, type)]; 54 StorageInfo& info = usage_and_quota_map_[std::make_pair(origin, type)];
56 callback.Run(storage::kQuotaStatusOk, info.usage, info.quota); 55 callback.Run(storage::kQuotaStatusOk, info.usage, info.quota);
57 } 56 }
58 57
59 void MockQuotaManager::SetQuota(const GURL& origin, 58 void MockQuotaManager::SetQuota(const GURL& origin,
60 StorageType type, 59 StorageType type,
61 int64_t quota) { 60 int64_t quota) {
62 usage_and_quota_map_[std::make_pair(origin, type)].quota = quota; 61 usage_and_quota_map_[std::make_pair(origin, type)].quota = quota;
63 } 62 }
64 63
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 callback.Run(*origins, storage_type); 141 callback.Run(*origins, storage_type);
143 } 142 }
144 143
145 void MockQuotaManager::DidDeleteOriginData( 144 void MockQuotaManager::DidDeleteOriginData(
146 const StatusCallback& callback, 145 const StatusCallback& callback,
147 QuotaStatusCode status) { 146 QuotaStatusCode status) {
148 callback.Run(status); 147 callback.Run(status);
149 } 148 }
150 149
151 } // namespace content 150 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/quota/mock_quota_manager.h ('k') | content/browser/quota/mock_quota_manager_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698