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

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

Issue 1939683002: Test X11 header pollution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/callback.h"
8 #include "base/lazy_instance.h"
9 #include "base/threading/thread_checker.h"
10
11 namespace content {
12
13 namespace {
14 static base::LazyInstance<AVDASurfaceTracker> g_lazy_instance =
15 LAZY_INSTANCE_INITIALIZER;
16 }
17
18 AVDASurfaceTracker::AVDASurfaceTracker() {}
19
20 AVDASurfaceTracker::~AVDASurfaceTracker() {}
21
22 void AVDASurfaceTracker::RegisterOnDestroyingSurfaceCallback(
23 const OnDestroyingSurfaceCallback& cb) {
24 DCHECK(thread_checker_.CalledOnValidThread());
25 callbacks_.push_back(cb);
26 }
27
28 void AVDASurfaceTracker::UnregisterOnDestroyingSurfaceCallback(
29 const OnDestroyingSurfaceCallback& cb) {
30 DCHECK(thread_checker_.CalledOnValidThread());
31 for (auto it = callbacks_.begin(); it != callbacks_.end(); ++it) {
32 if (it->Equals(cb)) {
33 callbacks_.erase(it);
34 return;
35 }
36 }
37 }
38
39 void AVDASurfaceTracker::NotifyDestroyingSurface(int surface_id) {
40 DCHECK(thread_checker_.CalledOnValidThread());
41 for (const auto& cb : callbacks_)
42 cb.Run(surface_id);
43 }
44
45 AVDASurfaceTracker* AVDASurfaceTracker::GetInstance() {
46 return g_lazy_instance.Pointer();
47 }
48
49 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/avda_surface_tracker.h ('k') | content/common/gpu/media/dxva_video_decode_accelerator_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698