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

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 and resolving merge conflicts 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
« no previous file with comments | « media/media.gyp ('k') | webkit/media/android/media_player_bridge_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d3ca426e9120a960d0e453042791f561c53de52e
--- /dev/null
+++ b/webkit/media/android/media_player_bridge_manager_impl.h
@@ -0,0 +1,41 @@
+// 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:
+ // The manager will start to reclaim unused resources when the number of
+ // active MediaPlayerBridge objects reaches |threshold|.
+ 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_;
+
+ // Threshold 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_
« no previous file with comments | « media/media.gyp ('k') | webkit/media/android/media_player_bridge_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698