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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/avda_surface_tracker.cc
diff --git a/content/common/gpu/media/avda_surface_tracker.cc b/content/common/gpu/media/avda_surface_tracker.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cf051ffb692932ef1ca7d998ce0ebe4554281b3c
--- /dev/null
+++ b/content/common/gpu/media/avda_surface_tracker.cc
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/gpu/media/avda_surface_tracker.h"
+
+#include "base/lazy_instance.h"
+#include "base/logging.h"
+#include "base/observer_list.h"
+#include "content/common/gpu/media/android_video_decode_accelerator.h"
+#include "gpu/ipc/common/gpu_surface_lookup.h"
+
+namespace content {
+
+namespace {
+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.
+ LAZY_INSTANCE_INITIALIZER;
+}
+
+AVDASurfaceTracker::AVDASurfaceTracker() {}
+
+AVDASurfaceTracker::~AVDASurfaceTracker() {}
+
+AVDASurfaceTracker* AVDASurfaceTracker::GetInstance() {
+ return g_lazy_instance.Pointer();
+}
+
+void AVDASurfaceTracker::AddSurfaceDestructionObserver(
+ SurfaceDestructionObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void AVDASurfaceTracker::RemoveSurfaceDestructionObserver(
+ SurfaceDestructionObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+void AVDASurfaceTracker::NotifyDestroyingSurface(int surface_id) {
+ FOR_EACH_OBSERVER(SurfaceDestructionObserver, observers_,
+ OnDestroyingSurface(surface_id));
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698