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

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 4 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
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 storage::GetTemporaryStorageConfigurationFunc()),
48 weak_factory_(this) { 49 weak_factory_(this) {
49 } 50 }
50 51
51 void MockQuotaManager::GetUsageAndQuota( 52 void MockQuotaManager::GetUsageAndQuota(
52 const GURL& origin, 53 const GURL& origin,
53 storage::StorageType type, 54 storage::StorageType type,
54 const GetUsageAndQuotaCallback& callback) { 55 const UsageAndQuotaCallback& callback) {
55 StorageInfo& info = usage_and_quota_map_[std::make_pair(origin, type)]; 56 StorageInfo& info = usage_and_quota_map_[std::make_pair(origin, type)];
56 callback.Run(storage::kQuotaStatusOk, info.usage, info.quota); 57 callback.Run(storage::kQuotaStatusOk, info.usage, info.quota);
57 } 58 }
58 59
59 void MockQuotaManager::SetQuota(const GURL& origin, 60 void MockQuotaManager::SetQuota(const GURL& origin,
60 StorageType type, 61 StorageType type,
61 int64_t quota) { 62 int64_t quota) {
62 usage_and_quota_map_[std::make_pair(origin, type)].quota = quota; 63 usage_and_quota_map_[std::make_pair(origin, type)].quota = quota;
63 } 64 }
64 65
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 callback.Run(*origins, storage_type); 143 callback.Run(*origins, storage_type);
143 } 144 }
144 145
145 void MockQuotaManager::DidDeleteOriginData( 146 void MockQuotaManager::DidDeleteOriginData(
146 const StatusCallback& callback, 147 const StatusCallback& callback,
147 QuotaStatusCode status) { 148 QuotaStatusCode status) {
148 callback.Run(status); 149 callback.Run(status);
149 } 150 }
150 151
151 } // namespace content 152 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698