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

Unified Diff: content/renderer/pepper/pepper_file_io_host.cc

Issue 13726024: Refactor FileSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NON_EXPORTED_BASE Created 7 years, 8 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 | « content/renderer/pepper/pepper_file_io_host.h ('k') | content/renderer/pepper/pepper_file_system_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_file_io_host.cc
diff --git a/content/renderer/pepper/pepper_file_io_host.cc b/content/renderer/pepper/pepper_file_io_host.cc
index 78d6c0525bef4a531839e6f187a388b7c533c0dc..419a86608da6bb907d82d8da5a384360bbc6c6de 100644
--- a/content/renderer/pepper/pepper_file_io_host.cc
+++ b/content/renderer/pepper/pepper_file_io_host.cc
@@ -5,11 +5,13 @@
#include "content/renderer/pepper/pepper_file_io_host.h"
#include "base/bind.h"
+#include "base/callback.h"
#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/files/file_util_proxy.h"
#include "content/public/common/content_client.h"
#include "content/public/renderer/content_renderer_client.h"
+#include "content/renderer/pepper/null_file_system_callback_dispatcher.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/host/dispatch_host_message.h"
#include "ppapi/host/ppapi_host.h"
@@ -17,7 +19,6 @@
#include "ppapi/shared_impl/file_type_conversion.h"
#include "ppapi/shared_impl/time_conversion.h"
#include "ppapi/thunk/enter.h"
-#include "webkit/fileapi/file_system_callback_dispatcher.h"
#include "webkit/plugins/ppapi/file_callbacks.h"
#include "webkit/plugins/ppapi/host_globals.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
@@ -47,7 +48,7 @@ static const int32_t kMaxReadSize = 32 * 1024 * 1024; // 32MB
typedef base::Callback<void (base::PlatformFileError)> PlatformGeneralCallback;
class PlatformGeneralCallbackTranslator
- : public fileapi::FileSystemCallbackDispatcher {
+ : public NullFileSystemCallbackDispatcher {
public:
explicit PlatformGeneralCallbackTranslator(
const PlatformGeneralCallback& callback)
@@ -59,39 +60,8 @@ class PlatformGeneralCallbackTranslator
callback_.Run(base::PLATFORM_FILE_OK);
}
- virtual void DidReadMetadata(const base::PlatformFileInfo& file_info,
- const base::FilePath& platform_path) OVERRIDE {
- NOTREACHED();
- }
-
- virtual void DidCreateSnapshotFile(
- const base::PlatformFileInfo& file_info,
- const base::FilePath& platform_path) OVERRIDE {
- NOTREACHED();
- }
-
- virtual void DidReadDirectory(
- const std::vector<base::FileUtilProxy::Entry>& entries,
- bool has_more) OVERRIDE {
- NOTREACHED();
- }
-
- virtual void DidOpenFileSystem(const std::string& name,
- const GURL& root) OVERRIDE {
- NOTREACHED();
- }
-
- virtual void DidFail(base::PlatformFileError error_code) OVERRIDE {
- callback_.Run(error_code);
- }
-
- virtual void DidWrite(int64 bytes, bool complete) OVERRIDE {
- NOTREACHED();
- }
-
- virtual void DidOpenFile(base::PlatformFile file,
- quota::QuotaLimitType quota_policy) OVERRIDE {
- NOTREACHED();
+ virtual void DidFail(base::PlatformFileError platform_error) OVERRIDE {
+ callback_.Run(platform_error);
}
private:
@@ -422,7 +392,7 @@ int32_t PepperFileIOHost::OnHostMsgWillWrite(
if (!quota_file_io_->WillWrite(
offset, bytes_to_write,
- base::Bind(&PepperFileIOHost::ExecutePlatformWillWriteCallback,
+ base::Bind(&PepperFileIOHost::ExecutePlatformWriteCallback,
weak_factory_.GetWeakPtr(),
context->MakeReplyMessageContext())))
return PP_ERROR_FAILED;
@@ -584,16 +554,6 @@ void PepperFileIOHost::ExecutePlatformWriteCallback(
ppapi::host::ReplyMessageContext reply_context,
base::PlatformFileError error_code,
int bytes_written) {
- int32_t pp_error = ::ppapi::PlatformFileErrorToPepperError(error_code);
- reply_context.params.set_result(ErrorOrByteNumber(pp_error, bytes_written));
- host()->SendReply(reply_context, PpapiPluginMsg_FileIO_GeneralReply());
- state_manager_.SetOperationFinished();
-}
-
-void PepperFileIOHost::ExecutePlatformWillWriteCallback(
- ppapi::host::ReplyMessageContext reply_context,
- base::PlatformFileError error_code,
- int bytes_written) {
// On the plugin side, the callback expects a parameter with different meaning
// depends on whether is negative or not. It is the result here. We translate
// for the callback.
« no previous file with comments | « content/renderer/pepper/pepper_file_io_host.h ('k') | content/renderer/pepper/pepper_file_system_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698