Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4252)

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system.cc

Issue 10834115: Drive: Mount/Unmount GoogleDrive on Files App when the file system is mounted/unmounted. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove unused methods in mock_gdata_file_system.h Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5074f40d159b3817a1adeb7ac466fb5ecee7e188 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 to be unmounted";
+ // Notify the observers that the file system is being unmounted.
+ FOR_EACH_OBSERVER(GDataFileSystemInterface::Observer, observers_,
+ OnFileSystemBeingUnmounted());
+}
+
void GDataFileSystem::RunAndNotifyInitialLoadFinished(
const FindEntryCallback& callback,
GDataFileError error,
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.h ('k') | chrome/browser/chromeos/gdata/gdata_file_system_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698