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

Unified Diff: media/base/cdm_session_tracker.h

Issue 2426813002: EME: Close existing sessions on CDM failure (Closed)
Patch Set: rename result (+rebase) Created 4 years, 1 month 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
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/cdm_session_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/cdm_session_tracker.h
diff --git a/media/base/cdm_session_tracker.h b/media/base/cdm_session_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..c72e25c72b40508438885f3e26e47fa5e0b9e305
--- /dev/null
+++ b/media/base/cdm_session_tracker.h
@@ -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.
+
+#ifndef MEDIA_BASE_CDM_SESSION_TRACKER_H_
+#define MEDIA_BASE_CDM_SESSION_TRACKER_H_
+
+#include <stdint.h>
+
+#include <string>
+#include <unordered_set>
+
+#include "base/logging.h"
+#include "base/macros.h"
+#include "media/base/media_export.h"
+#include "media/base/media_keys.h"
+
+namespace media {
+
+class MEDIA_EXPORT CdmSessionTracker {
+ public:
+ CdmSessionTracker();
+ ~CdmSessionTracker();
+
+ // Add |session_id| to the list of sessions being tracked.
+ void AddSession(const std::string& session_id);
+
+ // Remove |session_id| from the list of sessions being tracked.
+ void RemoveSession(const std::string& session_id);
+
+ // Call |session_closed_cb| on any remaining sessions in the list and then
+ // clear the list.
+ void CloseRemainingSessions(const SessionClosedCB& session_closed_cb);
+
+ private:
+ std::unordered_set<std::string> session_ids_;
+
+ DISALLOW_COPY_AND_ASSIGN(CdmSessionTracker);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_CDM_SESSION_TRACKER_H_
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/cdm_session_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698