Index: storage/common/blob_storage/blob_storage_constants.h |
diff --git a/storage/common/blob_storage/blob_storage_constants.h b/storage/common/blob_storage/blob_storage_constants.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..77f4e030195ab4475b9c0bdc822f981de27abf22 |
--- /dev/null |
+++ b/storage/common/blob_storage/blob_storage_constants.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef STORAGE_COMMON_BLOB_STORAGE_BLOB_STORAGE_CONSTANTS_H_ |
+#define STORAGE_COMMON_BLOB_STORAGE_BLOB_STORAGE_CONSTANTS_H_ |
+ |
+#include "storage/common/storage_common_export.h" |
+ |
+namespace storage { |
+ |
+// TODO(michaeln): use base::SysInfo::AmountOfPhysicalMemoryMB() in some |
+// way to come up with a better limit. |
+constexpr int64 kBlobStorageMaxMemoryUsage = 500 * 1024 * 1024; // Half a gig. |
+constexpr size_t kBlobStorageIPCThresholdBytes = 250 * 1024; |
+constexpr size_t kBlobStorageMaxSharedMemoryBytes = 10 * 1024 * 1024; |
+constexpr uint64_t kBlobStorageMaxFileSizeBytes = 100 * 1024 * 1024; |
+constexpr uint64_t kBlobStorageMinFileSizeBytes = 1 * 1024 * 1024; |
+constexpr size_t kBlobStorageMaxBlobMemorySize = |
+ kBlobStorageMaxMemoryUsage - kBlobStorageMinFileSizeBytes; |
+ |
+STORAGE_COMMON_EXPORT enum class IPCBlobItemRequestStrategy { |
+ UNKNOWN = 0, |
+ IPC, |
+ SHARED_MEMORY, |
+ FILE, |
+ LAST = FILE |
+}; |
+ |
+STORAGE_COMMON_EXPORT enum class IPCBlobCreationCancelCode { |
+ UNKNOWN = 0, |
+ OUT_OF_MEMORY, |
+ FILE_WRITE_FAILED, |
+ LAST = FILE_WRITE_FAILED |
+}; |
+ |
+} // namespace storage |
+ |
+#endif // STORAGE_COMMON_BLOB_STORAGE_BLOB_STORAGE_CONSTANTS_H_ |