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

Unified Diff: content/public/renderer/content_media_client.h

Issue 2712983004: Simplify/Cleanup MediaClient (Closed)
Patch Set: Created 3 years, 9 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
Index: content/public/renderer/content_media_client.h
diff --git a/content/public/renderer/content_media_client.h b/content/public/renderer/content_media_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..acd4e1f149708e094ec3e4dcc20ab193f8db72ef
--- /dev/null
+++ b/content/public/renderer/content_media_client.h
@@ -0,0 +1,46 @@
+// Copyright 2014 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_RENDERER_CONTENT_MEDIA_CLIENT_
+#define CONTENT_PUBLIC_RENDERER_CONTENT_MEDIA_CLIENT_
+
+#include "base/threading/thread_checker.h"
+#include "content/public/renderer/content_renderer_client.h"
+#include "media/base/media_client.h"
+
+namespace content {
+
+// Provides a default MediaClient for content embedders simply want to defer
+// supported Key Systems and Rapport recording to their ContentRenderClient.
xhwang 2017/03/22 05:58:52 s/Rapport/Rappor
+//
+// IsSupportedVideoConfig() will assess support for the Media Platform in its
+// default state. Embedders who customize the Media Platform (e.g. Chromecast)
+// should override this method to reflect their changes.
+class CONTENT_EXPORT ContentMediaClient : public media::MediaClient {
xhwang 2017/03/22 05:58:52 I have a few thoughts on this. I am not following
chcunningham 2017/03/22 18:25:46 Thanks. I'm agree the direction you propose sounds
xhwang 2017/03/22 21:54:52 I always feel "renderer" is part of "content" so w
chcunningham 2017/03/22 23:22:51 The logic for key system decode capabilities could
+ public:
+ explicit ContentMediaClient(
+ content::ContentRendererClient* content_renderer_client);
+ ~ContentMediaClient() override;
+
+ // MediaClient implementation.
+ void AddSupportedKeySystems(
+ std::vector<std::unique_ptr<media::KeySystemProperties>>*
+ key_systems_properties) override;
+ void RecordRapporURL(const std::string& metric, const GURL& url) override;
+ bool IsSupportedVideoConfig(const media::VideoConfig& config) override;
+
+ protected:
+ friend class ContentMediaClientTest;
+
+ // Makes sure all methods are called from the same thread.
+ base::ThreadChecker thread_checker_;
+
+ content::ContentRendererClient* content_renderer_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(ContentMediaClient);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_RENDERER_CONTENT_MEDIA_CLIENT_

Powered by Google App Engine
This is Rietveld 408576698