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 is already taken on Windows. |
| 78 // <winnt.h> defines a DELETE macro. |
77 }; | 79 }; |
78 | 80 |
79 // |url| is the URL to send the request to. | 81 // |url| is the URL to send the request to. |
80 // |request_type| is the type of request to make. | 82 // |request_type| is the type of request to make. |
81 // |d| the object that will receive the callback on fetch completion. | 83 // |d| the object that will receive the callback on fetch completion. |
82 static URLFetcher* Create(const GURL& url, | 84 static URLFetcher* Create(const GURL& url, |
83 RequestType request_type, | 85 RequestType request_type, |
84 URLFetcherDelegate* d); | 86 URLFetcherDelegate* d); |
85 | 87 |
86 // Like above, but if there's a URLFetcherFactory registered with the | 88 // 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 | 223 // true, caller takes responsibility for the temp file, and it will not |
222 // be removed once the URLFetcher is destroyed. User should not take | 224 // be removed once the URLFetcher is destroyed. User should not take |
223 // ownership more than once, or call this method after taking ownership. | 225 // ownership more than once, or call this method after taking ownership. |
224 virtual bool GetResponseAsFilePath(bool take_ownership, | 226 virtual bool GetResponseAsFilePath(bool take_ownership, |
225 FilePath* out_response_path) const = 0; | 227 FilePath* out_response_path) const = 0; |
226 }; | 228 }; |
227 | 229 |
228 } // namespace content | 230 } // namespace content |
229 | 231 |
230 #endif // CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ | 232 #endif // CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ |
OLD | NEW |