OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ |
6 #define CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ | 6 #define CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 // Imposible http response code. Used to signal that no http response code | 67 // Imposible http response code. Used to signal that no http response code |
68 // was received. | 68 // was received. |
69 enum ResponseCode { | 69 enum ResponseCode { |
70 RESPONSE_CODE_INVALID = -1 | 70 RESPONSE_CODE_INVALID = -1 |
71 }; | 71 }; |
72 | 72 |
73 enum RequestType { | 73 enum RequestType { |
74 GET, | 74 GET, |
75 POST, | 75 POST, |
76 HEAD, | 76 HEAD, |
77 DELETE_REQUEST, // DELETE macro is already taken on Windows | |
zel
2011/12/13 20:10:50
PTAL, I had to rename this enum since DELETE macro
| |
77 }; | 78 }; |
78 | 79 |
79 // |url| is the URL to send the request to. | 80 // |url| is the URL to send the request to. |
80 // |request_type| is the type of request to make. | 81 // |request_type| is the type of request to make. |
81 // |d| the object that will receive the callback on fetch completion. | 82 // |d| the object that will receive the callback on fetch completion. |
82 static URLFetcher* Create(const GURL& url, | 83 static URLFetcher* Create(const GURL& url, |
83 RequestType request_type, | 84 RequestType request_type, |
84 URLFetcherDelegate* d); | 85 URLFetcherDelegate* d); |
85 | 86 |
86 // Like above, but if there's a URLFetcherFactory registered with the | 87 // Like above, but if there's a URLFetcherFactory registered with the |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 // true, caller takes responsibility for the temp file, and it will not | 222 // true, caller takes responsibility for the temp file, and it will not |
222 // be removed once the URLFetcher is destroyed. User should not take | 223 // be removed once the URLFetcher is destroyed. User should not take |
223 // ownership more than once, or call this method after taking ownership. | 224 // ownership more than once, or call this method after taking ownership. |
224 virtual bool GetResponseAsFilePath(bool take_ownership, | 225 virtual bool GetResponseAsFilePath(bool take_ownership, |
225 FilePath* out_response_path) const = 0; | 226 FilePath* out_response_path) const = 0; |
226 }; | 227 }; |
227 | 228 |
228 } // namespace content | 229 } // namespace content |
229 | 230 |
230 #endif // CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ | 231 #endif // CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ |
OLD | NEW |