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 #include "media/base/android/media_player_bridge.h" | 5 #include "media/base/android/media_player_bridge.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/android/context_utils.h" | 9 #include "base/android/context_utils.h" |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 14 matching lines...) Loading... |
25 | 25 |
26 MediaPlayerBridge::MediaPlayerBridge( | 26 MediaPlayerBridge::MediaPlayerBridge( |
27 int player_id, | 27 int player_id, |
28 const GURL& url, | 28 const GURL& url, |
29 const GURL& first_party_for_cookies, | 29 const GURL& first_party_for_cookies, |
30 const std::string& user_agent, | 30 const std::string& user_agent, |
31 bool hide_url_log, | 31 bool hide_url_log, |
32 MediaPlayerManager* manager, | 32 MediaPlayerManager* manager, |
33 const OnDecoderResourcesReleasedCB& on_decoder_resources_released_cb, | 33 const OnDecoderResourcesReleasedCB& on_decoder_resources_released_cb, |
34 const GURL& frame_url, | 34 const GURL& frame_url, |
35 bool allow_credentials) | 35 bool allow_credentials, |
| 36 int session_id) |
36 : MediaPlayerAndroid(player_id, | 37 : MediaPlayerAndroid(player_id, |
37 manager, | 38 manager, |
38 on_decoder_resources_released_cb, | 39 on_decoder_resources_released_cb, |
39 frame_url), | 40 frame_url, |
| 41 session_id), |
40 prepared_(false), | 42 prepared_(false), |
41 pending_play_(false), | 43 pending_play_(false), |
42 should_seek_on_prepare_(false), | 44 should_seek_on_prepare_(false), |
43 url_(url), | 45 url_(url), |
44 first_party_for_cookies_(first_party_for_cookies), | 46 first_party_for_cookies_(first_party_for_cookies), |
45 user_agent_(user_agent), | 47 user_agent_(user_agent), |
46 hide_url_log_(hide_url_log), | 48 hide_url_log_(hide_url_log), |
47 width_(0), | 49 width_(0), |
48 height_(0), | 50 height_(0), |
49 can_pause_(true), | 51 can_pause_(true), |
50 can_seek_forward_(true), | 52 can_seek_forward_(true), |
51 can_seek_backward_(true), | 53 can_seek_backward_(true), |
52 volume_(-1.0), | 54 volume_(-1.0), |
53 allow_credentials_(allow_credentials), | 55 allow_credentials_(allow_credentials), |
54 weak_factory_(this) { | 56 weak_factory_(this) {} |
55 } | |
56 | 57 |
57 MediaPlayerBridge::~MediaPlayerBridge() { | 58 MediaPlayerBridge::~MediaPlayerBridge() { |
58 if (!j_media_player_bridge_.is_null()) { | 59 if (!j_media_player_bridge_.is_null()) { |
59 JNIEnv* env = base::android::AttachCurrentThread(); | 60 JNIEnv* env = base::android::AttachCurrentThread(); |
60 CHECK(env); | 61 CHECK(env); |
61 Java_MediaPlayerBridge_destroy(env, j_media_player_bridge_.obj()); | 62 Java_MediaPlayerBridge_destroy(env, j_media_player_bridge_.obj()); |
62 } | 63 } |
63 Release(); | 64 Release(); |
64 } | 65 } |
65 | 66 |
(...skipping 481 matching lines...) Loading... |
547 | 548 |
548 GURL MediaPlayerBridge::GetUrl() { | 549 GURL MediaPlayerBridge::GetUrl() { |
549 return url_; | 550 return url_; |
550 } | 551 } |
551 | 552 |
552 GURL MediaPlayerBridge::GetFirstPartyForCookies() { | 553 GURL MediaPlayerBridge::GetFirstPartyForCookies() { |
553 return first_party_for_cookies_; | 554 return first_party_for_cookies_; |
554 } | 555 } |
555 | 556 |
556 } // namespace media | 557 } // namespace media |
OLD | NEW |