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 "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 Loading... |
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 (!StartsWithASCII(url, asset_prefix_, /*case_sensitive=*/ true) && | 255 if (!base::StartsWithASCII(url, asset_prefix_, /*case_sensitive=*/ true) && |
256 !StartsWithASCII(url, resource_prefix_, /*case_sensitive=*/ true)) { | 256 !base::StartsWithASCII(url, resource_prefix_, /*case_sensitive=*/ true)) { |
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 Loading... |
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 |
OLD | NEW |