Chromium Code Reviews| 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..3c829fe42281092b98a277e492418da03d20e242 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::NotifyFileSystemToBeUnmounted() { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| + |
| + DVLOG(1) << "File System is getting unmounted"; |
|
satorux1
2012/08/03 18:21:14
is to be unmounted
yoshiki
2012/08/03 20:10:31
Done.
|
| + // 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, |