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

Side by Side Diff: content/common/host_shared_bitmap_manager.cc

Issue 795843002: Remove GetBitmapForSharedMemory from cc::SharedBitmapManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « content/common/host_shared_bitmap_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/common/host_shared_bitmap_manager.h" 5 #include "content/common/host_shared_bitmap_manager.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "content/common/view_messages.h" 9 #include "content/common/view_messages.h"
10 #include "ui/gfx/size.h" 10 #include "ui/gfx/size.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 "HostSharedBitmapManager::GetSharedBitmapFromId"); 110 "HostSharedBitmapManager::GetSharedBitmapFromId");
111 if (!data->memory->Map(data->buffer_size)) { 111 if (!data->memory->Map(data->buffer_size)) {
112 return scoped_ptr<cc::SharedBitmap>(); 112 return scoped_ptr<cc::SharedBitmap>();
113 } 113 }
114 } 114 }
115 115
116 return make_scoped_ptr(new HostSharedBitmap( 116 return make_scoped_ptr(new HostSharedBitmap(
117 static_cast<uint8*>(data->memory->memory()), data, id, nullptr)); 117 static_cast<uint8*>(data->memory->memory()), data, id, nullptr));
118 } 118 }
119 119
120 scoped_ptr<cc::SharedBitmap> HostSharedBitmapManager::GetBitmapForSharedMemory(
121 base::SharedMemory*) {
122 return scoped_ptr<cc::SharedBitmap>();
123 }
124
125 void HostSharedBitmapManager::ChildAllocatedSharedBitmap( 120 void HostSharedBitmapManager::ChildAllocatedSharedBitmap(
126 size_t buffer_size, 121 size_t buffer_size,
127 const base::SharedMemoryHandle& handle, 122 const base::SharedMemoryHandle& handle,
128 base::ProcessHandle process_handle, 123 base::ProcessHandle process_handle,
129 const cc::SharedBitmapId& id) { 124 const cc::SharedBitmapId& id) {
130 base::AutoLock lock(lock_); 125 base::AutoLock lock(lock_);
131 if (handle_map_.find(id) != handle_map_.end()) 126 if (handle_map_.find(id) != handle_map_.end())
132 return; 127 return;
133 scoped_refptr<BitmapData> data( 128 scoped_refptr<BitmapData> data(
134 new BitmapData(process_handle, buffer_size)); 129 new BitmapData(process_handle, buffer_size));
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 return handle_map_.size(); 202 return handle_map_.size();
208 } 203 }
209 204
210 void HostSharedBitmapManager::FreeSharedMemoryFromMap( 205 void HostSharedBitmapManager::FreeSharedMemoryFromMap(
211 const cc::SharedBitmapId& id) { 206 const cc::SharedBitmapId& id) {
212 base::AutoLock lock(lock_); 207 base::AutoLock lock(lock_);
213 handle_map_.erase(id); 208 handle_map_.erase(id);
214 } 209 }
215 210
216 } // namespace content 211 } // namespace content
OLDNEW
« no previous file with comments | « content/common/host_shared_bitmap_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698