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

Side by Side Diff: components/viz/service/display_embedder/server_shared_bitmap_manager.cc

Issue 2965103003: Test
Patch Set: c Created 3 years, 5 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 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 "components/viz/service/display_embedder/server_shared_bitmap_manager.h " 5 #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h "
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 manager_->FreeSharedMemoryFromMap(id()); 49 manager_->FreeSharedMemoryFromMap(id());
50 } 50 }
51 51
52 // cc::SharedBitmap: 52 // cc::SharedBitmap:
53 base::SharedMemoryHandle GetSharedMemoryHandle() const override { 53 base::SharedMemoryHandle GetSharedMemoryHandle() const override {
54 if (!bitmap_data_->memory) 54 if (!bitmap_data_->memory)
55 return base::SharedMemoryHandle(); 55 return base::SharedMemoryHandle();
56 return bitmap_data_->memory->handle(); 56 return bitmap_data_->memory->handle();
57 } 57 }
58 58
59 base::SharedMemory* GetSharedMemory() const override {
60 return bitmap_data_->memory.get();
61 }
62
59 private: 63 private:
60 scoped_refptr<BitmapData> bitmap_data_; 64 scoped_refptr<BitmapData> bitmap_data_;
61 ServerSharedBitmapManager* manager_; 65 ServerSharedBitmapManager* manager_;
62 }; 66 };
63 67
64 } // namespace 68 } // namespace
65 69
66 base::LazyInstance<ServerSharedBitmapManager>::DestructorAtExit 70 base::LazyInstance<ServerSharedBitmapManager>::DestructorAtExit
67 g_shared_memory_manager = LAZY_INSTANCE_INITIALIZER; 71 g_shared_memory_manager = LAZY_INSTANCE_INITIALIZER;
68 72
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 return handle_map_.size(); 186 return handle_map_.size();
183 } 187 }
184 188
185 void ServerSharedBitmapManager::FreeSharedMemoryFromMap( 189 void ServerSharedBitmapManager::FreeSharedMemoryFromMap(
186 const cc::SharedBitmapId& id) { 190 const cc::SharedBitmapId& id) {
187 base::AutoLock lock(lock_); 191 base::AutoLock lock(lock_);
188 handle_map_.erase(id); 192 handle_map_.erase(id);
189 } 193 }
190 194
191 } // namespace viz 195 } // namespace viz
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698