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 CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // Pointers to DocumentsServiceInterface object owned by GDataSystemService. | 127 // Pointers to DocumentsServiceInterface object owned by GDataSystemService. |
128 // The lifetime of this object is guaranteed to exceed that of the | 128 // The lifetime of this object is guaranteed to exceed that of the |
129 // GDataUploader instance. | 129 // GDataUploader instance. |
130 DocumentsServiceInterface* documents_service_; | 130 DocumentsServiceInterface* documents_service_; |
131 | 131 |
132 int next_upload_id_; // id counter. | 132 int next_upload_id_; // id counter. |
133 | 133 |
134 typedef std::map<int, UploadFileInfo*> UploadFileInfoMap; | 134 typedef std::map<int, UploadFileInfo*> UploadFileInfoMap; |
135 UploadFileInfoMap pending_uploads_; | 135 UploadFileInfoMap pending_uploads_; |
136 | 136 |
137 // Factory for various callbacks. | 137 // Note: This should remain the last member so it'll be destroyed and |
138 base::WeakPtrFactory<GDataUploader> uploader_factory_; | 138 // invalidate its weak pointers before any other members are destroyed. |
| 139 base::WeakPtrFactory<GDataUploader> weak_ptr_factory_; |
139 | 140 |
140 DISALLOW_COPY_AND_ASSIGN(GDataUploader); | 141 DISALLOW_COPY_AND_ASSIGN(GDataUploader); |
141 }; | 142 }; |
142 | 143 |
143 } // namespace gdata | 144 } // namespace gdata |
144 | 145 |
145 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ | 146 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ |
OLD | NEW |