| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_H_ | 5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_H_ |
| 6 #define BASE_MEMORY_DISCARDABLE_MEMORY_H_ | 6 #define BASE_MEMORY_DISCARDABLE_MEMORY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/base_export.h" | 11 #include "base/base_export.h" |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 | 17 |
| 18 enum DiscardableMemoryType { | 18 enum DiscardableMemoryType { |
| 19 DISCARDABLE_MEMORY_TYPE_NONE, | 19 DISCARDABLE_MEMORY_TYPE_NONE, |
| 20 DISCARDABLE_MEMORY_TYPE_MACH, | |
| 21 DISCARDABLE_MEMORY_TYPE_SHMEM | 20 DISCARDABLE_MEMORY_TYPE_SHMEM |
| 22 }; | 21 }; |
| 23 | 22 |
| 24 enum DiscardableMemoryLockStatus { | 23 enum DiscardableMemoryLockStatus { |
| 25 DISCARDABLE_MEMORY_LOCK_STATUS_FAILED, | 24 DISCARDABLE_MEMORY_LOCK_STATUS_FAILED, |
| 26 DISCARDABLE_MEMORY_LOCK_STATUS_PURGED, | 25 DISCARDABLE_MEMORY_LOCK_STATUS_PURGED, |
| 27 DISCARDABLE_MEMORY_LOCK_STATUS_SUCCESS | 26 DISCARDABLE_MEMORY_LOCK_STATUS_SUCCESS |
| 28 }; | 27 }; |
| 29 | 28 |
| 30 // Platform abstraction for discardable memory. DiscardableMemory is used to | 29 // Platform abstraction for discardable memory. DiscardableMemory is used to |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 virtual void Unlock() = 0; | 99 virtual void Unlock() = 0; |
| 101 | 100 |
| 102 // Returns the memory address held by this object. The object must be locked | 101 // Returns the memory address held by this object. The object must be locked |
| 103 // before calling this. Otherwise, this will cause a DCHECK error. | 102 // before calling this. Otherwise, this will cause a DCHECK error. |
| 104 virtual void* Memory() const = 0; | 103 virtual void* Memory() const = 0; |
| 105 }; | 104 }; |
| 106 | 105 |
| 107 } // namespace base | 106 } // namespace base |
| 108 | 107 |
| 109 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_H_ | 108 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_H_ |
| OLD | NEW |