| 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_BROWSER_NET_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_NET_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_NET_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_NET_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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 scoped_ptr<Delegate> delegate); | 89 scoped_ptr<Delegate> delegate); |
| 90 AndroidStreamReaderURLRequestJob( | 90 AndroidStreamReaderURLRequestJob( |
| 91 net::URLRequest* request, | 91 net::URLRequest* request, |
| 92 net::NetworkDelegate* network_delegate, | 92 net::NetworkDelegate* network_delegate, |
| 93 scoped_ptr<DelegateObtainer> delegate_obtainer, | 93 scoped_ptr<DelegateObtainer> delegate_obtainer, |
| 94 bool); // resolve ambiguity | 94 bool); // resolve ambiguity |
| 95 | 95 |
| 96 // URLRequestJob: | 96 // URLRequestJob: |
| 97 void Start() override; | 97 void Start() override; |
| 98 void Kill() override; | 98 void Kill() override; |
| 99 bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; | 99 int ReadRawData(net::IOBuffer* buf, int buf_size) override; |
| 100 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; | 100 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; |
| 101 bool GetMimeType(std::string* mime_type) const override; | 101 bool GetMimeType(std::string* mime_type) const override; |
| 102 bool GetCharset(std::string* charset) override; | 102 bool GetCharset(std::string* charset) override; |
| 103 int GetResponseCode() const override; | 103 int GetResponseCode() const override; |
| 104 void GetResponseInfo(net::HttpResponseInfo* info) override; | 104 void GetResponseInfo(net::HttpResponseInfo* info) override; |
| 105 | 105 |
| 106 protected: | 106 protected: |
| 107 ~AndroidStreamReaderURLRequestJob() override; | 107 ~AndroidStreamReaderURLRequestJob() override; |
| 108 | 108 |
| 109 // Gets the TaskRunner for the worker thread. | 109 // Gets the TaskRunner for the worker thread. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 124 | 124 |
| 125 void HeadersComplete(int status_code, const std::string& status_text); | 125 void HeadersComplete(int status_code, const std::string& status_text); |
| 126 | 126 |
| 127 void OnInputStreamOpened( | 127 void OnInputStreamOpened( |
| 128 scoped_ptr<Delegate> delegate, | 128 scoped_ptr<Delegate> delegate, |
| 129 scoped_ptr<android_webview::InputStream> input_stream); | 129 scoped_ptr<android_webview::InputStream> input_stream); |
| 130 void OnReaderSeekCompleted(int content_size); | 130 void OnReaderSeekCompleted(int content_size); |
| 131 void OnReaderReadCompleted(int bytes_read); | 131 void OnReaderReadCompleted(int bytes_read); |
| 132 | 132 |
| 133 net::HttpByteRange byte_range_; | 133 net::HttpByteRange byte_range_; |
| 134 net::Error range_parse_result_; |
| 134 scoped_ptr<net::HttpResponseInfo> response_info_; | 135 scoped_ptr<net::HttpResponseInfo> response_info_; |
| 135 scoped_ptr<Delegate> delegate_; | 136 scoped_ptr<Delegate> delegate_; |
| 136 scoped_ptr<DelegateObtainer> delegate_obtainer_; | 137 scoped_ptr<DelegateObtainer> delegate_obtainer_; |
| 137 scoped_refptr<InputStreamReaderWrapper> input_stream_reader_wrapper_; | 138 scoped_refptr<InputStreamReaderWrapper> input_stream_reader_wrapper_; |
| 138 base::ThreadChecker thread_checker_; | 139 base::ThreadChecker thread_checker_; |
| 139 | 140 |
| 140 base::WeakPtrFactory<AndroidStreamReaderURLRequestJob> weak_factory_; | 141 base::WeakPtrFactory<AndroidStreamReaderURLRequestJob> weak_factory_; |
| 141 | 142 |
| 142 DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLRequestJob); | 143 DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLRequestJob); |
| 143 }; | 144 }; |
| 144 | 145 |
| 145 } // namespace android_webview | 146 } // namespace android_webview |
| 146 | 147 |
| 147 #endif // ANDROID_WEBVIEW_BROWSER_NET_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ | 148 #endif // ANDROID_WEBVIEW_BROWSER_NET_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_ |
| OLD | NEW |