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

Side by Side Diff: android_webview/native/android_protocol_handler.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 | « no previous file | android_webview/native/aw_media_url_interceptor.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 "android_webview/native/android_protocol_handler.h" 5 #include "android_webview/native/android_protocol_handler.h"
6 6
7 #include "android_webview/browser/net/android_stream_reader_url_request_job.h" 7 #include "android_webview/browser/net/android_stream_reader_url_request_job.h"
8 #include "android_webview/browser/net/aw_url_request_job_factory.h" 8 #include "android_webview/browser/net/aw_url_request_job_factory.h"
9 #include "android_webview/common/url_constants.h" 9 #include "android_webview/common/url_constants.h"
10 #include "android_webview/native/input_stream_impl.h" 10 #include "android_webview/native/input_stream_impl.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 AssetFileRequestInterceptor::~AssetFileRequestInterceptor() { 246 AssetFileRequestInterceptor::~AssetFileRequestInterceptor() {
247 } 247 }
248 248
249 bool AssetFileRequestInterceptor::ShouldHandleRequest( 249 bool AssetFileRequestInterceptor::ShouldHandleRequest(
250 const net::URLRequest* request) const { 250 const net::URLRequest* request) const {
251 if (!request->url().SchemeIsFile()) 251 if (!request->url().SchemeIsFile())
252 return false; 252 return false;
253 253
254 const std::string& url = request->url().spec(); 254 const std::string& url = request->url().spec();
255 if (!base::StartsWithASCII(url, asset_prefix_, /*case_sensitive=*/ true) && 255 if (!base::StartsWith(url, asset_prefix_, base::CompareCase::SENSITIVE) &&
256 !base::StartsWithASCII(url, resource_prefix_, /*case_sensitive=*/ true)) { 256 !base::StartsWith(url, resource_prefix_, base::CompareCase::SENSITIVE)) {
257 return false; 257 return false;
258 } 258 }
259 259
260 return true; 260 return true;
261 } 261 }
262 262
263 // ContentSchemeRequestInterceptor -------------------------------------------- 263 // ContentSchemeRequestInterceptor --------------------------------------------
264 264
265 ContentSchemeRequestInterceptor::ContentSchemeRequestInterceptor() { 265 ContentSchemeRequestInterceptor::ContentSchemeRequestInterceptor() {
266 } 266 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 env, android_webview::kAndroidAssetPath).Release(); 313 env, android_webview::kAndroidAssetPath).Release();
314 } 314 }
315 315
316 static jstring GetAndroidResourcePath(JNIEnv* env, jclass /*clazz*/) { 316 static jstring GetAndroidResourcePath(JNIEnv* env, jclass /*clazz*/) {
317 // OK to release, JNI binding. 317 // OK to release, JNI binding.
318 return ConvertUTF8ToJavaString( 318 return ConvertUTF8ToJavaString(
319 env, android_webview::kAndroidResourcePath).Release(); 319 env, android_webview::kAndroidResourcePath).Release();
320 } 320 }
321 321
322 } // namespace android_webview 322 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/native/aw_media_url_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698