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

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

Issue 1259333003: [tracing] Add SkResourceCache as suballocation to avoid double counting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@skia_v1
Patch Set: Fixing comments. Created 5 years, 4 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
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return static_cast<SharedState*>(shared_memory.memory()); 90 return static_cast<SharedState*>(shared_memory.memory());
91 } 91 }
92 92
93 // Round up |size| to a multiple of page size. 93 // Round up |size| to a multiple of page size.
94 size_t AlignToPageSize(size_t size) { 94 size_t AlignToPageSize(size_t size) {
95 return bits::Align(size, base::GetPageSize()); 95 return bits::Align(size, base::GetPageSize());
96 } 96 }
97 97
98 } // namespace 98 } // namespace
99 99
100 // static
101 const char DiscardableSharedMemory::kAllocatedObjectsDumpName[] =
102 "discardable/allocated_objects";
reveman 2015/07/29 18:32:11 same here. I don' think this is the right place fo
ssid 2015/07/30 20:05:15 Done.
103
100 DiscardableSharedMemory::DiscardableSharedMemory() 104 DiscardableSharedMemory::DiscardableSharedMemory()
101 : mapped_size_(0), locked_page_count_(0) { 105 : mapped_size_(0), locked_page_count_(0) {
102 } 106 }
103 107
104 DiscardableSharedMemory::DiscardableSharedMemory( 108 DiscardableSharedMemory::DiscardableSharedMemory(
105 SharedMemoryHandle shared_memory_handle) 109 SharedMemoryHandle shared_memory_handle)
106 : shared_memory_(shared_memory_handle, false), 110 : shared_memory_(shared_memory_handle, false),
107 mapped_size_(0), 111 mapped_size_(0),
108 locked_page_count_(0) { 112 locked_page_count_(0) {
109 } 113 }
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 NOTIMPLEMENTED(); 366 NOTIMPLEMENTED();
363 #endif 367 #endif
364 } 368 }
365 #endif 369 #endif
366 370
367 Time DiscardableSharedMemory::Now() const { 371 Time DiscardableSharedMemory::Now() const {
368 return Time::Now(); 372 return Time::Now();
369 } 373 }
370 374
371 } // namespace base 375 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698