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

Unified Diff: webkit/media/android/webmediaplayer_manager_android.h

Issue 10413015: Upstream implementation for embedded video for WebMediaPlayerAndroid (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use first party url for cookies Created 8 years, 7 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: webkit/media/android/webmediaplayer_manager_android.h
diff --git a/webkit/media/android/webmediaplayer_manager_android.h b/webkit/media/android/webmediaplayer_manager_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..e8a046a664d561412fc9ae3955adbf277e14e859
--- /dev/null
+++ b/webkit/media/android/webmediaplayer_manager_android.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2012 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 WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_
+#define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_
+#pragma once
+
+#include <jni.h>
+#include <map>
+
+#include "base/basictypes.h"
+
+namespace webkit_media {
+
+class WebMediaPlayerAndroid;
+
+// Class for managing all the WebMediaPlayerAndroid objects in a renderer
+// process.
+class WebMediaPlayerManagerAndroid {
+ public:
+ WebMediaPlayerManagerAndroid();
+ ~WebMediaPlayerManagerAndroid();
+
+ // Register and unregister a WebMediaPlayerAndroid object.
+ int RegisterMediaPlayer(WebMediaPlayerAndroid* player);
+ void UnregisterMediaPlayer(int player_id);
+
+ // Release all the media resources on the renderer process.
+ void ReleaseMediaResources();
+
+ // Get the pointer to WebMediaPlayerAndroid given the |player_id|.
+ WebMediaPlayerAndroid* GetMediaPlayer(int player_id);
+
+ private:
+ // Information needed to manage WebMediaPlayerAndroid.
+ // TODO(qinmin): more informations will be added here for resource management.
+ struct MediaPlayerInfo {
+ webkit_media::WebMediaPlayerAndroid* player;
+ };
+
+ // Info for all available WebMediaPlayerAndroid on a page; kept so that
+ // we can enumerate them to send updates about tab focus and visibily.
+ std::map<int32, MediaPlayerInfo> media_players_;
+
+ int32 next_media_player_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerManagerAndroid);
+};
+
+} // namespace webkit_media
+
+#endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698