OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 NET_URL_REQUEST_URL_REQUEST_SIMPLE_JOB_H__ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_SIMPLE_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_SIMPLE_JOB_H__ | 6 #define NET_URL_REQUEST_URL_REQUEST_SIMPLE_JOB_H_ |
7 | 7 |
8 #include "net/url_request/url_request.h" | |
9 #include "net/url_request/url_request_job.h" | 8 #include "net/url_request/url_request_job.h" |
10 | 9 |
| 10 class URLRequest; |
| 11 |
11 class URLRequestSimpleJob : public URLRequestJob { | 12 class URLRequestSimpleJob : public URLRequestJob { |
12 public: | 13 public: |
13 URLRequestSimpleJob(URLRequest* request); | 14 URLRequestSimpleJob(URLRequest* request); |
14 | 15 |
15 virtual void Start(); | 16 virtual void Start(); |
16 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read); | 17 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read); |
17 virtual bool GetMimeType(std::string* mime_type); | 18 virtual bool GetMimeType(std::string* mime_type); |
18 virtual bool GetCharset(std::string* charset); | 19 virtual bool GetCharset(std::string* charset); |
19 | 20 |
20 protected: | 21 protected: |
21 // subclasses must override the way response data is determined. | 22 // subclasses must override the way response data is determined. |
22 virtual bool GetData(std::string* mime_type, | 23 virtual bool GetData(std::string* mime_type, |
23 std::string* charset, | 24 std::string* charset, |
24 std::string* data) const = 0; | 25 std::string* data) const = 0; |
25 | 26 |
26 private: | 27 private: |
27 void StartAsync(); | 28 void StartAsync(); |
28 | 29 |
29 std::string mime_type_; | 30 std::string mime_type_; |
30 std::string charset_; | 31 std::string charset_; |
31 std::string data_; | 32 std::string data_; |
32 int data_offset_; | 33 int data_offset_; |
33 }; | 34 }; |
34 | 35 |
35 #endif // NET_URL_REQUEST_URL_REQUEST_DATA_JOB_H__ | 36 #endif // NET_URL_REQUEST_URL_REQUEST_DATA_JOB_H_ |
36 | |
OLD | NEW |