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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "android_webview/browser/net/android_stream_reader_url_request_job.h" | 9 #include "android_webview/browser/net/android_stream_reader_url_request_job.h" |
10 #include "android_webview/browser/net/aw_url_request_job_factory.h" | 10 #include "android_webview/browser/net/aw_url_request_job_factory.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 using base::android::JavaParamRef; | 34 using base::android::JavaParamRef; |
35 using base::android::ScopedJavaGlobalRef; | 35 using base::android::ScopedJavaGlobalRef; |
36 using base::android::ScopedJavaLocalRef; | 36 using base::android::ScopedJavaLocalRef; |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 void* kPreviouslyFailedKey = &kPreviouslyFailedKey; | 40 void* kPreviouslyFailedKey = &kPreviouslyFailedKey; |
41 | 41 |
42 void MarkRequestAsFailed(net::URLRequest* request) { | 42 void MarkRequestAsFailed(net::URLRequest* request) { |
43 request->SetUserData(kPreviouslyFailedKey, | 43 request->SetUserData(kPreviouslyFailedKey, |
44 new base::SupportsUserData::Data()); | 44 base::MakeUnique<base::SupportsUserData::Data>()); |
45 } | 45 } |
46 | 46 |
47 bool HasRequestPreviouslyFailed(net::URLRequest* request) { | 47 bool HasRequestPreviouslyFailed(net::URLRequest* request) { |
48 return request->GetUserData(kPreviouslyFailedKey) != NULL; | 48 return request->GetUserData(kPreviouslyFailedKey) != NULL; |
49 } | 49 } |
50 | 50 |
51 class AndroidStreamReaderURLRequestJobDelegateImpl | 51 class AndroidStreamReaderURLRequestJobDelegateImpl |
52 : public AndroidStreamReaderURLRequestJob::Delegate { | 52 : public AndroidStreamReaderURLRequestJob::Delegate { |
53 public: | 53 public: |
54 AndroidStreamReaderURLRequestJobDelegateImpl(); | 54 AndroidStreamReaderURLRequestJobDelegateImpl(); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 return ConvertUTF8ToJavaString(env, android_webview::kAndroidAssetPath); | 248 return ConvertUTF8ToJavaString(env, android_webview::kAndroidAssetPath); |
249 } | 249 } |
250 | 250 |
251 static ScopedJavaLocalRef<jstring> GetAndroidResourcePath( | 251 static ScopedJavaLocalRef<jstring> GetAndroidResourcePath( |
252 JNIEnv* env, | 252 JNIEnv* env, |
253 const JavaParamRef<jclass>& /*clazz*/) { | 253 const JavaParamRef<jclass>& /*clazz*/) { |
254 return ConvertUTF8ToJavaString(env, android_webview::kAndroidResourcePath); | 254 return ConvertUTF8ToJavaString(env, android_webview::kAndroidResourcePath); |
255 } | 255 } |
256 | 256 |
257 } // namespace android_webview | 257 } // namespace android_webview |
OLD | NEW |