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

Unified Diff: chrome/browser/system_monitor/removable_device_notifications_window_win.cc

Issue 11297002: [Media Gallery] Added code to support mtp device media file system on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed DCHECK, added lock in PortableDeviceWatcherWin and fixed tests. Created 8 years 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/system_monitor/removable_device_notifications_window_win.cc
diff --git a/chrome/browser/system_monitor/removable_device_notifications_window_win.cc b/chrome/browser/system_monitor/removable_device_notifications_window_win.cc
index 210a672df96f2b1702f8d29b02cbc2f17d7ac38a..a52e0e2f3fb5d0ed156a904725d76ede6a7ca684 100644
--- a/chrome/browser/system_monitor/removable_device_notifications_window_win.cc
+++ b/chrome/browser/system_monitor/removable_device_notifications_window_win.cc
@@ -8,11 +8,13 @@
#include <dbt.h>
#include <fileapi.h>
+#include "base/threading/sequenced_worker_pool.h"
#include "base/win/wrapped_window_proc.h"
#include "chrome/browser/system_monitor/media_storage_util.h"
#include "chrome/browser/system_monitor/portable_device_watcher_win.h"
#include "chrome/browser/system_monitor/removable_device_constants.h"
#include "chrome/browser/system_monitor/volume_mount_watcher_win.h"
+#include "content/public/browser/browser_thread.h"
namespace chrome {
@@ -132,6 +134,18 @@ uint64 RemovableDeviceNotificationsWindowWin::GetStorageSize(
return 0ULL;
}
+bool RemovableDeviceNotificationsWindowWin::GetMTPStorageInfoFromDeviceId(
+ const std::string& storage_device_id,
+ string16* device_location,
+ string16* storage_object_id) const {
+ DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
Peter Kasting 2012/12/21 18:13:30 Doesn't the rest of this class run on the UI threa
kmadhusu 2013/01/02 19:48:31 I thought about this. There is a small chance of d
+ MediaStorageUtil::Type type;
+ MediaStorageUtil::CrackDeviceId(storage_device_id, &type, NULL);
+ return ((type == MediaStorageUtil::MTP_OR_PTP) &&
+ portable_device_watcher_->GetMTPStorageInfoFromDeviceId(
+ storage_device_id, device_location, storage_object_id));
+}
+
// static
LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProcThunk(
HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) {

Powered by Google App Engine
This is Rietveld 408576698