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

Side by Side Diff: cc/test/test_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 | « cc/test/test_shared_bitmap_manager.h ('k') | content/child/child_shared_bitmap_manager.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/test/test_shared_bitmap_manager.h" 5 #include "cc/test/test_shared_bitmap_manager.h"
6 6
7 #include "base/memory/shared_memory.h" 7 #include "base/memory/shared_memory.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 scoped_ptr<SharedBitmap> TestSharedBitmapManager::GetSharedBitmapFromId( 57 scoped_ptr<SharedBitmap> TestSharedBitmapManager::GetSharedBitmapFromId(
58 const gfx::Size&, 58 const gfx::Size&,
59 const SharedBitmapId& id) { 59 const SharedBitmapId& id) {
60 base::AutoLock lock(lock_); 60 base::AutoLock lock(lock_);
61 if (bitmap_map_.find(id) == bitmap_map_.end()) 61 if (bitmap_map_.find(id) == bitmap_map_.end())
62 return nullptr; 62 return nullptr;
63 return make_scoped_ptr(new UnownedSharedBitmap(bitmap_map_[id], id)); 63 return make_scoped_ptr(new UnownedSharedBitmap(bitmap_map_[id], id));
64 } 64 }
65 65
66 scoped_ptr<SharedBitmap> TestSharedBitmapManager::GetBitmapForSharedMemory(
67 base::SharedMemory* memory) {
68 base::AutoLock lock(lock_);
69 SharedBitmapId id = SharedBitmap::GenerateId();
70 bitmap_map_[id] = memory;
71 return make_scoped_ptr(new UnownedSharedBitmap(memory, id));
72 }
73
74 } // namespace cc 66 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_shared_bitmap_manager.h ('k') | content/child/child_shared_bitmap_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698