Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Side by Side Diff: chrome/service/cloud_print/cloud_print_url_fetcher.h

Issue 11360151: Move common cloud print methods from service/cloud_print to common/cloud_print. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #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 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "net/url_request/url_fetcher.h" 12 #include "net/url_request/url_fetcher.h"
13 #include "net/url_request/url_fetcher_delegate.h" 13 #include "net/url_request/url_fetcher_delegate.h"
14 14
15 class GURL; 15 class GURL;
16 16
17 namespace base { 17 namespace base {
18 class DictionaryValue; 18 class DictionaryValue;
19 } 19 }
20 20
21 namespace net { 21 namespace net {
22 class URLRequestContextGetter; 22 class URLRequestContextGetter;
23 class URLRequestStatus; 23 class URLRequestStatus;
24 } // namespace net 24 } // namespace net
25 25
26 namespace cloud_print {
27
26 // A wrapper around URLFetcher for CloudPrint. URLFetcher applies retry logic 28 // A wrapper around URLFetcher for CloudPrint. URLFetcher applies retry logic
27 // only on HTTP response codes >= 500. In the cloud print case, we want to 29 // only on HTTP response codes >= 500. In the cloud print case, we want to
28 // retry on all network errors. In addition, we want to treat non-JSON responses 30 // retry on all network errors. In addition, we want to treat non-JSON responses
29 // (for all CloudPrint APIs that expect JSON responses) as errors and they 31 // (for all CloudPrint APIs that expect JSON responses) as errors and they
30 // must also be retried. 32 // must also be retried.
31 class CloudPrintURLFetcher 33 class CloudPrintURLFetcher
32 : public base::RefCountedThreadSafe<CloudPrintURLFetcher>, 34 : public base::RefCountedThreadSafe<CloudPrintURLFetcher>,
33 public net::URLFetcherDelegate { 35 public net::URLFetcherDelegate {
34 public: 36 public:
35 enum ResponseAction { 37 enum ResponseAction {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 Delegate* delegate_; 131 Delegate* delegate_;
130 int num_retries_; 132 int num_retries_;
131 net::URLFetcher::RequestType request_type_; 133 net::URLFetcher::RequestType request_type_;
132 std::string additional_headers_; 134 std::string additional_headers_;
133 std::string post_data_mime_type_; 135 std::string post_data_mime_type_;
134 std::string post_data_; 136 std::string post_data_;
135 }; 137 };
136 138
137 typedef CloudPrintURLFetcher::Delegate CloudPrintURLFetcherDelegate; 139 typedef CloudPrintURLFetcher::Delegate CloudPrintURLFetcherDelegate;
138 140
141 } // namespace cloud_print
142
139 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_ 143 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_
OLDNEW
« no previous file with comments | « chrome/service/cloud_print/cloud_print_token_store_unittest.cc ('k') | chrome/service/cloud_print/cloud_print_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698