| 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/intercepted_request_data_impl.h" | 5 #include "android_webview/native/intercepted_request_data_impl.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/native/input_stream_impl.h" | 8 #include "android_webview/native/input_stream_impl.h" |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public AndroidStreamReaderURLRequestJob::Delegate { | 22 public AndroidStreamReaderURLRequestJob::Delegate { |
| 23 public: | 23 public: |
| 24 StreamReaderJobDelegateImpl( | 24 StreamReaderJobDelegateImpl( |
| 25 const InterceptedRequestDataImpl* intercepted_request_data) | 25 const InterceptedRequestDataImpl* intercepted_request_data) |
| 26 : intercepted_request_data_impl_(intercepted_request_data) { | 26 : intercepted_request_data_impl_(intercepted_request_data) { |
| 27 DCHECK(intercepted_request_data_impl_); | 27 DCHECK(intercepted_request_data_impl_); |
| 28 } | 28 } |
| 29 | 29 |
| 30 virtual scoped_ptr<InputStream> OpenInputStream( | 30 virtual scoped_ptr<InputStream> OpenInputStream( |
| 31 JNIEnv* env, | 31 JNIEnv* env, |
| 32 net::URLRequest* request) OVERRIDE { | 32 const GURL& url) OVERRIDE { |
| 33 return intercepted_request_data_impl_->GetInputStream(env).Pass(); | 33 return intercepted_request_data_impl_->GetInputStream(env).Pass(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 virtual void OnInputStreamOpenFailed(net::URLRequest* request, |
| 37 bool* restart) OVERRIDE { |
| 38 *restart = false; |
| 39 } |
| 40 |
| 36 virtual bool GetMimeType(JNIEnv* env, | 41 virtual bool GetMimeType(JNIEnv* env, |
| 37 net::URLRequest* request, | 42 net::URLRequest* request, |
| 38 android_webview::InputStream* stream, | 43 android_webview::InputStream* stream, |
| 39 std::string* mime_type) OVERRIDE { | 44 std::string* mime_type) OVERRIDE { |
| 40 return intercepted_request_data_impl_->GetMimeType(env, mime_type); | 45 return intercepted_request_data_impl_->GetMimeType(env, mime_type); |
| 41 } | 46 } |
| 42 | 47 |
| 43 virtual bool GetCharset(JNIEnv* env, | 48 virtual bool GetCharset(JNIEnv* env, |
| 44 net::URLRequest* request, | 49 net::URLRequest* request, |
| 45 android_webview::InputStream* stream, | 50 android_webview::InputStream* stream, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 net::URLRequestJob* InterceptedRequestDataImpl::CreateJobFor( | 102 net::URLRequestJob* InterceptedRequestDataImpl::CreateJobFor( |
| 98 net::URLRequest* request, | 103 net::URLRequest* request, |
| 99 net::NetworkDelegate* network_delegate) const { | 104 net::NetworkDelegate* network_delegate) const { |
| 100 scoped_ptr<AndroidStreamReaderURLRequestJob::Delegate> | 105 scoped_ptr<AndroidStreamReaderURLRequestJob::Delegate> |
| 101 stream_reader_job_delegate_impl(new StreamReaderJobDelegateImpl(this)); | 106 stream_reader_job_delegate_impl(new StreamReaderJobDelegateImpl(this)); |
| 102 return new AndroidStreamReaderURLRequestJob( | 107 return new AndroidStreamReaderURLRequestJob( |
| 103 request, network_delegate, stream_reader_job_delegate_impl.Pass()); | 108 request, network_delegate, stream_reader_job_delegate_impl.Pass()); |
| 104 } | 109 } |
| 105 | 110 |
| 106 } // namespace android_webview | 111 } // namespace android_webview |
| OLD | NEW |