Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: media/base/android/media_player_bridge.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/android/media_codec_bridge.cc ('k') | media/base/key_systems.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/base/android/media_codec_bridge.cc ('k') | media/base/key_systems.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698