| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 void DestroyPlayer(int player_id); | 121 void DestroyPlayer(int player_id); |
| 122 | 122 |
| 123 // Release resources associated to a player. | 123 // Release resources associated to a player. |
| 124 virtual void ReleaseResources(int player_id); | 124 virtual void ReleaseResources(int player_id); |
| 125 | 125 |
| 126 // Replaces a player with the specified id with a given MediaPlayerAndroid | 126 // Replaces a player with the specified id with a given MediaPlayerAndroid |
| 127 // object. This will also return the original MediaPlayerAndroid object that | 127 // object. This will also return the original MediaPlayerAndroid object that |
| 128 // was replaced. | 128 // was replaced. |
| 129 std::unique_ptr<media::MediaPlayerAndroid> SwapPlayer( | 129 std::unique_ptr<media::MediaPlayerAndroid> SwapPlayer( |
| 130 int player_id, | 130 int player_id, |
| 131 media::MediaPlayerAndroid* player); | 131 std::unique_ptr<media::MediaPlayerAndroid> player); |
| 132 | 132 |
| 133 // Called to request decoder resources. Returns true if the request is | 133 // Called to request decoder resources. Returns true if the request is |
| 134 // permitted, or false otherwise. The manager object maintains a list | 134 // permitted, or false otherwise. The manager object maintains a list |
| 135 // of active MediaPlayerAndroid objects and releases the inactive resources | 135 // of active MediaPlayerAndroid objects and releases the inactive resources |
| 136 // when needed. If |temporary| is true, the request is short lived | 136 // when needed. If |temporary| is true, the request is short lived |
| 137 // and it will not be cleaned up when handling other requests. | 137 // and it will not be cleaned up when handling other requests. |
| 138 // On the contrary, requests with false |temporary| value are subject to | 138 // On the contrary, requests with false |temporary| value are subject to |
| 139 // clean up if their players are idle. | 139 // clean up if their players are idle. |
| 140 virtual bool RequestDecoderResources(int player_id, bool temporary); | 140 virtual bool RequestDecoderResources(int player_id, bool temporary); |
| 141 | 141 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 // NOTE: Weak pointers must be invalidated before all other member variables. | 199 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 200 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; | 200 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; |
| 201 | 201 |
| 202 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); | 202 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 } // namespace content | 205 } // namespace content |
| 206 | 206 |
| 207 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 207 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
| OLD | NEW |