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 #ifndef GOOGLE_APIS_DRIVE_REQUEST_SENDER_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_REQUEST_SENDER_H_ |
6 #define GOOGLE_APIS_DRIVE_REQUEST_SENDER_H_ | 6 #define GOOGLE_APIS_DRIVE_REQUEST_SENDER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 // this RequestSender. | 37 // this RequestSender. |
38 // | 38 // |
39 // |url_request_context_getter| is the context used to perform network | 39 // |url_request_context_getter| is the context used to perform network |
40 // requests from this RequestSender. | 40 // requests from this RequestSender. |
41 // | 41 // |
42 // |blocking_task_runner| is used for running blocking operation, e.g., | 42 // |blocking_task_runner| is used for running blocking operation, e.g., |
43 // parsing JSON response from the server. | 43 // parsing JSON response from the server. |
44 // | 44 // |
45 // |custom_user_agent| will be used for the User-Agent header in HTTP | 45 // |custom_user_agent| will be used for the User-Agent header in HTTP |
46 // requests issued through the request sender if the value is not empty. | 46 // requests issued through the request sender if the value is not empty. |
47 RequestSender(AuthServiceInterface* auth_service, | 47 RequestSender( |
48 net::URLRequestContextGetter* url_request_context_getter, | 48 AuthServiceInterface* auth_service, |
49 base::SequencedTaskRunner* blocking_task_runner, | 49 net::URLRequestContextGetter* url_request_context_getter, |
50 const std::string& custom_user_agent); | 50 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, |
| 51 const std::string& custom_user_agent); |
51 ~RequestSender(); | 52 ~RequestSender(); |
52 | 53 |
53 AuthServiceInterface* auth_service() { return auth_service_.get(); } | 54 AuthServiceInterface* auth_service() { return auth_service_.get(); } |
54 | 55 |
55 net::URLRequestContextGetter* url_request_context_getter() const { | 56 net::URLRequestContextGetter* url_request_context_getter() const { |
56 return url_request_context_getter_.get(); | 57 return url_request_context_getter_.get(); |
57 } | 58 } |
58 | 59 |
59 base::SequencedTaskRunner* blocking_task_runner() const { | 60 base::SequencedTaskRunner* blocking_task_runner() const { |
60 return blocking_task_runner_.get(); | 61 return blocking_task_runner_.get(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // Note: This should remain the last member so it'll be destroyed and | 103 // Note: This should remain the last member so it'll be destroyed and |
103 // invalidate its weak pointers before any other members are destroyed. | 104 // invalidate its weak pointers before any other members are destroyed. |
104 base::WeakPtrFactory<RequestSender> weak_ptr_factory_; | 105 base::WeakPtrFactory<RequestSender> weak_ptr_factory_; |
105 | 106 |
106 DISALLOW_COPY_AND_ASSIGN(RequestSender); | 107 DISALLOW_COPY_AND_ASSIGN(RequestSender); |
107 }; | 108 }; |
108 | 109 |
109 } // namespace google_apis | 110 } // namespace google_apis |
110 | 111 |
111 #endif // GOOGLE_APIS_DRIVE_REQUEST_SENDER_H_ | 112 #endif // GOOGLE_APIS_DRIVE_REQUEST_SENDER_H_ |
OLD | NEW |