| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SHARED_MEMORY_H_ | 5 #ifndef BASE_MEMORY_DISCARDABLE_SHARED_MEMORY_H_ |
| 6 #define BASE_MEMORY_DISCARDABLE_SHARED_MEMORY_H_ | 6 #define BASE_MEMORY_DISCARDABLE_SHARED_MEMORY_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 size_t mapped_size_; | 137 size_t mapped_size_; |
| 138 size_t locked_page_count_; | 138 size_t locked_page_count_; |
| 139 #if DCHECK_IS_ON() | 139 #if DCHECK_IS_ON() |
| 140 std::set<size_t> locked_pages_; | 140 std::set<size_t> locked_pages_; |
| 141 #endif | 141 #endif |
| 142 // Implementation is not thread-safe but still usable if clients are | 142 // Implementation is not thread-safe but still usable if clients are |
| 143 // synchronized somehow. Use a collision warner to detect incorrect usage. | 143 // synchronized somehow. Use a collision warner to detect incorrect usage. |
| 144 DFAKE_MUTEX(thread_collision_warner_); | 144 DFAKE_MUTEX(thread_collision_warner_); |
| 145 Time last_known_usage_; | 145 Time last_known_usage_; |
| 146 | 146 |
| 147 // Indicates whether Lock/Unlock pinning is supported on this platform. |
| 148 // Call DoPinning() to access this information from within class functions. |
| 149 static char pinning_supported_; |
| 150 bool DoPinning(); |
| 151 |
| 147 DISALLOW_COPY_AND_ASSIGN(DiscardableSharedMemory); | 152 DISALLOW_COPY_AND_ASSIGN(DiscardableSharedMemory); |
| 148 }; | 153 }; |
| 149 | 154 |
| 150 } // namespace base | 155 } // namespace base |
| 151 | 156 |
| 152 #endif // BASE_MEMORY_DISCARDABLE_SHARED_MEMORY_H_ | 157 #endif // BASE_MEMORY_DISCARDABLE_SHARED_MEMORY_H_ |
| OLD | NEW |