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

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

Issue 10919075: Move android mediaplayer from render process to browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 8 years, 3 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/media_player_bridge_manager_impl.h
diff --git a/webkit/media/android/media_player_bridge_manager_impl.h b/webkit/media/android/media_player_bridge_manager_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..e8b53c771048163c76148e126320b705e6626358
--- /dev/null
+++ b/webkit/media/android/media_player_bridge_manager_impl.h
@@ -0,0 +1,39 @@
+// 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_MEDIA_PLAYER_BRIDGE_MANAGER_IMPL_H_
+#define WEBKIT_MEDIA_ANDROID_MEDIA_PLAYER_BRIDGE_MANAGER_IMPL_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "media/base/android/media_player_bridge_manager.h"
+
+namespace webkit_media {
+
+// Class for managing active MediaPlayerBridge objects if they are created
+// in render process.
+class MediaPlayerBridgeManagerImpl : public media::MediaPlayerBridgeManager {
+ public:
+ explicit MediaPlayerBridgeManagerImpl(int threshold);
+ virtual ~MediaPlayerBridgeManagerImpl();
+
+ // media::MediaPlayerBridgeManager implementations.
+ virtual void RequestMediaResources(media::MediaPlayerBridge* player) OVERRIDE;
+ virtual void ReleaseMediaResources(media::MediaPlayerBridge* player) OVERRIDE;
+
+ private:
+ // An array of active MediaPlayerBridge objects.
+ std::vector<media::MediaPlayerBridge*> players_;
+
+ // threashold before we start to reclaim unused media resources.
+ int active_player_threshold_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridgeManagerImpl);
+};
+
+} // namespace webkit_media
+
+#endif // WEBKIT_MEDIA_ANDROID_MEDIA_PLAYER_BRIDGE_MANAGER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698