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

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

Issue 2775423003: Add ownership edges between HostSharedBitmap and shared memory
Patch Set: Fix comments Created 3 years, 8 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
« no previous file with comments | « cc/test/test_shared_bitmap_manager.cc ('k') | content/common/host_shared_bitmap_manager.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) 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 11 matching lines...) Expand all
22 22
23 namespace { 23 namespace {
24 24
25 class ChildSharedBitmap : public cc::SharedBitmap { 25 class ChildSharedBitmap : public cc::SharedBitmap {
26 public: 26 public:
27 ChildSharedBitmap( 27 ChildSharedBitmap(
28 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>& 28 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>&
29 render_message_filter_ptr, 29 render_message_filter_ptr,
30 base::SharedMemory* shared_memory, 30 base::SharedMemory* shared_memory,
31 const cc::SharedBitmapId& id) 31 const cc::SharedBitmapId& id)
32 : cc::SharedBitmap(static_cast<uint8_t*>(shared_memory->memory()), id), 32 : cc::SharedBitmap(static_cast<uint8_t*>(shared_memory->memory()),
33 shared_memory,
34 id),
33 render_message_filter_ptr_(render_message_filter_ptr) {} 35 render_message_filter_ptr_(render_message_filter_ptr) {}
34 36
35 ChildSharedBitmap( 37 ChildSharedBitmap(
36 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>& 38 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>&
37 render_message_filter_ptr, 39 render_message_filter_ptr,
38 std::unique_ptr<base::SharedMemory> shared_memory_holder, 40 std::unique_ptr<base::SharedMemory> shared_memory_holder,
39 const cc::SharedBitmapId& id) 41 const cc::SharedBitmapId& id)
40 : ChildSharedBitmap(render_message_filter_ptr, 42 : ChildSharedBitmap(render_message_filter_ptr,
41 shared_memory_holder.get(), 43 shared_memory_holder.get(),
42 id) { 44 id) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 139 }
138 140
139 mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle( 141 mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle(
140 handle_to_send, memory->mapped_size(), true /* read_only */); 142 handle_to_send, memory->mapped_size(), true /* read_only */);
141 143
142 (*render_message_filter_ptr_) 144 (*render_message_filter_ptr_)
143 ->AllocatedSharedBitmap(std::move(buffer_handle), id); 145 ->AllocatedSharedBitmap(std::move(buffer_handle), id);
144 } 146 }
145 147
146 } // namespace content 148 } // namespace content
OLDNEW
« no previous file with comments | « cc/test/test_shared_bitmap_manager.cc ('k') | content/common/host_shared_bitmap_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698