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

Side by Side Diff: content/child/child_shared_bitmap_manager.cc

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: Implement buckets Created 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/child/child_shared_bitmap_manager.h" 5 #include "content/child/child_shared_bitmap_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 base::debug::Alias(&shared_bytes); 77 base::debug::Alias(&shared_bytes);
78 #endif 78 #endif
79 base::TerminateBecauseOutOfMemory(alloc_size); 79 base::TerminateBecauseOutOfMemory(alloc_size);
80 } 80 }
81 81
82 } // namespace 82 } // namespace
83 83
84 SharedMemoryBitmap::SharedMemoryBitmap(uint8_t* pixels, 84 SharedMemoryBitmap::SharedMemoryBitmap(uint8_t* pixels,
85 const cc::SharedBitmapId& id, 85 const cc::SharedBitmapId& id,
86 base::SharedMemory* shared_memory) 86 base::SharedMemory* shared_memory)
87 : SharedBitmap(pixels, id), shared_memory_(shared_memory) {} 87 : SharedBitmap(pixels, shared_memory, id), shared_memory_(shared_memory) {}
88 88
89 ChildSharedBitmapManager::ChildSharedBitmapManager( 89 ChildSharedBitmapManager::ChildSharedBitmapManager(
90 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>& 90 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>&
91 render_message_filter_ptr) 91 render_message_filter_ptr)
92 : render_message_filter_ptr_(render_message_filter_ptr) {} 92 : render_message_filter_ptr_(render_message_filter_ptr) {}
93 93
94 ChildSharedBitmapManager::~ChildSharedBitmapManager() {} 94 ChildSharedBitmapManager::~ChildSharedBitmapManager() {}
95 95
96 std::unique_ptr<cc::SharedBitmap> 96 std::unique_ptr<cc::SharedBitmap>
97 ChildSharedBitmapManager::AllocateSharedBitmap(const gfx::Size& size) { 97 ChildSharedBitmapManager::AllocateSharedBitmap(const gfx::Size& size) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 145 }
146 146
147 mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle( 147 mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle(
148 handle_to_send, memory->mapped_size(), true /* read_only */); 148 handle_to_send, memory->mapped_size(), true /* read_only */);
149 149
150 (*render_message_filter_ptr_) 150 (*render_message_filter_ptr_)
151 ->AllocatedSharedBitmap(std::move(buffer_handle), id); 151 ->AllocatedSharedBitmap(std::move(buffer_handle), id);
152 } 152 }
153 153
154 } // namespace content 154 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698