Chromium Code Reviews| Index: base/memory/discardable_shared_memory.cc |
| diff --git a/base/memory/discardable_shared_memory.cc b/base/memory/discardable_shared_memory.cc |
| index 0f85c1fe903d612ecf055043c1a0d84d362ddbf7..f36333a3500b6e2802dc454f110f1cb9ad143d71 100644 |
| --- a/base/memory/discardable_shared_memory.cc |
| +++ b/base/memory/discardable_shared_memory.cc |
| @@ -340,6 +340,15 @@ bool DiscardableSharedMemory::IsMemoryResident() const { |
| !result.GetTimestamp().is_null(); |
| } |
| +bool DiscardableSharedMemory::IsMemoryLocked() const { |
| + DCHECK(IsMemoryResident()); |
|
reveman
2015/10/01 14:39:00
hm, I was just thinking we'd DCHECK(shared_memory_
ssid
2015/10/01 14:48:24
You told me to make it DCHECK(IsMemoryResident) in
reveman
2015/10/01 14:54:13
By "DCHECK as IsMemoryResident" I meant DCHECK in
|
| + |
| + SharedState result(subtle::NoBarrier_Load( |
| + &SharedStateFromSharedMemory(shared_memory_)->value.i)); |
| + |
| + return result.GetLockState() == SharedState::LOCKED; |
| +} |
| + |
| void DiscardableSharedMemory::Close() { |
| shared_memory_.Close(); |
| } |