| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_MEDIA_ANDROID_MEDIA_PLAYER_BRIDGE_MANAGER_IMPL_H_ |
| 6 #define WEBKIT_MEDIA_ANDROID_MEDIA_PLAYER_BRIDGE_MANAGER_IMPL_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" |
| 12 #include "media/base/android/media_player_bridge_manager.h" |
| 13 |
| 14 namespace webkit_media { |
| 15 |
| 16 // Class for managing active MediaPlayerBridge objects if they are created |
| 17 // in render process. |
| 18 class MediaPlayerBridgeManagerImpl : public media::MediaPlayerBridgeManager { |
| 19 public: |
| 20 // The manager will start to reclaim unused resources when the number of |
| 21 // active MediaPlayerBridge objects reaches |threshold|. |
| 22 explicit MediaPlayerBridgeManagerImpl(int threshold); |
| 23 virtual ~MediaPlayerBridgeManagerImpl(); |
| 24 |
| 25 // media::MediaPlayerBridgeManager implementations. |
| 26 virtual void RequestMediaResources(media::MediaPlayerBridge* player) OVERRIDE; |
| 27 virtual void ReleaseMediaResources(media::MediaPlayerBridge* player) OVERRIDE; |
| 28 |
| 29 private: |
| 30 // An array of active MediaPlayerBridge objects. |
| 31 std::vector<media::MediaPlayerBridge*> players_; |
| 32 |
| 33 // Threshold before we start to reclaim unused media resources. |
| 34 int active_player_threshold_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridgeManagerImpl); |
| 37 }; |
| 38 |
| 39 } // namespace webkit_media |
| 40 |
| 41 #endif // WEBKIT_MEDIA_ANDROID_MEDIA_PLAYER_BRIDGE_MANAGER_IMPL_H_ |
| OLD | NEW |