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/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" |
10 #include "media/base/android/media_drm_bridge.h" | 11 #include "media/base/android/media_drm_bridge.h" |
11 #include "media/base/android/media_player_manager.h" | 12 #include "media/base/android/media_player_manager.h" |
12 | 13 |
13 namespace media { | 14 namespace media { |
14 | 15 |
15 MediaPlayerAndroid::MediaPlayerAndroid( | 16 MediaPlayerAndroid::MediaPlayerAndroid( |
16 int player_id, | 17 int player_id, |
17 MediaPlayerManager* manager, | 18 MediaPlayerManager* manager, |
18 const RequestMediaResourcesCB& request_media_resources_cb, | 19 const RequestMediaResourcesCB& request_media_resources_cb, |
19 const GURL& frame_url) | 20 const GURL& frame_url) |
20 : request_media_resources_cb_(request_media_resources_cb), | 21 : request_media_resources_cb_(request_media_resources_cb), |
21 player_id_(player_id), | 22 player_id_(player_id), |
22 manager_(manager), | 23 manager_(manager), |
23 frame_url_(frame_url), | 24 frame_url_(frame_url), |
24 is_audible_(false), | 25 is_audible_(false), |
25 weak_factory_(this) { | 26 weak_factory_(this) { |
26 listener_.reset(new MediaPlayerListener(base::MessageLoopProxy::current(), | 27 listener_.reset(new MediaPlayerListener(base::ThreadTaskRunnerHandle::Get(), |
27 weak_factory_.GetWeakPtr())); | 28 weak_factory_.GetWeakPtr())); |
28 } | 29 } |
29 | 30 |
30 MediaPlayerAndroid::~MediaPlayerAndroid() {} | 31 MediaPlayerAndroid::~MediaPlayerAndroid() {} |
31 | 32 |
32 GURL MediaPlayerAndroid::GetUrl() { | 33 GURL MediaPlayerAndroid::GetUrl() { |
33 return GURL(); | 34 return GURL(); |
34 } | 35 } |
35 | 36 |
36 GURL MediaPlayerAndroid::GetFirstPartyForCookies() { | 37 GURL MediaPlayerAndroid::GetFirstPartyForCookies() { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 82 } |
82 | 83 |
83 void MediaPlayerAndroid::SetAudible(bool is_audible) { | 84 void MediaPlayerAndroid::SetAudible(bool is_audible) { |
84 if (is_audible_ != is_audible) { | 85 if (is_audible_ != is_audible) { |
85 is_audible_ = is_audible; | 86 is_audible_ = is_audible; |
86 manager_->OnAudibleStateChanged(player_id(), is_audible_); | 87 manager_->OnAudibleStateChanged(player_id(), is_audible_); |
87 } | 88 } |
88 } | 89 } |
89 | 90 |
90 } // namespace media | 91 } // namespace media |
OLD | NEW |