| Index: base/metrics/persistent_histogram_allocator.cc
|
| diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc
|
| index 6006d31fbee70031acb901fb6a0f04a944f5ff04..ba9bc52c594507adba0114b2bf481ace3e8ebb88 100644
|
| --- a/base/metrics/persistent_histogram_allocator.cc
|
| +++ b/base/metrics/persistent_histogram_allocator.cc
|
| @@ -6,9 +6,7 @@
|
|
|
| #include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| -#include "base/memory/scoped_ptr.h"
|
| #include "base/metrics/histogram.h"
|
| -#include "base/metrics/histogram_base.h"
|
| #include "base/metrics/histogram_samples.h"
|
| #include "base/metrics/sparse_histogram.h"
|
| #include "base/metrics/statistics_recorder.h"
|
| @@ -255,14 +253,32 @@ void PersistentHistogramAllocator::CreateGlobalAllocatorOnLocalMemory(
|
|
|
| // static
|
| void PersistentHistogramAllocator::CreateGlobalAllocatorOnSharedMemory(
|
| + scoped_ptr<SharedMemory> memory,
|
| size_t size,
|
| - const SharedMemoryHandle& handle) {
|
| + uint64_t id,
|
| + StringPiece name) {
|
| + if (!memory->memory() && !memory->Map(size))
|
| + NOTREACHED();
|
| +
|
| + if (memory->memory()) {
|
| + DCHECK_LE(memory->mapped_size(), size);
|
| + SetGlobalAllocator(make_scoped_ptr(new PersistentHistogramAllocator(
|
| + make_scoped_ptr(new SharedPersistentMemoryAllocator(
|
| + std::move(memory), id, name, /*readonly=*/false)))));
|
| + }
|
| +}
|
| +
|
| +// static
|
| +void PersistentHistogramAllocator::CreateGlobalAllocatorOnSharedMemoryHandle(
|
| + const SharedMemoryHandle& handle,
|
| + size_t size) {
|
| scoped_ptr<SharedMemory> shm(new SharedMemory(handle, /*readonly=*/false));
|
| if (!shm->Map(size)) {
|
| NOTREACHED();
|
| return;
|
| }
|
|
|
| + DCHECK_LE(shm->mapped_size(), size);
|
| SetGlobalAllocator(make_scoped_ptr(new PersistentHistogramAllocator(
|
| make_scoped_ptr(new SharedPersistentMemoryAllocator(
|
| std::move(shm), 0, StringPiece(), /*readonly=*/false)))));
|
|
|