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

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

Issue 14796018: Cleanup: Deprecate FileSystemCallbackDispatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
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 f2e08dfe620609c1a892935397d23b5d5b4fc267..3e59aa26e9c3c8135c55d7ae97c2977fec6c5b81 100644
--- a/content/renderer/pepper/pepper_file_io_host.cc
+++ b/content/renderer/pepper/pepper_file_io_host.cc
@@ -11,7 +11,6 @@
#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"
@@ -47,27 +46,6 @@ static const int32_t kMaxReadSize = 32 * 1024 * 1024; // 32MB
typedef base::Callback<void (base::PlatformFileError)> PlatformGeneralCallback;
-class PlatformGeneralCallbackTranslator
- : public NullFileSystemCallbackDispatcher {
- public:
- explicit PlatformGeneralCallbackTranslator(
- const PlatformGeneralCallback& callback)
- : callback_(callback) {}
-
- virtual ~PlatformGeneralCallbackTranslator() {}
-
- virtual void DidSucceed() OVERRIDE {
- callback_.Run(base::PLATFORM_FILE_OK);
- }
-
- virtual void DidFail(base::PlatformFileError platform_error) OVERRIDE {
- callback_.Run(platform_error);
- }
-
- private:
- PlatformGeneralCallback callback_;
-};
-
int32_t ErrorOrByteNumber(int32_t pp_error, int32_t byte_number) {
// On the plugin side, some callbacks expect a parameter that means different
// things depending on whether is negative or not. We translate for those
@@ -220,10 +198,9 @@ int32_t PepperFileIOHost::OnHostMsgTouch(
file_system_url_,
PPTimeToTime(last_access_time),
PPTimeToTime(last_modified_time),
- new PlatformGeneralCallbackTranslator(
- base::Bind(&PepperFileIOHost::ExecutePlatformGeneralCallback,
- weak_factory_.GetWeakPtr(),
- context->MakeReplyMessageContext()))))
+ base::Bind(&PepperFileIOHost::ExecutePlatformGeneralCallback,
+ weak_factory_.GetWeakPtr(),
+ context->MakeReplyMessageContext())))
return PP_ERROR_FAILED;
state_manager_.SetPendingOperation(FileIOStateManager::OPERATION_EXCLUSIVE);
return PP_OK_COMPLETIONPENDING;
@@ -325,10 +302,9 @@ int32_t PepperFileIOHost::OnHostMsgSetLength(
if (file_system_type_ != PP_FILESYSTEMTYPE_EXTERNAL) {
if (!plugin_delegate_->SetLength(
file_system_url_, length,
- new PlatformGeneralCallbackTranslator(
- base::Bind(&PepperFileIOHost::ExecutePlatformGeneralCallback,
- weak_factory_.GetWeakPtr(),
- context->MakeReplyMessageContext()))))
+ base::Bind(&PepperFileIOHost::ExecutePlatformGeneralCallback,
+ weak_factory_.GetWeakPtr(),
+ context->MakeReplyMessageContext())))
return PP_ERROR_FAILED;
} else {
// TODO(nhiroki): fix a failure of FileIO.SetLength for an external

Powered by Google App Engine
This is Rietveld 408576698