Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: base/memory/discardable_shared_memory.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/mac/sdk_forward_declarations.h ('k') | base/memory/shared_memory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "base/memory/discardable_shared_memory.h" 5 #include "base/memory/discardable_shared_memory.h"
6 6
7 #if defined(OS_POSIX) 7 #if defined(OS_POSIX)
8 #include <unistd.h> 8 #include <unistd.h>
9 #endif 9 #endif
10 10
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 DCHECK(shared_memory_.memory()); 217 DCHECK(shared_memory_.memory());
218 218
219 SharedState result(subtle::NoBarrier_Load( 219 SharedState result(subtle::NoBarrier_Load(
220 &SharedStateFromSharedMemory(shared_memory_)->value.i)); 220 &SharedStateFromSharedMemory(shared_memory_)->value.i));
221 221
222 return result.GetLockState() == SharedState::LOCKED || 222 return result.GetLockState() == SharedState::LOCKED ||
223 !result.GetTimestamp().is_null(); 223 !result.GetTimestamp().is_null();
224 } 224 }
225 225
226 void DiscardableSharedMemory::Close() { 226 void DiscardableSharedMemory::Close() {
227 shared_memory_.Unmap();
227 shared_memory_.Close(); 228 shared_memory_.Close();
228 } 229 }
229 230
230 Time DiscardableSharedMemory::Now() const { 231 Time DiscardableSharedMemory::Now() const {
231 return Time::Now(); 232 return Time::Now();
232 } 233 }
233 234
234 } // namespace base 235 } // namespace base
OLDNEW
« no previous file with comments | « base/mac/sdk_forward_declarations.h ('k') | base/memory/shared_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698