| 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 // This file contains URLFetcher, a wrapper around URLRequest that handles | 5 // This file contains URLFetcher, a wrapper around URLRequest that handles |
| 6 // low-level details like thread safety, ref counting, and incremental buffer | 6 // low-level details like thread safety, ref counting, and incremental buffer |
| 7 // reading. This is useful for callers who simply want to get the data from a | 7 // reading. This is useful for callers who simply want to get the data from a |
| 8 // URL and don't care about all the nitty-gritty details. | 8 // URL and don't care about all the nitty-gritty details. |
| 9 // | 9 // |
| 10 // NOTE(willchan): Only one "IO" thread is supported for URLFetcher. This is a | 10 // NOTE(willchan): Only one "IO" thread is supported for URLFetcher. This is a |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // |request_type| is the type of request to make. | 30 // |request_type| is the type of request to make. |
| 31 // |d| the object that will receive the callback on fetch completion. | 31 // |d| the object that will receive the callback on fetch completion. |
| 32 URLFetcherImpl(const GURL& url, | 32 URLFetcherImpl(const GURL& url, |
| 33 RequestType request_type, | 33 RequestType request_type, |
| 34 URLFetcherDelegate* d); | 34 URLFetcherDelegate* d); |
| 35 virtual ~URLFetcherImpl(); | 35 virtual ~URLFetcherImpl(); |
| 36 | 36 |
| 37 // URLFetcher implementation: | 37 // URLFetcher implementation: |
| 38 virtual void SetUploadData(const std::string& upload_content_type, | 38 virtual void SetUploadData(const std::string& upload_content_type, |
| 39 const std::string& upload_content) OVERRIDE; | 39 const std::string& upload_content) OVERRIDE; |
| 40 virtual void SetUploadFilePath( |
| 41 const std::string& upload_content_type, |
| 42 const base::FilePath& file_path, |
| 43 scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE; |
| 40 virtual void SetChunkedUpload( | 44 virtual void SetChunkedUpload( |
| 41 const std::string& upload_content_type) OVERRIDE; | 45 const std::string& upload_content_type) OVERRIDE; |
| 42 virtual void AppendChunkToUpload(const std::string& data, | 46 virtual void AppendChunkToUpload(const std::string& data, |
| 43 bool is_last_chunk) OVERRIDE; | 47 bool is_last_chunk) OVERRIDE; |
| 44 virtual void SetLoadFlags(int load_flags) OVERRIDE; | 48 virtual void SetLoadFlags(int load_flags) OVERRIDE; |
| 45 virtual int GetLoadFlags() const OVERRIDE; | 49 virtual int GetLoadFlags() const OVERRIDE; |
| 46 virtual void SetReferrer(const std::string& referrer) OVERRIDE; | 50 virtual void SetReferrer(const std::string& referrer) OVERRIDE; |
| 47 virtual void SetExtraRequestHeaders( | 51 virtual void SetExtraRequestHeaders( |
| 48 const std::string& extra_request_headers) OVERRIDE; | 52 const std::string& extra_request_headers) OVERRIDE; |
| 49 virtual void AddExtraRequestHeader(const std::string& header_line) OVERRIDE; | 53 virtual void AddExtraRequestHeader(const std::string& header_line) OVERRIDE; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 static int GetNumFetcherCores(); | 118 static int GetNumFetcherCores(); |
| 115 | 119 |
| 116 const scoped_refptr<URLFetcherCore> core_; | 120 const scoped_refptr<URLFetcherCore> core_; |
| 117 | 121 |
| 118 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); | 122 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); |
| 119 }; | 123 }; |
| 120 | 124 |
| 121 } // namespace net | 125 } // namespace net |
| 122 | 126 |
| 123 #endif // NET_URL_REQUEST_URL_FETCHER_IMPL_H_ | 127 #endif // NET_URL_REQUEST_URL_FETCHER_IMPL_H_ |
| OLD | NEW |