Index: chrome/browser/chromeos/gdata/gdata_file_system.h |
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.h b/chrome/browser/chromeos/gdata/gdata_file_system.h |
index caca8b58af795a6140c2c5e7cba9409b6d4e6afe..e5e6045502964a512bff7e7ca61e165f7fa28883 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_file_system.h |
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.h |
@@ -874,13 +874,17 @@ class GDataFileSystem : public GDataFileSystemInterface, |
scoped_ptr<PrefChangeRegistrar> pref_registrar_; |
- // WeakPtrFactory and WeakPtr bound to the UI thread. |
- base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
- base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
- |
ObserverList<Observer> observers_; |
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
+ |
+ // WeakPtrFactory and WeakPtr bound to the UI thread. |
+ // Note: These should remain the last member so they'll be destroyed and |
+ // invalidate the weak pointers before any other members are destroyed. |
+ base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
+ // Unlike other classes, we need this as we need this to redirect a task |
+ // from IO thread to UI thread. |
+ base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
}; |
} // namespace gdata |