Chromium Code Reviews| Index: content/public/common/media_metadata.h |
| diff --git a/content/public/common/media_metadata.h b/content/public/common/media_metadata.h |
| index 3d7f13c59366caac20a29ed98b79c0d8a8478d58..96b7b22c9b8a2403c85fed28354eab1e2be02770 100644 |
| --- a/content/public/common/media_metadata.h |
| +++ b/content/public/common/media_metadata.h |
| @@ -5,20 +5,31 @@ |
| #ifndef CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_ |
| #define CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_ |
| +#include <vector> |
| + |
| +#include "base/optional.h" |
| #include "base/strings/string16.h" |
| #include "content/common/content_export.h" |
| +#include "content/public/common/manifest.h" |
| namespace content { |
| // The MediaMetadata is a structure carrying information associated to a |
| // content::MediaSession. |
| struct CONTENT_EXPORT MediaMetadata { |
| + // TODO(zqzhang): move |Manifest::Icon| to a common place. |
|
palmer
2016/06/20 21:34:21
It's good to have a crbug link.
Zhiqiang Zhang (Slow)
2016/06/21 11:08:42
Done.
|
| + using Artwork = Manifest::Icon; |
| + |
| MediaMetadata(); |
| ~MediaMetadata(); |
| bool operator==(const MediaMetadata& other) const; |
| bool operator!=(const MediaMetadata& other) const; |
| + // Apply validity checks and sanitize |artwork|. Returns null if |
| + // |artwork| does not pass validity checks. |
| + static base::Optional<Artwork> SanitizeArtwork(const Artwork& artwork); |
| + |
| // Title associated to the MediaSession. |
| base::string16 title; |
| @@ -28,11 +39,17 @@ struct CONTENT_EXPORT MediaMetadata { |
| // Album associated to the MediaSession. |
| base::string16 album; |
| + std::vector<Artwork> artwork; |
|
palmer
2016/06/20 21:34:21
Nit: Since this is a vector, I might call it |artw
Zhiqiang Zhang (Slow)
2016/06/21 11:08:42
Yes. The naming here is confusing, which comes fro
|
| + |
| // Maximum length for all the strings inside the MediaMetadata when it is sent |
| // over IPC. The renderer process should truncate the strings before sending |
| // the MediaMetadata and the browser process must do the same when receiving |
| // it. |
| static const size_t kMaxIPCStringLength; |
| + // Maximum size of Artwork. The renderer process should remove the sizes in |
| + // artwork that are out of bound before sending the MediaMetadata and the |
| + // browser process must do the same when receiving it. |
| + static const int kMaxIconSize; |
| }; |
| } // namespace content |