Index: services/media/framework/metadata.h |
diff --git a/services/media/framework/metadata.h b/services/media/framework/metadata.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..25698f5f417fc00b687534551deaefe958c342c4 |
--- /dev/null |
+++ b/services/media/framework/metadata.h |
@@ -0,0 +1,83 @@ |
+// 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 SERVICES_MEDIA_FRAMEWORK_METADATA_H_ |
+#define SERVICES_MEDIA_FRAMEWORK_METADATA_H_ |
+ |
+#include <memory> |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "services/media/framework/ptr.h" |
+ |
+namespace mojo { |
+namespace media { |
+ |
+class Metadata; |
+ |
+typedef UniquePtr<Metadata> MetadataPtr; |
jeffbrown
2016/02/02 05:35:46
These typedefs make the code much harder to follow
dalesat
2016/02/02 21:46:38
OK. The guidance I've received is to the contrary.
|
+ |
+class Metadata { |
jeffbrown
2016/02/02 05:35:47
Docs?
dalesat
2016/02/02 21:46:38
Done.
|
+ public: |
+ static MetadataPtr New( |
jeffbrown
2016/02/02 05:35:47
We usually call these methods "Create".
dalesat
2016/02/02 21:46:39
Added TODO. I was taking a cue from mojo.
|
+ uint64_t duration_ns, |
+ const std::string& title, |
jeffbrown
2016/02/02 05:35:47
Don't hardcode this stuff. It'll explode. Consid
dalesat
2016/02/02 21:46:39
Yes, this was just to get the demo done. I've adde
|
+ const std::string& artist, |
+ const std::string& album, |
+ const std::string& publisher, |
+ const std::string& genre, |
+ const std::string& composer); |
+ |
+ ~Metadata(); |
+ |
+ uint64_t duration_ns() const { return duration_ns_; } |
+ |
+ const std::string& title() const { return title_; } |
+ |
+ const std::string& artist() const { return artist_; } |
+ |
+ const std::string& album() const { return album_; } |
+ |
+ const std::string& publisher() const { return publisher_; } |
+ |
+ const std::string& genre() const { return genre_; } |
+ |
+ const std::string& composer() const { return composer_; } |
+ |
+ MetadataPtr Clone() const { |
+ return New( |
+ duration_ns_, |
+ title_, |
+ artist_, |
+ album_, |
+ publisher_, |
+ genre_, |
+ composer_); |
+ } |
+ |
+ private: |
+ Metadata( |
+ uint64_t duration_ns, |
+ const std::string& title, |
+ const std::string& artist, |
+ const std::string& album, |
+ const std::string& publisher, |
+ const std::string& genre, |
+ const std::string& composer); |
+ |
+ uint64_t duration_ns_; |
+ std::string title_; |
+ std::string artist_; |
+ std::string album_; |
+ std::string publisher_; |
+ std::string genre_; |
+ std::string composer_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(Metadata); |
+}; |
+ |
+} // namespace media |
+} // namespace mojo |
+ |
+#endif // SERVICES_MEDIA_FRAMEWORK_METADATA_H_ |