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

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

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: Created 3 years, 9 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 "content/common/host_shared_bitmap_manager.h" 5 #include "content/common/host_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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 manager_->FreeSharedMemoryFromMap(id()); 50 manager_->FreeSharedMemoryFromMap(id());
51 } 51 }
52 52
53 private: 53 private:
54 scoped_refptr<BitmapData> bitmap_data_; 54 scoped_refptr<BitmapData> bitmap_data_;
55 HostSharedBitmapManager* manager_; 55 HostSharedBitmapManager* manager_;
56 }; 56 };
57 57
58 } // namespace 58 } // namespace
59 59
60 base::LazyInstance<HostSharedBitmapManager> g_shared_memory_manager = 60 base::LazyInstance<HostSharedBitmapManager>::DestructorAtExit
61 LAZY_INSTANCE_INITIALIZER; 61 g_shared_memory_manager = LAZY_INSTANCE_INITIALIZER;
62 62
63 HostSharedBitmapManagerClient::HostSharedBitmapManagerClient( 63 HostSharedBitmapManagerClient::HostSharedBitmapManagerClient(
64 HostSharedBitmapManager* manager) 64 HostSharedBitmapManager* manager)
65 : manager_(manager) { 65 : manager_(manager) {
66 } 66 }
67 67
68 HostSharedBitmapManagerClient::~HostSharedBitmapManagerClient() { 68 HostSharedBitmapManagerClient::~HostSharedBitmapManagerClient() {
69 for (const auto& id : owned_bitmaps_) 69 for (const auto& id : owned_bitmaps_)
70 manager_->ChildDeletedSharedBitmap(id); 70 manager_->ChildDeletedSharedBitmap(id);
71 } 71 }
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return handle_map_.size(); 239 return handle_map_.size();
240 } 240 }
241 241
242 void HostSharedBitmapManager::FreeSharedMemoryFromMap( 242 void HostSharedBitmapManager::FreeSharedMemoryFromMap(
243 const cc::SharedBitmapId& id) { 243 const cc::SharedBitmapId& id) {
244 base::AutoLock lock(lock_); 244 base::AutoLock lock(lock_);
245 handle_map_.erase(id); 245 handle_map_.erase(id);
246 } 246 }
247 247
248 } // namespace content 248 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698