| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_COMMON_BLOB_STORAGE_BLOB_STORAGE_CONSTANTS_H_ | 5 #ifndef STORAGE_COMMON_BLOB_STORAGE_BLOB_STORAGE_CONSTANTS_H_ |
| 6 #define STORAGE_COMMON_BLOB_STORAGE_BLOB_STORAGE_CONSTANTS_H_ | 6 #define STORAGE_COMMON_BLOB_STORAGE_BLOB_STORAGE_CONSTANTS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 namespace storage { | 11 namespace storage { |
| 12 | 12 |
| 13 // TODO(michaeln): use base::SysInfo::AmountOfPhysicalMemoryMB() in some | 13 // TODO(michaeln): use base::SysInfo::AmountOfPhysicalMemoryMB() in some |
| 14 // way to come up with a better limit. | 14 // way to come up with a better limit. |
| 15 const int64_t kBlobStorageMaxMemoryUsage = 500 * 1024 * 1024; // Half a gig. | 15 const int64_t kBlobStorageMaxMemoryUsage = 500 * 1024 * 1024; // Half a gig. |
| 16 const size_t kBlobStorageIPCThresholdBytes = 250 * 1024; | 16 const size_t kBlobStorageIPCThresholdBytes = 250 * 1024; |
| 17 const size_t kBlobStorageMaxSharedMemoryBytes = 10 * 1024 * 1024; | 17 const size_t kBlobStorageMaxSharedMemoryBytes = 10 * 1024 * 1024; |
| 18 const uint64_t kBlobStorageMaxFileSizeBytes = 100 * 1024 * 1024; | 18 const uint64_t kBlobStorageMaxFileSizeBytes = 100 * 1024 * 1024; |
| 19 const uint64_t kBlobStorageMinFileSizeBytes = 1 * 1024 * 1024; | 19 const uint64_t kBlobStorageMinFileSizeBytes = 5 * 1024 * 1024; |
| 20 const size_t kBlobStorageMaxBlobMemorySize = | 20 const size_t kBlobStorageMaxBlobMemorySize = |
| 21 kBlobStorageMaxMemoryUsage - kBlobStorageMinFileSizeBytes; | 21 kBlobStorageMaxMemoryUsage - kBlobStorageMinFileSizeBytes; |
| 22 const uint64_t kBlobStorageInFlightMemory = kBlobStorageMinFileSizeBytes; |
| 23 const uint64_t kBlobStorageMaxDiskSpace = |
| 24 5ull * 1024ull * 1024ull * 1024ull; // 5 gigs. |
| 22 | 25 |
| 23 enum class IPCBlobItemRequestStrategy { | 26 enum class IPCBlobItemRequestStrategy { |
| 24 UNKNOWN = 0, | 27 UNKNOWN = 0, |
| 25 IPC, | 28 IPC, |
| 26 SHARED_MEMORY, | 29 SHARED_MEMORY, |
| 27 FILE, | 30 FILE, |
| 28 LAST = FILE | 31 LAST = FILE |
| 29 }; | 32 }; |
| 30 | 33 |
| 31 // These items cannot be reordered or renumbered because they're recorded to | 34 // These items cannot be reordered or renumbered because they're recorded to |
| (...skipping 13 matching lines...) Expand all Loading... |
| 45 // A blob that we referenced during construction is broken, or a browser-side | 48 // A blob that we referenced during construction is broken, or a browser-side |
| 46 // builder tries to build a blob with a blob reference that isn't finished | 49 // builder tries to build a blob with a blob reference that isn't finished |
| 47 // constructing. | 50 // constructing. |
| 48 REFERENCED_BLOB_BROKEN = 5, | 51 REFERENCED_BLOB_BROKEN = 5, |
| 49 LAST = REFERENCED_BLOB_BROKEN | 52 LAST = REFERENCED_BLOB_BROKEN |
| 50 }; | 53 }; |
| 51 | 54 |
| 52 } // namespace storage | 55 } // namespace storage |
| 53 | 56 |
| 54 #endif // STORAGE_COMMON_BLOB_STORAGE_BLOB_STORAGE_CONSTANTS_H_ | 57 #endif // STORAGE_COMMON_BLOB_STORAGE_BLOB_STORAGE_CONSTANTS_H_ |
| OLD | NEW |