| 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 <memory> |
| 8 #include <set> | 9 #include <set> |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "google_apis/drive/drive_api_error_codes.h" | 17 #include "google_apis/drive/drive_api_error_codes.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class SequencedTaskRunner; | 20 class SequencedTaskRunner; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace net { | 23 namespace net { |
| 24 class URLRequestContextGetter; | 24 class URLRequestContextGetter; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 // Clears any authentication token and retries the request, which forces | 86 // Clears any authentication token and retries the request, which forces |
| 87 // an authentication token refresh. | 87 // an authentication token refresh. |
| 88 void RetryRequest(AuthenticatedRequestInterface* request); | 88 void RetryRequest(AuthenticatedRequestInterface* request); |
| 89 | 89 |
| 90 // Cancels the request. Used for implementing the returned closure of | 90 // Cancels the request. Used for implementing the returned closure of |
| 91 // StartRequestWithAuthRetry. | 91 // StartRequestWithAuthRetry. |
| 92 void CancelRequest( | 92 void CancelRequest( |
| 93 const base::WeakPtr<AuthenticatedRequestInterface>& request); | 93 const base::WeakPtr<AuthenticatedRequestInterface>& request); |
| 94 | 94 |
| 95 scoped_ptr<AuthServiceInterface> auth_service_; | 95 std::unique_ptr<AuthServiceInterface> auth_service_; |
| 96 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 96 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
| 97 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 97 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 98 | 98 |
| 99 std::set<AuthenticatedRequestInterface*> in_flight_requests_; | 99 std::set<AuthenticatedRequestInterface*> in_flight_requests_; |
| 100 const std::string custom_user_agent_; | 100 const std::string custom_user_agent_; |
| 101 | 101 |
| 102 base::ThreadChecker thread_checker_; | 102 base::ThreadChecker thread_checker_; |
| 103 | 103 |
| 104 // Note: This should remain the last member so it'll be destroyed and | 104 // Note: This should remain the last member so it'll be destroyed and |
| 105 // invalidate its weak pointers before any other members are destroyed. | 105 // invalidate its weak pointers before any other members are destroyed. |
| 106 base::WeakPtrFactory<RequestSender> weak_ptr_factory_; | 106 base::WeakPtrFactory<RequestSender> weak_ptr_factory_; |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(RequestSender); | 108 DISALLOW_COPY_AND_ASSIGN(RequestSender); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace google_apis | 111 } // namespace google_apis |
| 112 | 112 |
| 113 #endif // GOOGLE_APIS_DRIVE_REQUEST_SENDER_H_ | 113 #endif // GOOGLE_APIS_DRIVE_REQUEST_SENDER_H_ |
| OLD | NEW |