Index: chrome/browser/chromeos/gdata/gdata_file_system.cc |
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc |
index 949ca502c72fbfceca97db5ae5b43830ffc99bac..8450e3208e5a15edc9ad55f9548af8b077fac0cb 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc |
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc |
@@ -849,9 +849,16 @@ void GDataFileSystem::StartUpdates() { |
} |
void GDataFileSystem::StopUpdates() { |
+ // If unmount request comes from filesystem side, this method may be called |
+ // twice. First is just after unmounting on filesystem, second is after |
+ // unmounting on filemanager on JS. In other words, if this is called from |
+ // GDataSystemService::RemoveDriveMountPoint(), this will be called again from |
+ // FileBrowserEventRouter::HandleRemoteUpdateRequestOnUIThread(). |
+ // We choose to stopping updates asynchronous without waiting for filemanager, |
+ // rather than waiting for completion of unmounting on filemanager. |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- DCHECK(update_timer_.IsRunning()); |
- update_timer_.Stop(); |
+ if (update_timer_.IsRunning()) |
+ update_timer_.Stop(); |
} |
void GDataFileSystem::GetEntryInfoByResourceId( |
@@ -3382,6 +3389,24 @@ void GDataFileSystem::RemoveStaleEntryOnUpload(const std::string& resource_id, |
} |
} |
+void GDataFileSystem::NotifyFileSystemMounted() { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ |
+ DVLOG(1) << "File System is mounted"; |
+ // Notify the observers that the file system is mounted. |
+ FOR_EACH_OBSERVER(GDataFileSystemInterface::Observer, observers_, |
+ OnFileSystemMounted()); |
+} |
+ |
+void GDataFileSystem::NotifyFileSystemUnmounting() { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ |
+ DVLOG(1) << "File System is getting unmounted"; |
+ // Notify the observers that the file system is getting unmounted. |
+ FOR_EACH_OBSERVER(GDataFileSystemInterface::Observer, observers_, |
+ OnFileSystemUnmounting()); |
+} |
+ |
void GDataFileSystem::RunAndNotifyInitialLoadFinished( |
const FindEntryCallback& callback, |
GDataFileError error, |