| 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 #ifndef ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 std::string* charset) = 0; | 67 std::string* charset) = 0; |
| 68 | 68 |
| 69 virtual void AppendResponseHeaders(JNIEnv* env, | 69 virtual void AppendResponseHeaders(JNIEnv* env, |
| 70 net::HttpResponseHeaders* headers) = 0; | 70 net::HttpResponseHeaders* headers) = 0; |
| 71 | 71 |
| 72 virtual ~Delegate() {} | 72 virtual ~Delegate() {} |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 AndroidStreamReaderURLRequestJob( | 75 AndroidStreamReaderURLRequestJob( |
| 76 net::URLRequest* request, | 76 net::URLRequest* request, |
| 77 net::NetworkDelegate* network_delegate); |
| 78 AndroidStreamReaderURLRequestJob( |
| 79 net::URLRequest* request, |
| 77 net::NetworkDelegate* network_delegate, | 80 net::NetworkDelegate* network_delegate, |
| 78 scoped_ptr<Delegate> delegate); | 81 scoped_ptr<Delegate> delegate); |
| 82 void DeliverResponseFromDelegate(scoped_ptr<Delegate> delegate); |
| 83 void DeliverResponseFromNetwork(); |
| 84 void MaybeStart(); |
| 79 | 85 |
| 80 // URLRequestJob: | 86 // URLRequestJob: |
| 81 void Start() override; | 87 void Start() override; |
| 82 void Kill() override; | 88 void Kill() override; |
| 83 bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; | 89 bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; |
| 84 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; | 90 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; |
| 85 bool GetMimeType(std::string* mime_type) const override; | 91 bool GetMimeType(std::string* mime_type) const override; |
| 86 bool GetCharset(std::string* charset) override; | 92 bool GetCharset(std::string* charset) override; |
| 87 int GetResponseCode() const override; | 93 int GetResponseCode() const override; |
| 88 void GetResponseInfo(net::HttpResponseInfo* info) override; | 94 void GetResponseInfo(net::HttpResponseInfo* info) override; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 115 base::ThreadChecker thread_checker_; | 121 base::ThreadChecker thread_checker_; |
| 116 | 122 |
| 117 base::WeakPtrFactory<AndroidStreamReaderURLRequestJob> weak_factory_; | 123 base::WeakPtrFactory<AndroidStreamReaderURLRequestJob> weak_factory_; |
| 118 | 124 |
| 119 DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLRequestJob); | 125 DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLRequestJob); |
| 120 }; | 126 }; |
| 121 | 127 |
| 122 } // namespace android_webview | 128 } // namespace android_webview |
| 123 | 129 |
| 124 #endif // ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ | 130 #endif // ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ |
| OLD | NEW |