Skip to content

Commit

Permalink
[PA] Namespace migration (38 of N)
Browse files Browse the repository at this point in the history
This change erases multiple `base::` aliases from PartitionAlloc
headers.

Bug: 1288247
Change-Id: I1dfdbd9477d8b0ac6e1e8a5ee4fe26453a9df558
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3703038
Reviewed-by: Bartek Nowierski <[email protected]>
Reviewed-by: Alexander Timin <[email protected]>
Reviewed-by: Erik Chen <[email protected]>
Auto-Submit: Kalvin Lee <[email protected]>
Reviewed-by: Brian Geffon <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Jonathan Metzman <[email protected]>
Reviewed-by: Michael Lippautz <[email protected]>
Commit-Queue: Kalvin Lee <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1014685}
NOKEYCHECK=True
GitOrigin-RevId: 01b3850d8f45c8d0c1b9d7ef518700eb55db31f6
  • Loading branch information
Kalvin Lee authored and copybara-github committed Jun 16, 2022
1 parent f12ff60 commit 0e8661f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions blink/renderer/platform/wtf/allocator/partitions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ bool Partitions::InitializeOnce() {
#else
base::PartitionOptions::ThreadCache::kEnabled;
#endif
static base::NoDestructor<base::PartitionAllocator> fast_malloc_allocator{};
static base::NoDestructor<partition_alloc::PartitionAllocator>
fast_malloc_allocator{};
fast_malloc_allocator->init({
base::PartitionOptions::AlignedAlloc::kDisallowed,
thread_cache,
Expand All @@ -134,9 +135,10 @@ bool Partitions::InitializeOnce() {
fast_malloc_root_ = fast_malloc_allocator->root();
}

base::PartitionAllocGlobalInit(&Partitions::HandleOutOfMemory);
partition_alloc::PartitionAllocGlobalInit(&Partitions::HandleOutOfMemory);

static base::NoDestructor<base::PartitionAllocator> buffer_allocator{};
static base::NoDestructor<partition_alloc::PartitionAllocator>
buffer_allocator{};
buffer_allocator->init({
base::PartitionOptions::AlignedAlloc::kDisallowed,
base::PartitionOptions::ThreadCache::kDisabled,
Expand Down Expand Up @@ -177,7 +179,8 @@ void Partitions::InitializeArrayBufferPartition() {
CHECK(initialized_);
CHECK(!ArrayBufferPartitionInitialized());

static base::NoDestructor<base::PartitionAllocator> array_buffer_allocator{};
static base::NoDestructor<partition_alloc::PartitionAllocator>
array_buffer_allocator{};

// BackupRefPtr disallowed because it will prevent allocations from being 16B
// aligned as required by ArrayBufferContents.
Expand Down Expand Up @@ -248,13 +251,13 @@ class LightPartitionStatsDumperImpl

void PartitionDumpTotals(
const char* partition_name,
const base::PartitionMemoryStats* memory_stats) override {
const partition_alloc::PartitionMemoryStats* memory_stats) override {
total_active_bytes_ += memory_stats->total_active_bytes;
}

void PartitionsDumpBucketStats(
const char* partition_name,
const base::PartitionBucketMemoryStats*) override {}
const partition_alloc::PartitionBucketMemoryStats*) override {}

size_t TotalActiveBytes() const { return total_active_bytes_; }

Expand Down

0 comments on commit 0e8661f

Please sign in to comment.