| 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 #include "components/drive/service/drive_api_service.h" | 5 #include "components/drive/service/drive_api_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 return; | 243 return; |
| 244 batch_request_->Commit(); | 244 batch_request_->Commit(); |
| 245 batch_request_.reset(); | 245 batch_request_.reset(); |
| 246 } | 246 } |
| 247 | 247 |
| 248 DriveAPIService::DriveAPIService( | 248 DriveAPIService::DriveAPIService( |
| 249 OAuth2TokenService* oauth2_token_service, | 249 OAuth2TokenService* oauth2_token_service, |
| 250 net::URLRequestContextGetter* url_request_context_getter, | 250 net::URLRequestContextGetter* url_request_context_getter, |
| 251 base::SequencedTaskRunner* blocking_task_runner, | 251 base::SequencedTaskRunner* blocking_task_runner, |
| 252 const GURL& base_url, | 252 const GURL& base_url, |
| 253 const GURL& base_download_url, | |
| 254 const GURL& base_thumbnail_url, | 253 const GURL& base_thumbnail_url, |
| 255 const std::string& custom_user_agent) | 254 const std::string& custom_user_agent) |
| 256 : oauth2_token_service_(oauth2_token_service), | 255 : oauth2_token_service_(oauth2_token_service), |
| 257 url_request_context_getter_(url_request_context_getter), | 256 url_request_context_getter_(url_request_context_getter), |
| 258 blocking_task_runner_(blocking_task_runner), | 257 blocking_task_runner_(blocking_task_runner), |
| 259 url_generator_(base_url, base_download_url, base_thumbnail_url), | 258 url_generator_(base_url, base_thumbnail_url), |
| 260 custom_user_agent_(custom_user_agent) { | 259 custom_user_agent_(custom_user_agent) { |
| 261 } | 260 } |
| 262 | 261 |
| 263 DriveAPIService::~DriveAPIService() { | 262 DriveAPIService::~DriveAPIService() { |
| 264 DCHECK(thread_checker_.CalledOnValidThread()); | 263 DCHECK(thread_checker_.CalledOnValidThread()); |
| 265 if (sender_.get()) | 264 if (sender_.get()) |
| 266 sender_->auth_service()->RemoveObserver(this); | 265 sender_->auth_service()->RemoveObserver(this); |
| 267 } | 266 } |
| 268 | 267 |
| 269 void DriveAPIService::Initialize(const std::string& account_id) { | 268 void DriveAPIService::Initialize(const std::string& account_id) { |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 // reference to RequestSender and we should ensure to delete the request when | 867 // reference to RequestSender and we should ensure to delete the request when |
| 869 // the sender is deleted. Resolve the circulating dependency and fix it. | 868 // the sender is deleted. Resolve the circulating dependency and fix it. |
| 870 const google_apis::CancelCallback callback = | 869 const google_apis::CancelCallback callback = |
| 871 sender_->StartRequestWithAuthRetry(request.release()); | 870 sender_->StartRequestWithAuthRetry(request.release()); |
| 872 return base::WrapUnique<BatchRequestConfiguratorInterface>( | 871 return base::WrapUnique<BatchRequestConfiguratorInterface>( |
| 873 new BatchRequestConfigurator(weak_ref, sender_->blocking_task_runner(), | 872 new BatchRequestConfigurator(weak_ref, sender_->blocking_task_runner(), |
| 874 url_generator_, callback)); | 873 url_generator_, callback)); |
| 875 } | 874 } |
| 876 | 875 |
| 877 } // namespace drive | 876 } // namespace drive |
| OLD | NEW |