| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_ |
| 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 const std::string& post_data_mime_type, | 85 const std::string& post_data_mime_type, |
| 86 const std::string& post_data); | 86 const std::string& post_data); |
| 87 | 87 |
| 88 // URLFetcher::Delegate implementation. | 88 // URLFetcher::Delegate implementation. |
| 89 virtual void OnURLFetchComplete(const URLFetcher* source, const GURL& url, | 89 virtual void OnURLFetchComplete(const URLFetcher* source, const GURL& url, |
| 90 const URLRequestStatus& status, | 90 const URLRequestStatus& status, |
| 91 int response_code, | 91 int response_code, |
| 92 const ResponseCookies& cookies, | 92 const ResponseCookies& cookies, |
| 93 const std::string& data); | 93 const std::string& data); |
| 94 protected: | 94 protected: |
| 95 friend class base::RefCountedThreadSafe<CloudPrintURLFetcher>; |
| 96 virtual ~CloudPrintURLFetcher(); |
| 97 |
| 95 // Virtual for testing. | 98 // Virtual for testing. |
| 96 virtual URLRequestContextGetter* GetRequestContextGetter(); | 99 virtual URLRequestContextGetter* GetRequestContextGetter(); |
| 97 | 100 |
| 98 private: | 101 private: |
| 99 void StartRequestHelper(const GURL& url, | 102 void StartRequestHelper(const GURL& url, |
| 100 URLFetcher::RequestType request_type, | 103 URLFetcher::RequestType request_type, |
| 101 Delegate* delegate, | 104 Delegate* delegate, |
| 102 const std::string& auth_token, | 105 const std::string& auth_token, |
| 103 int max_retries, | 106 int max_retries, |
| 104 const std::string& post_data_mime_type, | 107 const std::string& post_data_mime_type, |
| 105 const std::string& post_data); | 108 const std::string& post_data); |
| 106 | 109 |
| 107 scoped_ptr<URLFetcher> request_; | 110 scoped_ptr<URLFetcher> request_; |
| 108 Delegate* delegate_; | 111 Delegate* delegate_; |
| 109 int num_retries_; | 112 int num_retries_; |
| 110 }; | 113 }; |
| 111 | 114 |
| 112 typedef CloudPrintURLFetcher::Delegate CloudPrintURLFetcherDelegate; | 115 typedef CloudPrintURLFetcher::Delegate CloudPrintURLFetcherDelegate; |
| 113 | 116 |
| 114 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_ | 117 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_ |
| OLD | NEW |