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

Unified Diff: webkit/fileapi/file_system_operation_context.h

Issue 11358243: Redesigned and refactored ScopedMTPDeviceMapEntry, MTPDeviceMapService & MTPDeviceDelegate classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 1 month 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: 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 067e0d8886b81dd64345fd19e3767233c92b8e7e..aaf2b4e5c812fb48f9745ffc2110709feedf1d87 100644
--- a/webkit/fileapi/file_system_operation_context.h
+++ b/webkit/fileapi/file_system_operation_context.h
@@ -6,6 +6,7 @@
#define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/media/mtp_device_file_system_config.h"
#include "webkit/fileapi/task_runner_bound_observer_list.h"
@@ -39,11 +40,11 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemOperationContext {
#if defined(SUPPORT_MTP_DEVICE_FILESYSTEM)
void set_mtp_device_delegate(MTPDeviceDelegate* delegate) {
- mtp_device_delegate_ = delegate;
+ mtp_device_delegate_ = delegate->GetAsWeakPtrOnIOThread();
}
- MTPDeviceDelegate* mtp_device_delegate() const {
- return mtp_device_delegate_.get();
+ base::WeakPtr<MTPDeviceDelegate> mtp_device_delegate() const {
kinuko 2012/11/15 10:23:39 I'm afraid this weakptr is created on IO thread bu
kmadhusu 2012/11/15 17:52:24 Can you please provide more details on how this ca
+ return mtp_device_delegate_;
}
#endif
@@ -92,7 +93,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_;
+ base::WeakPtr<MTPDeviceDelegate> mtp_device_delegate_;
#endif
};

Powered by Google App Engine
This is Rietveld 408576698