OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "media/base/android/media_player_android.h" | 5 #include "media/base/android/media_player_android.h" |
6 | 6 |
7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
11 #include "media/base/android/media_drm_bridge.h" | 11 #include "media/base/android/media_drm_bridge.h" |
12 #include "media/base/android/media_player_manager.h" | 12 #include "media/base/android/media_player_manager.h" |
13 | 13 |
14 namespace media { | 14 namespace media { |
15 | 15 |
16 MediaPlayerAndroid::MediaPlayerAndroid( | 16 MediaPlayerAndroid::MediaPlayerAndroid( |
17 int player_id, | 17 int player_id, |
18 MediaPlayerManager* manager, | 18 MediaPlayerManager* manager, |
19 const OnDecoderResourcesReleasedCB& on_decoder_resources_released_cb, | 19 const OnDecoderResourcesReleasedCB& on_decoder_resources_released_cb, |
20 const GURL& frame_url) | 20 const GURL& frame_url, |
| 21 int session_id) |
21 : on_decoder_resources_released_cb_(on_decoder_resources_released_cb), | 22 : on_decoder_resources_released_cb_(on_decoder_resources_released_cb), |
22 player_id_(player_id), | 23 player_id_(player_id), |
23 manager_(manager), | 24 manager_(manager), |
24 frame_url_(frame_url), | 25 frame_url_(frame_url), |
25 weak_factory_(this) { | 26 weak_factory_(this), |
| 27 session_id_(session_id) { |
26 listener_.reset(new MediaPlayerListener(base::ThreadTaskRunnerHandle::Get(), | 28 listener_.reset(new MediaPlayerListener(base::ThreadTaskRunnerHandle::Get(), |
27 weak_factory_.GetWeakPtr())); | 29 weak_factory_.GetWeakPtr())); |
28 } | 30 } |
29 | 31 |
30 MediaPlayerAndroid::~MediaPlayerAndroid() {} | 32 MediaPlayerAndroid::~MediaPlayerAndroid() {} |
31 | 33 |
32 // For most subclasses we can delete on the caller thread. | 34 // For most subclasses we can delete on the caller thread. |
33 void MediaPlayerAndroid::DeleteOnCorrectThread() { | 35 void MediaPlayerAndroid::DeleteOnCorrectThread() { |
34 delete this; | 36 delete this; |
35 } | 37 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void MediaPlayerAndroid::DestroyListenerOnUIThread() { | 90 void MediaPlayerAndroid::DestroyListenerOnUIThread() { |
89 weak_factory_.InvalidateWeakPtrs(); | 91 weak_factory_.InvalidateWeakPtrs(); |
90 listener_.reset(); | 92 listener_.reset(); |
91 } | 93 } |
92 | 94 |
93 base::WeakPtr<MediaPlayerAndroid> MediaPlayerAndroid::WeakPtrForUIThread() { | 95 base::WeakPtr<MediaPlayerAndroid> MediaPlayerAndroid::WeakPtrForUIThread() { |
94 return weak_factory_.GetWeakPtr(); | 96 return weak_factory_.GetWeakPtr(); |
95 } | 97 } |
96 | 98 |
97 } // namespace media | 99 } // namespace media |
OLD | NEW |