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

Unified Diff: chrome/browser/chromeos/cros/mount_library.cc

Issue 6674015: Added mount change notification callback: chrome.fileSystem.onChanged... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/usb_mount_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros/mount_library.cc
===================================================================
--- chrome/browser/chromeos/cros/mount_library.cc (revision 79456)
+++ chrome/browser/chromeos/cros/mount_library.cc (working copy)
@@ -11,6 +11,8 @@
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "content/browser/browser_thread.h"
+const char* kLibraryNotLoaded = "Cros Library has not been loaded";
+
namespace chromeos {
class MountLibraryImpl : public MountLibrary {
@@ -19,7 +21,7 @@
if (CrosLibrary::Get()->EnsureLoaded())
Init();
else
- LOG(ERROR) << "Cros Library has not been loaded";
+ LOG(ERROR) << kLibraryNotLoaded;
}
virtual ~MountLibraryImpl() {
@@ -37,24 +39,55 @@
}
virtual void MountPath(const char* device_path) OVERRIDE {
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (!CrosLibrary::Get()->EnsureLoaded()) {
+ OnMountRemovableDevice(device_path,
+ NULL,
+ MOUNT_METHOD_ERROR_NOT_LOADED,
+ kLibraryNotLoaded);
+ return;
+ }
MountRemovableDevice(device_path,
&MountLibraryImpl::MountRemovableDeviceCallback,
this);
}
virtual void UnmountPath(const char* device_path) OVERRIDE {
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (!CrosLibrary::Get()->EnsureLoaded()) {
+ OnUnmountRemovableDevice(device_path,
+ MOUNT_METHOD_ERROR_NOT_LOADED,
+ kLibraryNotLoaded);
+ return;
+ }
UnmountRemovableDevice(device_path,
&MountLibraryImpl::UnmountRemovableDeviceCallback,
this);
}
virtual void RequestMountInfoRefresh() OVERRIDE {
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (!CrosLibrary::Get()->EnsureLoaded()) {
+ OnRequestMountInfo(NULL,
+ 0,
+ MOUNT_METHOD_ERROR_NOT_LOADED,
+ kLibraryNotLoaded);
+ return;
+ }
RequestMountInfo(&MountLibraryImpl::RequestMountInfoCallback,
this);
}
virtual void RefreshDiskProperties(const Disk* disk) OVERRIDE {
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(disk);
+ if (!CrosLibrary::Get()->EnsureLoaded()) {
+ OnGetDiskProperties(disk->device_path().c_str(),
+ NULL,
+ MOUNT_METHOD_ERROR_NOT_LOADED,
+ kLibraryNotLoaded);
+ return;
+ }
GetDiskProperties(disk->device_path().c_str(),
&MountLibraryImpl::GetDiskPropertiesCallback,
this);
« no previous file with comments | « no previous file | chrome/browser/chromeos/usb_mount_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698