| Index: content/renderer/pepper/pepper_file_system_host.cc
|
| diff --git a/content/renderer/pepper/pepper_file_system_host.cc b/content/renderer/pepper/pepper_file_system_host.cc
|
| index 13bff9a6678f218e7c854cd5e073121fb294b5f0..0212ba77db8e5b90031facef59809efcde653c4e 100644
|
| --- a/content/renderer/pepper/pepper_file_system_host.cc
|
| +++ b/content/renderer/pepper/pepper_file_system_host.cc
|
| @@ -10,7 +10,6 @@
|
| #include "content/common/fileapi/file_system_dispatcher.h"
|
| #include "content/public/renderer/render_view.h"
|
| #include "content/public/renderer/renderer_ppapi_host.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"
|
| @@ -28,31 +27,6 @@ namespace content {
|
|
|
| namespace {
|
|
|
| -class PlatformCallbackAdaptor : public NullFileSystemCallbackDispatcher {
|
| - public:
|
| - explicit PlatformCallbackAdaptor(
|
| - const base::WeakPtr<PepperFileSystemHost>& weak_host)
|
| - : weak_host_(weak_host) {}
|
| -
|
| - virtual ~PlatformCallbackAdaptor() {}
|
| -
|
| - virtual void DidOpenFileSystem(const std::string& /* unused */,
|
| - const GURL& root) OVERRIDE {
|
| - if (weak_host_)
|
| - weak_host_->OpenFileSystemReply(PP_OK, root);
|
| - }
|
| -
|
| - virtual void DidFail(base::PlatformFileError platform_error) OVERRIDE {
|
| - if (weak_host_) {
|
| - weak_host_->OpenFileSystemReply(
|
| - ppapi::PlatformFileErrorToPepperError(platform_error), GURL());
|
| - }
|
| - }
|
| -
|
| - private:
|
| - base::WeakPtr<PepperFileSystemHost> weak_host_;
|
| -};
|
| -
|
| bool LooksLikeAGuid(const std::string& fsid) {
|
| const size_t kExpectedFsIdSize = 32;
|
| if (fsid.size() != kExpectedFsIdSize)
|
| @@ -97,8 +71,11 @@ int32_t PepperFileSystemHost::OnResourceMessageReceived(
|
| return PP_ERROR_FAILED;
|
| }
|
|
|
| -void PepperFileSystemHost::OpenFileSystemReply(int32_t pp_error,
|
| - const GURL& root) {
|
| +void PepperFileSystemHost::OpenFileSystemReply(
|
| + base::PlatformFileError platform_error,
|
| + const std::string& /* name_unused */,
|
| + const GURL& root) {
|
| + int32 pp_error = ppapi::PlatformFileErrorToPepperError(platform_error);
|
| opened_ = (pp_error == PP_OK);
|
| root_url_ = root;
|
| reply_context_.params.set_result(pp_error);
|
| @@ -142,7 +119,8 @@ int32_t PepperFileSystemHost::OnHostMsgOpen(
|
| GURL(plugin_instance->container()->element().document().url()).
|
| GetOrigin(),
|
| file_system_type, expected_size, true /* create */,
|
| - new PlatformCallbackAdaptor(weak_factory_.GetWeakPtr()))) {
|
| + base::Bind(&PepperFileSystemHost::OpenFileSystemReply,
|
| + weak_factory_.GetWeakPtr()))) {
|
| return PP_ERROR_FAILED;
|
| }
|
|
|
|
|