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

Side by Side Diff: media/base/cdm_session_tracker.h

Issue 2426813002: EME: Close existing sessions on CDM failure (Closed)
Patch Set: Created 4 years, 2 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 #ifndef MEDIA_BASE_CDM_SESSION_TRACKER_H_
6 #define MEDIA_BASE_CDM_SESSION_TRACKER_H_
7
8 #include <stdint.h>
9
10 #include <string>
11 #include <unordered_set>
12
13 #include "base/logging.h"
14 #include "base/macros.h"
15 #include "media/base/media_export.h"
16 #include "media/base/media_keys.h"
17
18 namespace media {
19
20 class MEDIA_EXPORT CdmSessionTracker {
21 public:
22 CdmSessionTracker();
23 ~CdmSessionTracker();
24
25 // Add |session_id| to the list of sessions being tracked.
26 void AddSession(const std::string& session_id);
27
28 // Remove |session_id| from the list of sessions being tracked.
29 void RemoveSession(const std::string& session_id);
30
31 // Call |session_closed_cb| on any remaining sessions in the list and then
32 // clear the list.
33 void CloseRemainingSessions(SessionClosedCB session_closed_cb);
xhwang 2016/10/18 18:07:28 nit: pass callbacks by const-ref
jrummell 2016/10/20 22:11:25 Done.
34
35 private:
36 std::unordered_set<std::string> session_ids_;
37
38 DISALLOW_COPY_AND_ASSIGN(CdmSessionTracker);
39 };
40
41 } // namespace media
42
43 #endif // MEDIA_BASE_CDM_SESSION_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698