Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 void OnMediaInterrupted() override; | 92 void OnMediaInterrupted() override; |
| 93 void OnMediaPrepared() override; | 93 void OnMediaPrepared() override; |
| 94 | 94 |
| 95 // Create the corresponding Java class instance. | 95 // Create the corresponding Java class instance. |
| 96 virtual void CreateJavaMediaPlayerBridge(); | 96 virtual void CreateJavaMediaPlayerBridge(); |
| 97 | 97 |
| 98 // Get allowed operations from the player. | 98 // Get allowed operations from the player. |
| 99 virtual base::android::ScopedJavaLocalRef<jobject> GetAllowedOperations(); | 99 virtual base::android::ScopedJavaLocalRef<jobject> GetAllowedOperations(); |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 friend class MediaPlayerBridgeTest; | |
| 103 | |
| 102 // Set the data source for the media player. | 104 // Set the data source for the media player. |
| 103 void SetDataSource(const std::string& url); | 105 void SetDataSource(const std::string& url); |
| 104 | 106 |
| 105 // Functions that implements media player control. | 107 // Functions that implements media player control. |
| 106 void StartInternal(); | 108 void StartInternal(); |
| 107 void PauseInternal(); | 109 void PauseInternal(); |
| 108 void SeekInternal(base::TimeDelta time); | 110 bool SeekInternal(const base::TimeDelta& current_time, base::TimeDelta time); |
|
DaleCurtis
2015/07/16 00:29:28
Pass TimeDelta by value since it's an int64 (see t
keitchen
2015/07/17 00:00:06
Done.
| |
| 109 | 111 |
| 110 // Called when |time_update_timer_| fires. | 112 // Called when |time_update_timer_| fires. |
| 111 void OnTimeUpdateTimerFired(); | 113 void OnTimeUpdateTimerFired(); |
| 112 | 114 |
| 113 // Update allowed operations from the player. | 115 // Update allowed operations from the player. |
| 114 void UpdateAllowedOperations(); | 116 void UpdateAllowedOperations(); |
| 115 | 117 |
| 116 // Callback function passed to |resource_getter_|. Called when the cookies | 118 // Callback function passed to |resource_getter_|. Called when the cookies |
| 117 // are retrieved. | 119 // are retrieved. |
| 118 void OnCookiesRetrieved(const std::string& cookies); | 120 void OnCookiesRetrieved(const std::string& cookies); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 | 185 |
| 184 // NOTE: Weak pointers must be invalidated before all other member variables. | 186 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 185 base::WeakPtrFactory<MediaPlayerBridge> weak_factory_; | 187 base::WeakPtrFactory<MediaPlayerBridge> weak_factory_; |
| 186 | 188 |
| 187 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); | 189 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); |
| 188 }; | 190 }; |
| 189 | 191 |
| 190 } // namespace media | 192 } // namespace media |
| 191 | 193 |
| 192 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 194 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
| OLD | NEW |