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

Side by Side Diff: base/metrics/stats_table.cc

Issue 186473002: Deprecate named base::SharedMemory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « base/memory/shared_memory_win.cc ('k') | chrome/common/service_process_util.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/metrics/stats_table.h" 5 #include "base/metrics/stats_table.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 global_descriptors->Get(kStatsTableSharedMemFd), false); 210 global_descriptors->Get(kStatsTableSharedMemFd), false);
211 return new SharedMemory(file_descriptor, false); 211 return new SharedMemory(file_descriptor, false);
212 } 212 }
213 // Otherwise we need to create it. 213 // Otherwise we need to create it.
214 scoped_ptr<SharedMemory> shared_memory(new SharedMemory()); 214 scoped_ptr<SharedMemory> shared_memory(new SharedMemory());
215 if (!shared_memory->CreateAnonymous(size)) 215 if (!shared_memory->CreateAnonymous(size))
216 return NULL; 216 return NULL;
217 return shared_memory.release(); 217 return shared_memory.release();
218 #elif defined(OS_WIN) 218 #elif defined(OS_WIN)
219 scoped_ptr<SharedMemory> shared_memory(new SharedMemory()); 219 scoped_ptr<SharedMemory> shared_memory(new SharedMemory());
220 if (!shared_memory->CreateNamed(name, true, size)) 220 if (!shared_memory->CreateNamedDeprecated(name, true, size))
221 return NULL; 221 return NULL;
222 return shared_memory.release(); 222 return shared_memory.release();
223 #endif 223 #endif
224 } 224 }
225 225
226 void StatsTable::Internal::InitializeTable(void* memory, int size, 226 void StatsTable::Internal::InitializeTable(void* memory, int size,
227 int max_counters, 227 int max_counters,
228 int max_threads) { 228 int max_threads) {
229 // Zero everything. 229 // Zero everything.
230 memset(memory, 0, size); 230 memset(memory, 0, size);
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 604
605 #if defined(OS_POSIX) 605 #if defined(OS_POSIX)
606 SharedMemoryHandle StatsTable::GetSharedMemoryHandle() const { 606 SharedMemoryHandle StatsTable::GetSharedMemoryHandle() const {
607 if (!internal_) 607 if (!internal_)
608 return SharedMemory::NULLHandle(); 608 return SharedMemory::NULLHandle();
609 return internal_->shared_memory()->handle(); 609 return internal_->shared_memory()->handle();
610 } 610 }
611 #endif 611 #endif
612 612
613 } // namespace base 613 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/shared_memory_win.cc ('k') | chrome/common/service_process_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698