| 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 17 matching lines...) Expand all Loading... |
| 28 public: | 28 public: |
| 29 // |url| is the URL to send the request to. | 29 // |url| is the URL to send the request to. |
| 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 SetUploadDataStream( |
| 39 const std::string& upload_content_type, |
| 40 scoped_ptr<UploadDataStream> upload_content) OVERRIDE; |
| 38 virtual void SetUploadData(const std::string& upload_content_type, | 41 virtual void SetUploadData(const std::string& upload_content_type, |
| 39 const std::string& upload_content) OVERRIDE; | 42 const std::string& upload_content) OVERRIDE; |
| 40 virtual void SetChunkedUpload( | 43 virtual void SetChunkedUpload( |
| 41 const std::string& upload_content_type) OVERRIDE; | 44 const std::string& upload_content_type) OVERRIDE; |
| 42 virtual void AppendChunkToUpload(const std::string& data, | 45 virtual void AppendChunkToUpload(const std::string& data, |
| 43 bool is_last_chunk) OVERRIDE; | 46 bool is_last_chunk) OVERRIDE; |
| 44 virtual void SetLoadFlags(int load_flags) OVERRIDE; | 47 virtual void SetLoadFlags(int load_flags) OVERRIDE; |
| 45 virtual int GetLoadFlags() const OVERRIDE; | 48 virtual int GetLoadFlags() const OVERRIDE; |
| 46 virtual void SetReferrer(const std::string& referrer) OVERRIDE; | 49 virtual void SetReferrer(const std::string& referrer) OVERRIDE; |
| 47 virtual void SetExtraRequestHeaders( | 50 virtual void SetExtraRequestHeaders( |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 static int GetNumFetcherCores(); | 116 static int GetNumFetcherCores(); |
| 114 | 117 |
| 115 const scoped_refptr<URLFetcherCore> core_; | 118 const scoped_refptr<URLFetcherCore> core_; |
| 116 | 119 |
| 117 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); | 120 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); |
| 118 }; | 121 }; |
| 119 | 122 |
| 120 } // namespace net | 123 } // namespace net |
| 121 | 124 |
| 122 #endif // NET_URL_REQUEST_URL_FETCHER_IMPL_H_ | 125 #endif // NET_URL_REQUEST_URL_FETCHER_IMPL_H_ |
| OLD | NEW |