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

Side by Side Diff: content/public/common/media_metadata.h

Issue 2015433003: Implement MediaMetadata artwork in content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Dale's comments Created 4 years, 5 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
« no previous file with comments | « content/public/common/manifest.cc ('k') | content/public/common/media_metadata.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_
6 #define CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_ 6 #define CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_
7 7
8 #include <vector>
9
10 #include "base/optional.h"
8 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
9 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "content/public/common/manifest.h"
10 14
11 namespace content { 15 namespace content {
12 16
13 // The MediaMetadata is a structure carrying information associated to a 17 // The MediaMetadata is a structure carrying information associated to a
14 // content::MediaSession. 18 // content::MediaSession.
15 struct CONTENT_EXPORT MediaMetadata { 19 struct CONTENT_EXPORT MediaMetadata {
20 // TODO(zqzhang): move |Manifest::Icon| to a common place. See
21 // https://crbug.com/621859.
22 using Artwork = Manifest::Icon;
23
16 MediaMetadata(); 24 MediaMetadata();
17 ~MediaMetadata(); 25 ~MediaMetadata();
18 26
27 MediaMetadata(const MediaMetadata& other);
28
19 bool operator==(const MediaMetadata& other) const; 29 bool operator==(const MediaMetadata& other) const;
20 bool operator!=(const MediaMetadata& other) const; 30 bool operator!=(const MediaMetadata& other) const;
21 31
32 // Apply validity checks and sanitize |artwork|. Returns null if
33 // |artwork| does not pass validity checks.
34 static base::Optional<Artwork> SanitizeArtwork(const Artwork& artwork);
Zhiqiang Zhang (Slow) 2016/06/29 19:16:14 For jochen@, copying previous comments here: On 2
jochen (gone - plz use gerrit) 2016/07/01 14:18:56 unifying this sounds good, yes
Zhiqiang Zhang (Slow) 2016/07/01 21:05:34 Done. See content/common/media/media_metadata_sani
35
22 // Title associated to the MediaSession. 36 // Title associated to the MediaSession.
23 base::string16 title; 37 base::string16 title;
24 38
25 // Artist associated to the MediaSession. 39 // Artist associated to the MediaSession.
26 base::string16 artist; 40 base::string16 artist;
27 41
28 // Album associated to the MediaSession. 42 // Album associated to the MediaSession.
29 base::string16 album; 43 base::string16 album;
30 44
45 // Artwork associated to the MediaSession.
46 std::vector<Artwork> artwork;
47
31 // Maximum length for all the strings inside the MediaMetadata when it is sent 48 // Maximum length for all the strings inside the MediaMetadata when it is sent
32 // over IPC. The renderer process should truncate the strings before sending 49 // over IPC. The renderer process should truncate the strings before sending
33 // the MediaMetadata and the browser process must do the same when receiving 50 // the MediaMetadata and the browser process must do the same when receiving
34 // it. 51 // it.
35 static const size_t kMaxIPCStringLength; 52 static const size_t kMaxIPCStringLength;
53
54 // Maximum number of artwork images inside the MediaMetadata.
55 static const size_t kMaxNumberOfArtworkImages;
36 }; 56 };
37 57
38 } // namespace content 58 } // namespace content
39 59
40 #endif // CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_ 60 #endif // CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_
OLDNEW
« no previous file with comments | « content/public/common/manifest.cc ('k') | content/public/common/media_metadata.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698