| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SYNC_ENGINE_IMPL_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <unordered_map> | 12 #include <unordered_map> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/threading/non_thread_safe.h" | 17 #include "base/sequence_checker.h" |
| 18 #include "components/sync/base/model_type.h" | 18 #include "components/sync/base/model_type.h" |
| 19 #include "components/sync/engine/attachments/attachment_downloader.h" | 19 #include "components/sync/engine/attachments/attachment_downloader.h" |
| 20 #include "google_apis/gaia/oauth2_token_service_request.h" | 20 #include "google_apis/gaia/oauth2_token_service_request.h" |
| 21 #include "net/url_request/url_fetcher_delegate.h" | 21 #include "net/url_request/url_fetcher_delegate.h" |
| 22 #include "net/url_request/url_request_context_getter.h" | 22 #include "net/url_request/url_request_context_getter.h" |
| 23 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 24 | 24 |
| 25 namespace net { | 25 namespace net { |
| 26 class HttpResponseHeaders; | 26 class HttpResponseHeaders; |
| 27 } // namespace net | 27 } // namespace net |
| 28 | 28 |
| 29 namespace syncer { | 29 namespace syncer { |
| 30 | 30 |
| 31 // An implementation of AttachmentDownloader. | 31 // An implementation of AttachmentDownloader. |
| 32 class AttachmentDownloaderImpl : public AttachmentDownloader, | 32 class AttachmentDownloaderImpl : public AttachmentDownloader, |
| 33 public OAuth2TokenService::Consumer, | 33 public OAuth2TokenService::Consumer, |
| 34 public net::URLFetcherDelegate, | 34 public net::URLFetcherDelegate { |
| 35 public base::NonThreadSafe { | |
| 36 public: | 35 public: |
| 37 // |sync_service_url| is the URL of the sync service. | 36 // |sync_service_url| is the URL of the sync service. |
| 38 // | 37 // |
| 39 // |url_request_context_getter| provides a URLRequestContext. | 38 // |url_request_context_getter| provides a URLRequestContext. |
| 40 // | 39 // |
| 41 // |account_id| is the account id to use for downloads. | 40 // |account_id| is the account id to use for downloads. |
| 42 // | 41 // |
| 43 // |scopes| is the set of scopes to use for downloads. | 42 // |scopes| is the set of scopes to use for downloads. |
| 44 // | 43 // |
| 45 // |token_service_provider| provides an OAuth2 token service. | 44 // |token_service_provider| provides an OAuth2 token service. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 std::string raw_store_birthday_; | 114 std::string raw_store_birthday_; |
| 116 | 115 |
| 117 StateMap state_map_; | 116 StateMap state_map_; |
| 118 // |requests_waiting_for_access_token_| only keeps references to DownloadState | 117 // |requests_waiting_for_access_token_| only keeps references to DownloadState |
| 119 // objects while access token request is pending. It doesn't control objects' | 118 // objects while access token request is pending. It doesn't control objects' |
| 120 // lifetime. | 119 // lifetime. |
| 121 StateList requests_waiting_for_access_token_; | 120 StateList requests_waiting_for_access_token_; |
| 122 | 121 |
| 123 ModelType model_type_; | 122 ModelType model_type_; |
| 124 | 123 |
| 124 SEQUENCE_CHECKER(sequence_checker_); |
| 125 |
| 125 DISALLOW_COPY_AND_ASSIGN(AttachmentDownloaderImpl); | 126 DISALLOW_COPY_AND_ASSIGN(AttachmentDownloaderImpl); |
| 126 }; | 127 }; |
| 127 | 128 |
| 128 } // namespace syncer | 129 } // namespace syncer |
| 129 | 130 |
| 130 #endif // COMPONENTS_SYNC_ENGINE_IMPL_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ | 131 #endif // COMPONENTS_SYNC_ENGINE_IMPL_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ |
| OLD | NEW |