| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/gpu/media/avda_surface_tracker.h" | 5 #include "media/gpu/avda_surface_tracker.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace media { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 static base::LazyInstance<AVDASurfaceTracker> g_lazy_instance = | 14 static base::LazyInstance<AVDASurfaceTracker> g_lazy_instance = |
| 15 LAZY_INSTANCE_INITIALIZER; | 15 LAZY_INSTANCE_INITIALIZER; |
| 16 } | 16 } |
| 17 | 17 |
| 18 AVDASurfaceTracker::AVDASurfaceTracker() {} | 18 AVDASurfaceTracker::AVDASurfaceTracker() {} |
| 19 | 19 |
| 20 AVDASurfaceTracker::~AVDASurfaceTracker() {} | 20 AVDASurfaceTracker::~AVDASurfaceTracker() {} |
| 21 | 21 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 39 void AVDASurfaceTracker::NotifyDestroyingSurface(int surface_id) { | 39 void AVDASurfaceTracker::NotifyDestroyingSurface(int surface_id) { |
| 40 DCHECK(thread_checker_.CalledOnValidThread()); | 40 DCHECK(thread_checker_.CalledOnValidThread()); |
| 41 for (const auto& cb : callbacks_) | 41 for (const auto& cb : callbacks_) |
| 42 cb.Run(surface_id); | 42 cb.Run(surface_id); |
| 43 } | 43 } |
| 44 | 44 |
| 45 AVDASurfaceTracker* AVDASurfaceTracker::GetInstance() { | 45 AVDASurfaceTracker* AVDASurfaceTracker::GetInstance() { |
| 46 return g_lazy_instance.Pointer(); | 46 return g_lazy_instance.Pointer(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace content | 49 } // namespace media |
| OLD | NEW |