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

Unified Diff: media/base/cdm_key_information.cc

Issue 2663483003: media: Add log in CdmSessionAdapter (Closed)
Patch Set: media: Add log in CdmSessionAdapter Created 3 years, 11 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
« no previous file with comments | « media/base/cdm_key_information.h ('k') | media/blink/cdm_session_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/cdm_key_information.cc
diff --git a/media/base/cdm_key_information.cc b/media/base/cdm_key_information.cc
index efaed61f9716e01cbbe266549a3b35effe251d79..e29df5471254877af515a819e08e486816f68a8b 100644
--- a/media/base/cdm_key_information.cc
+++ b/media/base/cdm_key_information.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/stl_util.h"
+#include "base/strings/string_number_conversions.h"
#include "media/base/cdm_key_information.h"
namespace media {
@@ -37,4 +38,35 @@ CdmKeyInformation::CdmKeyInformation(const CdmKeyInformation& other) = default;
CdmKeyInformation::~CdmKeyInformation() {
}
+// static
+std::string CdmKeyInformation::KeyStatusToString(KeyStatus key_status) {
+ switch (key_status) {
+ case USABLE:
+ return "USABLE";
+ case INTERNAL_ERROR:
+ return "INTERNAL_ERROR";
+ case EXPIRED:
+ return "EXPIRED";
+ case OUTPUT_RESTRICTED:
+ return "OUTPUT_RESTRICTED";
+ case OUTPUT_DOWNSCALED:
+ return "OUTPUT_DOWNSCALED";
+ case KEY_STATUS_PENDING:
+ return "KEY_STATUS_PENDING";
+ case RELEASED:
+ return "RELEASED";
+ }
+
+ NOTREACHED();
+ return "";
+}
+
+std::ostream& operator<<(std::ostream& os, const CdmKeyInformation& info) {
+ return os << "key_id = "
+ << base::HexEncode(info.key_id.data(), info.key_id.size())
+ << ", status = "
+ << CdmKeyInformation::KeyStatusToString(info.status)
+ << ", system_code = " << info.system_code;
+}
+
} // namespace media
« no previous file with comments | « media/base/cdm_key_information.h ('k') | media/blink/cdm_session_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698