| 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 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <functional> | 10 #include <functional> |
| (...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 } | 1275 } |
| 1276 | 1276 |
| 1277 void QuotaManager::RemoveStorageObserverForFilter( | 1277 void QuotaManager::RemoveStorageObserverForFilter( |
| 1278 StorageObserver* observer, const StorageObserver::Filter& filter) { | 1278 StorageObserver* observer, const StorageObserver::Filter& filter) { |
| 1279 DCHECK(observer); | 1279 DCHECK(observer); |
| 1280 storage_monitor_->RemoveObserverForFilter(observer, filter); | 1280 storage_monitor_->RemoveObserverForFilter(observer, filter); |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 QuotaManager::~QuotaManager() { | 1283 QuotaManager::~QuotaManager() { |
| 1284 proxy_->manager_ = NULL; | 1284 proxy_->manager_ = NULL; |
| 1285 std::for_each(clients_.begin(), clients_.end(), | 1285 for (auto* client : clients_) |
| 1286 std::mem_fun(&QuotaClient::OnQuotaManagerDestroyed)); | 1286 client->OnQuotaManagerDestroyed(); |
| 1287 if (database_) | 1287 if (database_) |
| 1288 db_thread_->DeleteSoon(FROM_HERE, database_.release()); | 1288 db_thread_->DeleteSoon(FROM_HERE, database_.release()); |
| 1289 } | 1289 } |
| 1290 | 1290 |
| 1291 QuotaManager::EvictionContext::EvictionContext() | 1291 QuotaManager::EvictionContext::EvictionContext() |
| 1292 : evicted_type(kStorageTypeUnknown) { | 1292 : evicted_type(kStorageTypeUnknown) { |
| 1293 } | 1293 } |
| 1294 | 1294 |
| 1295 QuotaManager::EvictionContext::~EvictionContext() { | 1295 QuotaManager::EvictionContext::~EvictionContext() { |
| 1296 } | 1296 } |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1832 return false; | 1832 return false; |
| 1833 *available_space = static_cast<uint64_t>(stats.f_bavail) * stats.f_frsize; | 1833 *available_space = static_cast<uint64_t>(stats.f_bavail) * stats.f_frsize; |
| 1834 *total_size = static_cast<uint64_t>(stats.f_blocks) * stats.f_frsize; | 1834 *total_size = static_cast<uint64_t>(stats.f_blocks) * stats.f_frsize; |
| 1835 #else | 1835 #else |
| 1836 #error Not implemented | 1836 #error Not implemented |
| 1837 #endif | 1837 #endif |
| 1838 return true; | 1838 return true; |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 } // namespace storage | 1841 } // namespace storage |
| OLD | NEW |