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

Unified Diff: chrome/browser/chromeos/mtp/media_transfer_protocol_manager.cc

Issue 10913048: CrOS: Convert MediaTransferProtocolDaemonClient to use protobufs. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: address comments Created 8 years, 3 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 | « chrome/browser/chromeos/mtp/media_transfer_protocol_manager.h ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/mtp/media_transfer_protocol_manager.cc
===================================================================
--- chrome/browser/chromeos/mtp/media_transfer_protocol_manager.cc (revision 155895)
+++ chrome/browser/chromeos/mtp/media_transfer_protocol_manager.cc (working copy)
@@ -14,6 +14,8 @@
#include "base/observer_list.h"
#include "base/stl_util.h"
#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/mtp_file_entry.pb.h"
+#include "chromeos/dbus/mtp_storage_info.pb.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
@@ -68,7 +70,7 @@
}
// MediaTransferProtocolManager override.
- virtual const StorageInfo* GetStorageInfo(
+ virtual const MtpStorageInfo* GetStorageInfo(
const std::string& storage_name) const OVERRIDE {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
StorageInfoMap::const_iterator it = storage_info_map_.find(storage_name);
@@ -120,7 +122,7 @@
const ReadDirectoryCallback& callback) OVERRIDE {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!ContainsKey(handles_, storage_handle)) {
- callback.Run(std::vector<FileEntry>(), true);
+ callback.Run(std::vector<MtpFileEntry>(), true);
return;
}
read_directory_callbacks_.push(callback);
@@ -140,7 +142,7 @@
const ReadDirectoryCallback& callback) OVERRIDE {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!ContainsKey(handles_, storage_handle)) {
- callback.Run(std::vector<FileEntry>(), true);
+ callback.Run(std::vector<MtpFileEntry>(), true);
return;
}
read_directory_callbacks_.push(callback);
@@ -196,7 +198,7 @@
const GetFileInfoCallback& callback) OVERRIDE {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!ContainsKey(handles_, storage_handle)) {
- callback.Run(FileEntry(), true);
+ callback.Run(MtpFileEntry(), true);
return;
}
get_file_info_callbacks_.push(callback);
@@ -214,7 +216,7 @@
const GetFileInfoCallback& callback) OVERRIDE {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!ContainsKey(handles_, storage_handle)) {
- callback.Run(FileEntry(), true);
+ callback.Run(MtpFileEntry(), true);
return;
}
get_file_info_callbacks_.push(callback);
@@ -229,7 +231,7 @@
private:
// Map of storage names to storage info.
- typedef std::map<std::string, StorageInfo> StorageInfoMap;
+ typedef std::map<std::string, MtpStorageInfo> StorageInfoMap;
// Callback queues - DBus communication is in-order, thus callbacks are
// received in the same order as the requests.
typedef std::queue<OpenStorageCallback> OpenStorageCallbackQueue;
@@ -274,7 +276,7 @@
}
}
- void OnGetStorageInfo(const StorageInfo& storage_info) {
+ void OnGetStorageInfo(const MtpStorageInfo& storage_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
const std::string& storage_name = storage_info.storage_name();
if (ContainsKey(storage_info_map_, storage_name)) {
@@ -328,13 +330,13 @@
close_storage_callbacks_.pop();
}
- void OnReadDirectory(const std::vector<FileEntry>& file_entries) {
+ void OnReadDirectory(const std::vector<MtpFileEntry>& file_entries) {
read_directory_callbacks_.front().Run(file_entries, false);
read_directory_callbacks_.pop();
}
void OnReadDirectoryError() {
- read_directory_callbacks_.front().Run(std::vector<FileEntry>(), true);
+ read_directory_callbacks_.front().Run(std::vector<MtpFileEntry>(), true);
read_directory_callbacks_.pop();
}
@@ -348,13 +350,13 @@
read_file_callbacks_.pop();
}
- void OnGetFileInfo(const FileEntry& entry) {
+ void OnGetFileInfo(const MtpFileEntry& entry) {
get_file_info_callbacks_.front().Run(entry, false);
get_file_info_callbacks_.pop();
}
void OnGetFileInfoError() {
- get_file_info_callbacks_.front().Run(FileEntry(), true);
+ get_file_info_callbacks_.front().Run(MtpFileEntry(), true);
get_file_info_callbacks_.pop();
}
« no previous file with comments | « chrome/browser/chromeos/mtp/media_transfer_protocol_manager.h ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698