summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/fileapi/file_system_operation_context.h6
-rw-r--r--webkit/fileapi/isolated_mount_point_provider.cc8
-rw-r--r--webkit/fileapi/media/mtp_device_delegate.h31
-rw-r--r--webkit/fileapi/media/mtp_device_map_service.cc16
-rw-r--r--webkit/fileapi/media/mtp_device_map_service.h24
5 files changed, 43 insertions, 42 deletions
diff --git a/webkit/fileapi/file_system_operation_context.h b/webkit/fileapi/file_system_operation_context.h
index b376b21..067e0d8 100644
--- a/webkit/fileapi/file_system_operation_context.h
+++ b/webkit/fileapi/file_system_operation_context.h
@@ -38,11 +38,11 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemOperationContext {
int64 allowed_bytes_growth() const { return allowed_bytes_growth_; }
#if defined(SUPPORT_MTP_DEVICE_FILESYSTEM)
- void set_mtp_device_delegate(MtpDeviceDelegate* delegate) {
+ void set_mtp_device_delegate(MTPDeviceDelegate* delegate) {
mtp_device_delegate_ = delegate;
}
- MtpDeviceDelegate* mtp_device_delegate() const {
+ MTPDeviceDelegate* mtp_device_delegate() const {
return mtp_device_delegate_.get();
}
#endif
@@ -92,7 +92,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemOperationContext {
#if defined(SUPPORT_MTP_DEVICE_FILESYSTEM)
// Store the current mtp device delegate.
- scoped_refptr<MtpDeviceDelegate> mtp_device_delegate_;
+ scoped_refptr<MTPDeviceDelegate> mtp_device_delegate_;
#endif
};
diff --git a/webkit/fileapi/isolated_mount_point_provider.cc b/webkit/fileapi/isolated_mount_point_provider.cc
index 2554edc..a11731d 100644
--- a/webkit/fileapi/isolated_mount_point_provider.cc
+++ b/webkit/fileapi/isolated_mount_point_provider.cc
@@ -123,16 +123,16 @@ FileSystemOperation* IsolatedMountPointProvider::CreateFileSystemOperation(
#if defined(SUPPORT_MTP_DEVICE_FILESYSTEM)
if (url.type() == kFileSystemTypeDeviceMedia) {
- MtpDeviceMapService* map_service = MtpDeviceMapService::GetInstance();
- MtpDeviceDelegate* device_delegate =
- map_service->GetMtpDeviceDelegate(url.filesystem_id());
+ MTPDeviceMapService* map_service = MTPDeviceMapService::GetInstance();
+ MTPDeviceDelegate* device_delegate =
+ map_service->GetMTPDeviceDelegate(url.filesystem_id());
if (!device_delegate) {
if (error_code)
*error_code = base::PLATFORM_FILE_ERROR_NOT_FOUND;
return NULL;
}
operation_context->set_mtp_device_delegate(device_delegate);
- operation_context->set_task_runner(device_delegate->media_task_runner());
+ operation_context->set_task_runner(device_delegate->GetMediaTaskRunner());
operation_context->set_media_path_filter(media_path_filter_.get());
}
#endif
diff --git a/webkit/fileapi/media/mtp_device_delegate.h b/webkit/fileapi/media/mtp_device_delegate.h
index a90fb61..5c031d2 100644
--- a/webkit/fileapi/media/mtp_device_delegate.h
+++ b/webkit/fileapi/media/mtp_device_delegate.h
@@ -7,6 +7,7 @@
#include "base/file_path.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/platform_file.h"
#include "base/sequenced_task_runner_helpers.h"
#include "webkit/fileapi/file_system_file_util.h"
@@ -19,14 +20,14 @@ class Time;
namespace fileapi {
-struct MtpDeviceDelegateDeleter;
+struct MTPDeviceDelegateDeleter;
-// Delegate for mtp device to perform media device isolated file system
-// operations. Class that implements this delegate does the actual communication
-// with the mtp device.
-class MtpDeviceDelegate
- : public base::RefCountedThreadSafe<MtpDeviceDelegate,
- MtpDeviceDelegateDeleter> {
+// Delegate for media transfer protocol (MTP_ device to perform media device
+// isolated file system operations. Class that implements this delegate does
+// the actual communication with the MTP device.
+class MTPDeviceDelegate
+ : public base::RefCountedThreadSafe<MTPDeviceDelegate,
+ MTPDeviceDelegateDeleter> {
public:
// Returns information about the given file path.
virtual base::PlatformFileError GetFileInfo(
@@ -50,23 +51,23 @@ class MtpDeviceDelegate
base::PlatformFileInfo* file_info) = 0;
// Returns TaskRunner on which the operation is performed.
- virtual base::SequencedTaskRunner* media_task_runner() = 0;
+ virtual base::SequencedTaskRunner* GetMediaTaskRunner() = 0;
// Helper function to destruct the delegate object on UI thread.
virtual void DeleteOnCorrectThread() const = 0;
protected:
- virtual ~MtpDeviceDelegate() {}
+ virtual ~MTPDeviceDelegate() {}
private:
- friend struct MtpDeviceDelegateDeleter;
- friend class base::DeleteHelper<MtpDeviceDelegate>;
- friend class base::RefCountedThreadSafe<MtpDeviceDelegate,
- MtpDeviceDelegateDeleter>;
+ friend struct MTPDeviceDelegateDeleter;
+ friend class base::DeleteHelper<MTPDeviceDelegate>;
+ friend class base::RefCountedThreadSafe<MTPDeviceDelegate,
+ MTPDeviceDelegateDeleter>;
};
-struct MtpDeviceDelegateDeleter {
- static void Destruct(const MtpDeviceDelegate* delegate) {
+struct MTPDeviceDelegateDeleter {
+ static void Destruct(const MTPDeviceDelegate* delegate) {
delegate->DeleteOnCorrectThread();
}
};
diff --git a/webkit/fileapi/media/mtp_device_map_service.cc b/webkit/fileapi/media/mtp_device_map_service.cc
index 1dee157..68bf3d4 100644
--- a/webkit/fileapi/media/mtp_device_map_service.cc
+++ b/webkit/fileapi/media/mtp_device_map_service.cc
@@ -14,13 +14,13 @@
namespace fileapi {
// static
-MtpDeviceMapService* MtpDeviceMapService::GetInstance() {
- return Singleton<MtpDeviceMapService>::get();
+MTPDeviceMapService* MTPDeviceMapService::GetInstance() {
+ return Singleton<MTPDeviceMapService>::get();
}
-void MtpDeviceMapService::AddDelegate(
+void MTPDeviceMapService::AddDelegate(
const FilePath::StringType& device_location,
- scoped_refptr<MtpDeviceDelegate> delegate) {
+ scoped_refptr<MTPDeviceDelegate> delegate) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(delegate.get());
DCHECK(!device_location.empty());
@@ -31,7 +31,7 @@ void MtpDeviceMapService::AddDelegate(
delegate_map_[device_location] = delegate;
}
-void MtpDeviceMapService::RemoveDelegate(
+void MTPDeviceMapService::RemoveDelegate(
const FilePath::StringType& device_location) {
DCHECK(thread_checker_.CalledOnValidThread());
DelegateMap::iterator it = delegate_map_.find(device_location);
@@ -39,7 +39,7 @@ void MtpDeviceMapService::RemoveDelegate(
delegate_map_.erase(it);
}
-MtpDeviceDelegate* MtpDeviceMapService::GetMtpDeviceDelegate(
+MTPDeviceDelegate* MTPDeviceMapService::GetMTPDeviceDelegate(
const std::string& filesystem_id) {
DCHECK(thread_checker_.CalledOnValidThread());
FilePath device_path;
@@ -56,12 +56,12 @@ MtpDeviceDelegate* MtpDeviceMapService::GetMtpDeviceDelegate(
return it->second.get();
}
-MtpDeviceMapService::MtpDeviceMapService() {
+MTPDeviceMapService::MTPDeviceMapService() {
// This object is constructed on UI Thread but the member functions are
// accessed on IO thread. Therefore, detach from current thread.
thread_checker_.DetachFromThread();
}
-MtpDeviceMapService::~MtpDeviceMapService() {}
+MTPDeviceMapService::~MTPDeviceMapService() {}
} // namespace fileapi
diff --git a/webkit/fileapi/media/mtp_device_map_service.h b/webkit/fileapi/media/mtp_device_map_service.h
index 1b1ffd9..3002097 100644
--- a/webkit/fileapi/media/mtp_device_map_service.h
+++ b/webkit/fileapi/media/mtp_device_map_service.h
@@ -15,18 +15,18 @@
namespace fileapi {
-class MtpDeviceDelegate;
+class MTPDeviceDelegate;
// Helper class to manage media device delegates which can communicate with mtp
// devices to complete media file system operations.
-class WEBKIT_STORAGE_EXPORT MtpDeviceMapService {
+class WEBKIT_STORAGE_EXPORT MTPDeviceMapService {
public:
- static MtpDeviceMapService* GetInstance();
+ static MTPDeviceMapService* GetInstance();
// Adds the media device delegate for the given |device_location|. Called on
// IO thread.
void AddDelegate(const FilePath::StringType& device_location,
- scoped_refptr<MtpDeviceDelegate> delegate);
+ scoped_refptr<MTPDeviceDelegate> delegate);
// Removes the media device delegate for the given |device_location| if
// exists. Called on IO thread.
@@ -35,19 +35,19 @@ class WEBKIT_STORAGE_EXPORT MtpDeviceMapService {
// Gets the media device delegate associated with |filesystem_id|.
// Return NULL if the |filesystem_id| is no longer valid (e.g. because the
// corresponding device is detached etc). Called on IO thread.
- MtpDeviceDelegate* GetMtpDeviceDelegate(const std::string& filesystem_id);
+ MTPDeviceDelegate* GetMTPDeviceDelegate(const std::string& filesystem_id);
private:
- friend struct DefaultSingletonTraits<MtpDeviceMapService>;
+ friend struct DefaultSingletonTraits<MTPDeviceMapService>;
- typedef scoped_refptr<MtpDeviceDelegate> MtpDeviceDelegateObj;
+ typedef scoped_refptr<MTPDeviceDelegate> MTPDeviceDelegateObj;
- // Mapping of device_location and MtpDeviceDelegate object.
- typedef std::map<FilePath::StringType, MtpDeviceDelegateObj> DelegateMap;
+ // Mapping of device_location and MTPDeviceDelegate object.
+ typedef std::map<FilePath::StringType, MTPDeviceDelegateObj> DelegateMap;
// Get access to this class using GetInstance() method.
- MtpDeviceMapService();
- ~MtpDeviceMapService();
+ MTPDeviceMapService();
+ ~MTPDeviceMapService();
// Stores a map of attached mtp device delegates.
DelegateMap delegate_map_;
@@ -56,7 +56,7 @@ class WEBKIT_STORAGE_EXPORT MtpDeviceMapService {
// called on same thread.
base::ThreadChecker thread_checker_;
- DISALLOW_COPY_AND_ASSIGN(MtpDeviceMapService);
+ DISALLOW_COPY_AND_ASSIGN(MTPDeviceMapService);
};
} // namespace fileapi