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

Unified Diff: webkit/plugins/ppapi/ppb_file_io_impl.cc

Issue 10541113: Notify CloseFile from Pepper to FileSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 5 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 | « webkit/plugins/ppapi/ppb_file_io_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_file_io_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_file_io_impl.cc b/webkit/plugins/ppapi/ppb_file_io_impl.cc
index d1022709bbf48801b1fad183f63527e9f8349f14..df4d86bf5d24382370ded35cab48b7ac37f47b7b 100644
--- a/webkit/plugins/ppapi/ppb_file_io_impl.cc
+++ b/webkit/plugins/ppapi/ppb_file_io_impl.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/file_util.h"
#include "base/file_util_proxy.h"
#include "base/message_loop_proxy.h"
@@ -64,8 +65,9 @@ int32_t PPB_FileIO_Impl::OpenValidated(
file_system_url_ = file_ref->GetFileSystemURL();
if (!plugin_delegate->AsyncOpenFileSystemURL(
file_system_url_, flags,
- base::Bind(&PPB_FileIO_Impl::ExecutePlatformOpenFileCallback,
- weak_factory_.GetWeakPtr())))
+ base::Bind(
+ &PPB_FileIO_Impl::ExecutePlatformOpenFileSystemURLCallback,
+ weak_factory_.GetWeakPtr())))
return PP_ERROR_FAILED;
} else {
if (file_system_type_ != PP_FILESYSTEMTYPE_EXTERNAL)
@@ -211,8 +213,9 @@ void PPB_FileIO_Impl::Close() {
PluginDelegate* plugin_delegate = GetPluginDelegate();
if (file_ != base::kInvalidPlatformFileValue && plugin_delegate) {
base::FileUtilProxy::Close(
- plugin_delegate->GetFileThreadMessageLoopProxy(), file_,
- base::FileUtilProxy::StatusCallback());
+ plugin_delegate->GetFileThreadMessageLoopProxy(),
+ file_,
+ base::ResetAndReturn(&notify_close_file_callback_));
file_ = base::kInvalidPlatformFileValue;
quota_file_io_.reset();
}
@@ -294,6 +297,15 @@ void PPB_FileIO_Impl::ExecutePlatformOpenFileCallback(
ExecuteOpenFileCallback(::ppapi::PlatformFileErrorToPepperError(error_code));
}
+void PPB_FileIO_Impl::ExecutePlatformOpenFileSystemURLCallback(
+ base::PlatformFileError error_code,
+ base::PassPlatformFile file,
+ const PluginDelegate::NotifyCloseFileCallback& callback) {
+ if (error_code == base::PLATFORM_FILE_OK)
+ notify_close_file_callback_ = callback;
+ ExecutePlatformOpenFileCallback(error_code, file);
+}
+
void PPB_FileIO_Impl::ExecutePlatformQueryCallback(
base::PlatformFileError error_code,
const base::PlatformFileInfo& file_info) {
« no previous file with comments | « webkit/plugins/ppapi/ppb_file_io_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698