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_UPLOADER_IMPL_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_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/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 static void ConfigureURLFetcherCommon( | 70 static void ConfigureURLFetcherCommon( |
71 net::URLFetcher* fetcher, | 71 net::URLFetcher* fetcher, |
72 const std::string& auth_token, | 72 const std::string& auth_token, |
73 const std::string& raw_store_birthday, | 73 const std::string& raw_store_birthday, |
74 ModelType model_type, | 74 ModelType model_type, |
75 net::URLRequestContextGetter* request_context_getter); | 75 net::URLRequestContextGetter* request_context_getter); |
76 | 76 |
77 private: | 77 private: |
78 class UploadState; | 78 class UploadState; |
79 typedef std::string UniqueId; | 79 typedef std::string UniqueId; |
80 typedef base::ScopedPtrHashMap<UniqueId, UploadState> StateMap; | 80 typedef base::ScopedPtrHashMap<UniqueId, scoped_ptr<UploadState>> StateMap; |
81 | 81 |
82 void OnUploadStateStopped(const UniqueId& unique_id); | 82 void OnUploadStateStopped(const UniqueId& unique_id); |
83 | 83 |
84 // Encodes |input| into |output| using URL safe base64, no padding. | 84 // Encodes |input| into |output| using URL safe base64, no padding. |
85 // NOTE: Safe to use the same variable for both |input| and |output|. | 85 // NOTE: Safe to use the same variable for both |input| and |output|. |
86 static void Base64URLSafeEncode(const std::string& input, | 86 static void Base64URLSafeEncode(const std::string& input, |
87 std::string* output); | 87 std::string* output); |
88 | 88 |
89 GURL sync_service_url_; | 89 GURL sync_service_url_; |
90 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 90 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
91 std::string account_id_; | 91 std::string account_id_; |
92 OAuth2TokenService::ScopeSet scopes_; | 92 OAuth2TokenService::ScopeSet scopes_; |
93 scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider> | 93 scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider> |
94 token_service_provider_; | 94 token_service_provider_; |
95 std::string raw_store_birthday_; | 95 std::string raw_store_birthday_; |
96 StateMap state_map_; | 96 StateMap state_map_; |
97 ModelType model_type_; | 97 ModelType model_type_; |
98 | 98 |
99 // Must be last data member. | 99 // Must be last data member. |
100 base::WeakPtrFactory<AttachmentUploaderImpl> weak_ptr_factory_; | 100 base::WeakPtrFactory<AttachmentUploaderImpl> weak_ptr_factory_; |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(AttachmentUploaderImpl); | 102 DISALLOW_COPY_AND_ASSIGN(AttachmentUploaderImpl); |
103 }; | 103 }; |
104 | 104 |
105 } // namespace syncer | 105 } // namespace syncer |
106 | 106 |
107 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ | 107 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ |
OLD | NEW |