diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-17 21:33:35 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-17 21:33:35 +0000 |
commit | aa0b33eda7f49c544a973b5acd8f9f0611d7e765 (patch) | |
tree | 98a598e8732046d497b3795287dc8d2dd389577f /webkit/plugins/ppapi/ppb_file_io_impl.cc | |
parent | 28f3c9251dace27b202d71203756fecbbe3cbc15 (diff) | |
download | chromium_src-aa0b33eda7f49c544a973b5acd8f9f0611d7e765.zip chromium_src-aa0b33eda7f49c544a973b5acd8f9f0611d7e765.tar.gz chromium_src-aa0b33eda7f49c544a973b5acd8f9f0611d7e765.tar.bz2 |
base::Bind: Convert FileUtilProxy::StatusCallback.
BUG=none
TEST=none
R=csilv@chromium.org
Review URL: http://codereview.chromium.org/8318025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_file_io_impl.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_io_impl.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/webkit/plugins/ppapi/ppb_file_io_impl.cc b/webkit/plugins/ppapi/ppb_file_io_impl.cc index 62c4715..5ba1a74 100644 --- a/webkit/plugins/ppapi/ppb_file_io_impl.cc +++ b/webkit/plugins/ppapi/ppb_file_io_impl.cc @@ -51,7 +51,6 @@ PPB_FileIO_Impl::CallbackEntry::~CallbackEntry() { PPB_FileIO_Impl::PPB_FileIO_Impl(PP_Instance instance) : Resource(instance), - ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), file_(base::kInvalidPlatformFileValue), file_system_type_(PP_FILESYSTEMTYPE_INVALID), @@ -156,7 +155,8 @@ int32_t PPB_FileIO_Impl::Touch(PP_Time last_access_time, plugin_delegate->GetFileThreadMessageLoopProxy(), file_, PPTimeToTime(last_access_time), PPTimeToTime(last_modified_time), - callback_factory_.NewCallback(&PPB_FileIO_Impl::StatusCallback))) + base::Bind(&PPB_FileIO_Impl::StatusCallback, + weak_factory_.GetWeakPtr()))) return PP_ERROR_FAILED; RegisterCallback(OPERATION_EXCLUSIVE, callback, NULL); @@ -230,13 +230,14 @@ int32_t PPB_FileIO_Impl::SetLength(int64_t length, if (quota_file_io_.get()) { if (!quota_file_io_->SetLength( length, - callback_factory_.NewCallback(&PPB_FileIO_Impl::StatusCallback))) + base::Bind(&PPB_FileIO_Impl::StatusCallback, + weak_factory_.GetWeakPtr()))) return PP_ERROR_FAILED; } else { if (!base::FileUtilProxy::Truncate( - plugin_delegate->GetFileThreadMessageLoopProxy(), - file_, length, - callback_factory_.NewCallback(&PPB_FileIO_Impl::StatusCallback))) + plugin_delegate->GetFileThreadMessageLoopProxy(), file_, length, + base::Bind(&PPB_FileIO_Impl::StatusCallback, + weak_factory_.GetWeakPtr()))) return PP_ERROR_FAILED; } @@ -255,7 +256,8 @@ int32_t PPB_FileIO_Impl::Flush(PP_CompletionCallback callback) { if (!base::FileUtilProxy::Flush( plugin_delegate->GetFileThreadMessageLoopProxy(), file_, - callback_factory_.NewCallback(&PPB_FileIO_Impl::StatusCallback))) + base::Bind(&PPB_FileIO_Impl::StatusCallback, + weak_factory_.GetWeakPtr()))) return PP_ERROR_FAILED; RegisterCallback(OPERATION_EXCLUSIVE, callback, NULL); @@ -266,7 +268,8 @@ void PPB_FileIO_Impl::Close() { PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); if (file_ != base::kInvalidPlatformFileValue && plugin_delegate) { base::FileUtilProxy::Close( - plugin_delegate->GetFileThreadMessageLoopProxy(), file_, NULL); + plugin_delegate->GetFileThreadMessageLoopProxy(), file_, + base::FileUtilProxy::StatusCallback()); file_ = base::kInvalidPlatformFileValue; quota_file_io_.reset(); } @@ -313,7 +316,8 @@ int32_t PPB_FileIO_Impl::WillSetLength(int64_t length, if (!quota_file_io_->WillSetLength( length, - callback_factory_.NewCallback(&PPB_FileIO_Impl::StatusCallback))) + base::Bind(&PPB_FileIO_Impl::StatusCallback, + weak_factory_.GetWeakPtr()))) return PP_ERROR_FAILED; RegisterCallback(OPERATION_EXCLUSIVE, callback, NULL); |