Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/common/gpu/media/avda_surface_tracker.h" | |
| 6 | |
| 7 #include "base/lazy_instance.h" | |
| 8 #include "base/logging.h" | |
| 9 #include "base/observer_list.h" | |
| 10 #include "content/common/gpu/media/android_video_decode_accelerator.h" | |
| 11 #include "gpu/ipc/common/gpu_surface_lookup.h" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 namespace { | |
| 16 static base::LazyInstance<AVDASurfaceTracker>::Leaky g_lazy_instance = | |
|
no sievers
2016/04/19 23:30:17
nit: doesn't have to be Leaky
watk
2016/04/22 02:48:55
Done.
| |
| 17 LAZY_INSTANCE_INITIALIZER; | |
| 18 } | |
| 19 | |
| 20 AVDASurfaceTracker::AVDASurfaceTracker() {} | |
| 21 | |
| 22 AVDASurfaceTracker::~AVDASurfaceTracker() {} | |
| 23 | |
| 24 AVDASurfaceTracker* AVDASurfaceTracker::GetInstance() { | |
| 25 return g_lazy_instance.Pointer(); | |
| 26 } | |
| 27 | |
| 28 void AVDASurfaceTracker::AddSurfaceDestructionObserver( | |
| 29 SurfaceDestructionObserver* observer) { | |
| 30 observers_.AddObserver(observer); | |
| 31 } | |
| 32 | |
| 33 void AVDASurfaceTracker::RemoveSurfaceDestructionObserver( | |
| 34 SurfaceDestructionObserver* observer) { | |
| 35 observers_.RemoveObserver(observer); | |
| 36 } | |
| 37 | |
| 38 void AVDASurfaceTracker::NotifyDestroyingSurface(int surface_id) { | |
| 39 FOR_EACH_OBSERVER(SurfaceDestructionObserver, observers_, | |
| 40 OnDestroyingSurface(surface_id)); | |
| 41 } | |
| 42 | |
| 43 } // namespace content | |
| OLD | NEW |