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

Side by Side Diff: content/common/gpu/media/avda_surface_tracker.cc

Issue 1878103002: Plumb a Browser->GPU surface destruction message for Android VDAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing ifdefs Created 4 years, 8 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698