| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef STORAGE_BROWSER_BLOB_BLOB_MEMORY_CONTROLLER_H_ | 5 #ifndef STORAGE_BROWSER_BLOB_BLOB_MEMORY_CONTROLLER_H_ |
| 6 #define STORAGE_BROWSER_BLOB_BLOB_MEMORY_CONTROLLER_H_ | 6 #define STORAGE_BROWSER_BLOB_BLOB_MEMORY_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "base/optional.h" | 27 #include "base/optional.h" |
| 28 #include "base/time/time.h" | 28 #include "base/time/time.h" |
| 29 #include "storage/browser/storage_browser_export.h" | 29 #include "storage/browser/storage_browser_export.h" |
| 30 #include "storage/common/blob_storage/blob_storage_constants.h" | 30 #include "storage/common/blob_storage/blob_storage_constants.h" |
| 31 | 31 |
| 32 namespace base { | 32 namespace base { |
| 33 class TaskRunner; | 33 class TaskRunner; |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace storage { | 36 namespace storage { |
| 37 class DataElement; | |
| 38 class ShareableBlobDataItem; | 37 class ShareableBlobDataItem; |
| 39 class ShareableFileReference; | 38 class ShareableFileReference; |
| 40 | 39 |
| 41 // This class's main responsibility is deciding how blob data gets stored. | 40 // This class's main responsibility is deciding how blob data gets stored. |
| 42 // This encompasses: | 41 // This encompasses: |
| 43 // * Keeping track of memory & file quota, | 42 // * Keeping track of memory & file quota, |
| 44 // * How to transport the blob data from the renderer (DetermineStrategy), | 43 // * How to transport the blob data from the renderer (DetermineStrategy), |
| 45 // * Allocating memory & file quota (ReserveMemoryQuota, ReserveFileQuota) | 44 // * Allocating memory & file quota (ReserveMemoryQuota, ReserveFileQuota) |
| 46 // * Paging memory quota to disk when we're nearing our memory limit, and | 45 // * Paging memory quota to disk when we're nearing our memory limit, and |
| 47 // * Maintaining an LRU of memory items to choose candidates to page to disk | 46 // * Maintaining an LRU of memory items to choose candidates to page to disk |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // another blob successfully grabs a ref, we can prevent it from adding the | 242 // another blob successfully grabs a ref, we can prevent it from adding the |
| 244 // item to the recent_item_cache_ above. | 243 // item to the recent_item_cache_ above. |
| 245 std::unordered_set<uint64_t> items_paging_to_file_; | 244 std::unordered_set<uint64_t> items_paging_to_file_; |
| 246 | 245 |
| 247 base::WeakPtrFactory<BlobMemoryController> weak_factory_; | 246 base::WeakPtrFactory<BlobMemoryController> weak_factory_; |
| 248 | 247 |
| 249 DISALLOW_COPY_AND_ASSIGN(BlobMemoryController); | 248 DISALLOW_COPY_AND_ASSIGN(BlobMemoryController); |
| 250 }; | 249 }; |
| 251 } // namespace storage | 250 } // namespace storage |
| 252 #endif // STORAGE_BROWSER_BLOB_BLOB_MEMORY_CONTROLLER_H_ | 251 #endif // STORAGE_BROWSER_BLOB_BLOB_MEMORY_CONTROLLER_H_ |
| OLD | NEW |