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

Unified Diff: content/public/common/media_metadata.h

Issue 1515623002: Media Session: passing metadata from renderer/ to browser/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media_session_ipc
Patch Set: cleanup Created 5 years 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
Index: content/public/common/media_metadata.h
diff --git a/content/public/common/media_metadata.h b/content/public/common/media_metadata.h
new file mode 100644
index 0000000000000000000000000000000000000000..f79822084f2ef7fd10f1c5a0c70cc25538852bb0
--- /dev/null
+++ b/content/public/common/media_metadata.h
@@ -0,0 +1,41 @@
+// Copyright 2015 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 CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_
jochen (gone - plz use gerrit) 2015/12/14 12:38:30 we is this in public, if you only use it from cont
mlamouri (slow - plz ping) 2016/01/05 16:01:16 This is going to be used by content embedders for
+#define CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_
+
+#include "base/strings/nullable_string16.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+// The MediaMetadata is a structure carrying information associated to a
+// content::MediaSession.
+struct CONTENT_EXPORT MediaMetadata {
+ MediaMetadata();
jochen (gone - plz use gerrit) 2015/12/14 12:38:30 can you please add ctor args for all struct fields
mlamouri (slow - plz ping) 2016/01/05 16:01:17 I think the issue of such a ctor is that it would
+ ~MediaMetadata();
+
+ // Returns whether this instance of MediaMetadata had no attribute set.
+ // A newly created MediaMetadata is always empty.
+ bool IsEmpty() const;
+
+ // Title associated to the MediaSession.
+ base::NullableString16 title;
philipj_slow 2015/12/14 14:09:24 Rather than making every nullable, could we not us
mlamouri (slow - plz ping) 2016/01/05 16:01:17 Null will be used here to know whether a string wa
philipj_slow 2016/01/18 12:31:43 But the MediaMetadata interface assumes that "" is
mlamouri (slow - plz ping) 2016/01/19 14:20:09 Ok. Done.
+
+ // Artist associated to the MediaSession.
+ base::NullableString16 artist;
+
+ // Album associated to the MediaSession.
+ base::NullableString16 album;
+
+ // 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 = 4 * 1024;
jochen (gone - plz use gerrit) 2015/12/14 12:38:30 can you move the definition to the cc file please?
mlamouri (slow - plz ping) 2016/01/05 16:01:16 Sure. I thought that given that we are now allowed
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_MEDIA_METADATA_H_

Powered by Google App Engine
This is Rietveld 408576698