From 0c04ab11c5d3d24fef53ad968547b15441247f02 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Thu, 13 Dec 2012 09:25:14 +0000 Subject: Media Galleries: Simplify the MTP delegates so they mostly live on one thread. Review URL: https://chromiumcodereview.appspot.com/11474017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172845 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/fileapi/file_system_operation_context.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'webkit/fileapi/file_system_operation_context.h') diff --git a/webkit/fileapi/file_system_operation_context.h b/webkit/fileapi/file_system_operation_context.h index 9c9c59a..0c79629 100644 --- a/webkit/fileapi/file_system_operation_context.h +++ b/webkit/fileapi/file_system_operation_context.h @@ -39,16 +39,14 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemOperationContext { int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) - // Called on IO thread. - void set_mtp_device_delegate( - const base::WeakPtr& delegate) { - mtp_device_delegate_ = delegate; + // Initializes |mtp_device_delegate_url_| on the IO thread. + void set_mtp_device_delegate_url(const std::string& delegate_url) { + mtp_device_delegate_url_ = delegate_url; } - // Caller of this function should dereference the delegate only on media - // sequenced task runner thread. - base::WeakPtr mtp_device_delegate() const { - return mtp_device_delegate_; + // Reads |mtp_device_delegate_url_| on |task_runner_|. + const std::string& mtp_device_delegate_url() const { + return mtp_device_delegate_url_; } #endif @@ -96,9 +94,9 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemOperationContext { UpdateObserverList update_observers_; #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) - // The media transfer protocol (MTP) device delegate. - // Set on IO thread and dereferenced on media sequenced task runner thread. - base::WeakPtr mtp_device_delegate_; + // URL for the media transfer protocol (MTP) device delegate. + // Initialized on IO thread and used on |task_runner_|. + std::string mtp_device_delegate_url_; #endif }; -- cgit v1.1