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_DOWNLOAD_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H__ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H__ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/platform_file.h" | 12 #include "base/platform_file.h" |
13 #include "content/public/browser/download_item.h" | 13 #include "content/public/browser/download_item.h" |
14 #include "content/public/browser/download_manager.h" | 14 #include "content/public/browser/download_manager.h" |
15 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" | 15 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" |
16 | 16 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // Observe the DownloadManager for new downloads. | 148 // Observe the DownloadManager for new downloads. |
149 content::DownloadManager* download_manager_; | 149 content::DownloadManager* download_manager_; |
150 | 150 |
151 // Temporary download location directory. | 151 // Temporary download location directory. |
152 FilePath gdata_tmp_download_path_; | 152 FilePath gdata_tmp_download_path_; |
153 | 153 |
154 // Map of pending downloads. | 154 // Map of pending downloads. |
155 typedef std::map<int32, content::DownloadItem*> DownloadMap; | 155 typedef std::map<int32, content::DownloadItem*> DownloadMap; |
156 DownloadMap pending_downloads_; | 156 DownloadMap pending_downloads_; |
157 | 157 |
158 // Note: This should remain the last member so it'll be destroyed and | |
159 // invalidate its weak pointers before any other members are destroyed. | |
160 base::WeakPtrFactory<GDataDownloadObserver> weak_ptr_factory_; | 158 base::WeakPtrFactory<GDataDownloadObserver> weak_ptr_factory_; |
161 | 159 |
162 DISALLOW_COPY_AND_ASSIGN(GDataDownloadObserver); | 160 DISALLOW_COPY_AND_ASSIGN(GDataDownloadObserver); |
163 }; | 161 }; |
164 | 162 |
165 } // namespace gdata | 163 } // namespace gdata |
166 | 164 |
167 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H_ | 165 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H__ |
OLD | NEW |