Index: chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc |
diff --git a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc |
index 536a60074be6252414435bdc72c781d264d555d9..e62bd106b42ad4e1d57739dc02b252af24bb9f83 100644 |
--- a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc |
+++ b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc |
@@ -4,6 +4,7 @@ |
// found in the LICENSE file. |
#include "base/lazy_instance.h" |
+#include "base/message_loop/message_loop.h" |
#include "chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h" |
#include "content/public/browser/browser_thread.h" |
@@ -15,23 +16,15 @@ static base::LazyInstance<scoped_refptr<StorageDeviceList> > g_test_device_list; |
// TODO(haven): Udev code may be duplicated in the Chrome codebase. |
// https://code.google.com/p/chromium/issues/detail?id=284898 |
-void RemovableStorageProvider::GetAllDevices(DeviceListReadyCallback callback) { |
+void RemovableStorageProvider::GetAllDevices( |
+ const DeviceListReadyCallback& callback) { |
if (g_test_device_list.Get() != NULL) { |
- content::BrowserThread::PostTask( |
- content::BrowserThread::FILE, |
- FROM_HERE, |
- base::Bind(callback, g_test_device_list.Get(), true)); |
+ base::MessageLoop::current()->PostTask( |
+ FROM_HERE, base::Bind(callback, g_test_device_list.Get(), true)); |
return; |
} |
- scoped_refptr<StorageDeviceList> device_list(new StorageDeviceList); |
- |
- // We need to do some file i/o to get the device block size |
- content::BrowserThread::PostTaskAndReplyWithResult( |
- content::BrowserThread::FILE, |
- FROM_HERE, |
- base::Bind(PopulateDeviceList, device_list), |
- base::Bind(callback, device_list)); |
+ GetAllDevicesImpl(callback); |
} |
void RemovableStorageProvider::SetDeviceListForTesting( |