OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "storage/browser/quota/quota_manager.h" | 5 #include "storage/browser/quota/quota_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | |
10 #include <algorithm> | 9 #include <algorithm> |
11 #include <functional> | 10 #include <functional> |
12 #include <limits> | 11 #include <limits> |
| 12 #include <utility> |
13 | 13 |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
20 #include "base/profiler/scoped_tracker.h" | 20 #include "base/profiler/scoped_tracker.h" |
21 #include "base/sequenced_task_runner.h" | 21 #include "base/sequenced_task_runner.h" |
22 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 const GURL& origin, | 997 const GURL& origin, |
998 StorageType type, | 998 StorageType type, |
999 bool enabled) { | 999 bool enabled) { |
1000 LazyInitialize(); | 1000 LazyInitialize(); |
1001 DCHECK(GetUsageTracker(type)); | 1001 DCHECK(GetUsageTracker(type)); |
1002 GetUsageTracker(type)->SetUsageCacheEnabled(client_id, origin, enabled); | 1002 GetUsageTracker(type)->SetUsageCacheEnabled(client_id, origin, enabled); |
1003 } | 1003 } |
1004 | 1004 |
1005 void QuotaManager::SetTemporaryStorageEvictionPolicy( | 1005 void QuotaManager::SetTemporaryStorageEvictionPolicy( |
1006 scoped_ptr<QuotaEvictionPolicy> policy) { | 1006 scoped_ptr<QuotaEvictionPolicy> policy) { |
1007 temporary_storage_eviction_policy_ = policy.Pass(); | 1007 temporary_storage_eviction_policy_ = std::move(policy); |
1008 } | 1008 } |
1009 | 1009 |
1010 void QuotaManager::DeleteOriginData(const GURL& origin, | 1010 void QuotaManager::DeleteOriginData(const GURL& origin, |
1011 StorageType type, | 1011 StorageType type, |
1012 int quota_client_mask, | 1012 int quota_client_mask, |
1013 const StatusCallback& callback) { | 1013 const StatusCallback& callback) { |
1014 DeleteOriginDataInternal(origin, type, quota_client_mask, false, callback); | 1014 DeleteOriginDataInternal(origin, type, quota_client_mask, false, callback); |
1015 } | 1015 } |
1016 | 1016 |
1017 void QuotaManager::DeleteHostData(const std::string& host, | 1017 void QuotaManager::DeleteHostData(const std::string& host, |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 return false; | 1799 return false; |
1800 *available_space = static_cast<uint64_t>(stats.f_bavail) * stats.f_frsize; | 1800 *available_space = static_cast<uint64_t>(stats.f_bavail) * stats.f_frsize; |
1801 *total_size = static_cast<uint64_t>(stats.f_blocks) * stats.f_frsize; | 1801 *total_size = static_cast<uint64_t>(stats.f_blocks) * stats.f_frsize; |
1802 #else | 1802 #else |
1803 #error Not implemented | 1803 #error Not implemented |
1804 #endif | 1804 #endif |
1805 return true; | 1805 return true; |
1806 } | 1806 } |
1807 | 1807 |
1808 } // namespace storage | 1808 } // namespace storage |
OLD | NEW |