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

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

Issue 221523003: cc: Remove all usage of GetArea() from production code in cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: getarea: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « content/common/cc_messages.cc ('k') | content/common/host_shared_bitmap_manager_unittest.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 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 const gfx::Size& size, 55 const gfx::Size& size,
56 const cc::SharedBitmapId& id) { 56 const cc::SharedBitmapId& id) {
57 base::AutoLock lock(lock_); 57 base::AutoLock lock(lock_);
58 BitmapMap::iterator it = handle_map_.find(id); 58 BitmapMap::iterator it = handle_map_.find(id);
59 if (it == handle_map_.end()) 59 if (it == handle_map_.end())
60 return scoped_ptr<cc::SharedBitmap>(); 60 return scoped_ptr<cc::SharedBitmap>();
61 61
62 BitmapData* data = it->second.get(); 62 BitmapData* data = it->second.get();
63 63
64 size_t bitmap_size; 64 size_t bitmap_size;
65 if (!cc::SharedBitmap::GetSizeInBytes(size, &bitmap_size) || 65 if (!cc::SharedBitmap::SizeInBytes(size, &bitmap_size) ||
66 bitmap_size > data->buffer_size) 66 bitmap_size > data->buffer_size)
67 return scoped_ptr<cc::SharedBitmap>(); 67 return scoped_ptr<cc::SharedBitmap>();
68 68
69 if (!data->memory->memory()) { 69 if (!data->memory->memory()) {
70 TRACE_EVENT0("renderer_host", 70 TRACE_EVENT0("renderer_host",
71 "HostSharedBitmapManager::GetSharedBitmapFromId"); 71 "HostSharedBitmapManager::GetSharedBitmapFromId");
72 if (!data->memory->Map(data->buffer_size)) { 72 if (!data->memory->Map(data->buffer_size)) {
73 return scoped_ptr<cc::SharedBitmap>(); 73 return scoped_ptr<cc::SharedBitmap>();
74 } 74 }
75 } 75 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 for (base::hash_set<cc::SharedBitmapId>::iterator it = res.begin(); 160 for (base::hash_set<cc::SharedBitmapId>::iterator it = res.begin();
161 it != res.end(); 161 it != res.end();
162 ++it) { 162 ++it) {
163 handle_map_.erase(*it); 163 handle_map_.erase(*it);
164 } 164 }
165 process_map_.erase(proc_it); 165 process_map_.erase(proc_it);
166 } 166 }
167 167
168 } // namespace content 168 } // namespace content
OLDNEW
« no previous file with comments | « content/common/cc_messages.cc ('k') | content/common/host_shared_bitmap_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698