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

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

Issue 842003002: Re-land: base: Fix DiscardableSharedMemory::mapped_size(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unit test Created 5 years, 11 months 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 | « no previous file | base/memory/discardable_shared_memory_unittest.cc » ('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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 SharedState result(subtle::NoBarrier_Load( 346 SharedState result(subtle::NoBarrier_Load(
347 &SharedStateFromSharedMemory(shared_memory_)->value.i)); 347 &SharedStateFromSharedMemory(shared_memory_)->value.i));
348 348
349 return result.GetLockState() == SharedState::LOCKED || 349 return result.GetLockState() == SharedState::LOCKED ||
350 !result.GetTimestamp().is_null(); 350 !result.GetTimestamp().is_null();
351 } 351 }
352 352
353 void DiscardableSharedMemory::Close() { 353 void DiscardableSharedMemory::Close() {
354 shared_memory_.Unmap(); 354 shared_memory_.Unmap();
355 shared_memory_.Close(); 355 shared_memory_.Close();
356 mapped_size_ = 0;
356 } 357 }
357 358
358 Time DiscardableSharedMemory::Now() const { 359 Time DiscardableSharedMemory::Now() const {
359 return Time::Now(); 360 return Time::Now();
360 } 361 }
361 362
362 } // namespace base 363 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/memory/discardable_shared_memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698