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 SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ |
7 | 7 |
8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
10 #include "google_apis/gaia/oauth2_token_service_request.h" | 10 #include "google_apis/gaia/oauth2_token_service_request.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 private: | 72 private: |
73 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, | 73 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, |
74 ExtractCrc32c_NoHeaders); | 74 ExtractCrc32c_NoHeaders); |
75 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_First); | 75 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_First); |
76 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_TooLong); | 76 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_TooLong); |
77 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_None); | 77 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_None); |
78 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_Empty); | 78 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_Empty); |
79 | 79 |
80 struct DownloadState; | 80 struct DownloadState; |
81 typedef std::string AttachmentUrl; | 81 typedef std::string AttachmentUrl; |
82 typedef base::ScopedPtrHashMap<AttachmentUrl, DownloadState> StateMap; | 82 typedef base::ScopedPtrHashMap<AttachmentUrl, scoped_ptr<DownloadState>> |
| 83 StateMap; |
83 typedef std::vector<DownloadState*> StateList; | 84 typedef std::vector<DownloadState*> StateList; |
84 | 85 |
85 scoped_ptr<net::URLFetcher> CreateFetcher(const AttachmentUrl& url, | 86 scoped_ptr<net::URLFetcher> CreateFetcher(const AttachmentUrl& url, |
86 const std::string& access_token); | 87 const std::string& access_token); |
87 void RequestAccessToken(DownloadState* download_state); | 88 void RequestAccessToken(DownloadState* download_state); |
88 void ReportResult( | 89 void ReportResult( |
89 const DownloadState& download_state, | 90 const DownloadState& download_state, |
90 const DownloadResult& result, | 91 const DownloadResult& result, |
91 const scoped_refptr<base::RefCountedString>& attachment_data); | 92 const scoped_refptr<base::RefCountedString>& attachment_data); |
92 | 93 |
(...skipping 23 matching lines...) Expand all Loading... |
116 StateList requests_waiting_for_access_token_; | 117 StateList requests_waiting_for_access_token_; |
117 | 118 |
118 ModelType model_type_; | 119 ModelType model_type_; |
119 | 120 |
120 DISALLOW_COPY_AND_ASSIGN(AttachmentDownloaderImpl); | 121 DISALLOW_COPY_AND_ASSIGN(AttachmentDownloaderImpl); |
121 }; | 122 }; |
122 | 123 |
123 } // namespace syncer | 124 } // namespace syncer |
124 | 125 |
125 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ | 126 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ |
OLD | NEW |