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