| 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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 154 } |
| 155 } else { | 155 } else { |
| 156 // Create a Java String for the URL. | 156 // Create a Java String for the URL. |
| 157 ScopedJavaLocalRef<jstring> j_url_string = | 157 ScopedJavaLocalRef<jstring> j_url_string = |
| 158 ConvertUTF8ToJavaString(env, url); | 158 ConvertUTF8ToJavaString(env, url); |
| 159 | 159 |
| 160 jobject j_context = base::android::GetApplicationContext(); | 160 jobject j_context = base::android::GetApplicationContext(); |
| 161 DCHECK(j_context); | 161 DCHECK(j_context); |
| 162 | 162 |
| 163 const std::string data_uri_prefix("data:"); | 163 const std::string data_uri_prefix("data:"); |
| 164 if (StartsWithASCII(url, data_uri_prefix, true)) { | 164 if (base::StartsWithASCII(url, data_uri_prefix, true)) { |
| 165 if (!Java_MediaPlayerBridge_setDataUriDataSource( | 165 if (!Java_MediaPlayerBridge_setDataUriDataSource( |
| 166 env, j_media_player_bridge_.obj(), j_context, j_url_string.obj())) { | 166 env, j_media_player_bridge_.obj(), j_context, j_url_string.obj())) { |
| 167 OnMediaError(MEDIA_ERROR_FORMAT); | 167 OnMediaError(MEDIA_ERROR_FORMAT); |
| 168 } | 168 } |
| 169 return; | 169 return; |
| 170 } | 170 } |
| 171 | 171 |
| 172 ScopedJavaLocalRef<jstring> j_cookies = ConvertUTF8ToJavaString( | 172 ScopedJavaLocalRef<jstring> j_cookies = ConvertUTF8ToJavaString( |
| 173 env, cookies_); | 173 env, cookies_); |
| 174 ScopedJavaLocalRef<jstring> j_user_agent = ConvertUTF8ToJavaString( | 174 ScopedJavaLocalRef<jstring> j_user_agent = ConvertUTF8ToJavaString( |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 GURL MediaPlayerBridge::GetUrl() { | 531 GURL MediaPlayerBridge::GetUrl() { |
| 532 return url_; | 532 return url_; |
| 533 } | 533 } |
| 534 | 534 |
| 535 GURL MediaPlayerBridge::GetFirstPartyForCookies() { | 535 GURL MediaPlayerBridge::GetFirstPartyForCookies() { |
| 536 return first_party_for_cookies_; | 536 return first_party_for_cookies_; |
| 537 } | 537 } |
| 538 | 538 |
| 539 } // namespace media | 539 } // namespace media |
| OLD | NEW |