Index: webkit/plugins/ppapi/ppb_file_system_impl.cc |
diff --git a/webkit/plugins/ppapi/ppb_file_system_impl.cc b/webkit/plugins/ppapi/ppb_file_system_impl.cc |
deleted file mode 100644 |
index f08e0e0919bdbc105ca43d139e2695a3cc53f91b..0000000000000000000000000000000000000000 |
--- a/webkit/plugins/ppapi/ppb_file_system_impl.cc |
+++ /dev/null |
@@ -1,95 +0,0 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
- |
-#include "webkit/plugins/ppapi/ppb_file_system_impl.h" |
- |
-#include "base/memory/ref_counted.h" |
-#include "ppapi/c/pp_completion_callback.h" |
-#include "ppapi/c/ppb_file_system.h" |
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
-#include "webkit/fileapi/file_system_types.h" |
-#include "webkit/plugins/ppapi/common.h" |
-#include "webkit/plugins/ppapi/file_callbacks.h" |
-#include "webkit/plugins/ppapi/plugin_delegate.h" |
-#include "webkit/plugins/ppapi/plugin_module.h" |
-#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
-#include "webkit/plugins/ppapi/resource_helper.h" |
- |
-using ppapi::thunk::PPB_FileSystem_API; |
-using ppapi::TrackedCallback; |
- |
-namespace webkit { |
-namespace ppapi { |
- |
-PPB_FileSystem_Impl::PPB_FileSystem_Impl(PP_Instance instance, |
- PP_FileSystemType type) |
- : Resource(::ppapi::OBJECT_IS_IMPL, instance), |
- type_(type), |
- opened_(false), |
- called_open_(false) { |
- DCHECK(type_ != PP_FILESYSTEMTYPE_INVALID); |
-} |
- |
-PPB_FileSystem_Impl::~PPB_FileSystem_Impl() { |
-} |
- |
-// static |
-PP_Resource PPB_FileSystem_Impl::Create(PP_Instance instance, |
- PP_FileSystemType type) { |
- if (type != PP_FILESYSTEMTYPE_EXTERNAL && |
- type != PP_FILESYSTEMTYPE_LOCALPERSISTENT && |
- type != PP_FILESYSTEMTYPE_LOCALTEMPORARY) |
- return 0; |
- return (new PPB_FileSystem_Impl(instance, type))->GetReference(); |
-} |
- |
-PPB_FileSystem_API* PPB_FileSystem_Impl::AsPPB_FileSystem_API() { |
- return this; |
-} |
- |
-int32_t PPB_FileSystem_Impl::Open(int64_t expected_size, |
- scoped_refptr<TrackedCallback> callback) { |
- // Should not allow multiple opens. |
- if (called_open_) |
- return PP_ERROR_INPROGRESS; |
- called_open_ = true; |
- |
- fileapi::FileSystemType file_system_type; |
- switch (type_) { |
- case PP_FILESYSTEMTYPE_LOCALTEMPORARY: |
- file_system_type = fileapi::kFileSystemTypeTemporary; |
- break; |
- case PP_FILESYSTEMTYPE_LOCALPERSISTENT: |
- file_system_type = fileapi::kFileSystemTypePersistent; |
- break; |
- case PP_FILESYSTEMTYPE_EXTERNAL: |
- file_system_type = fileapi::kFileSystemTypeExternal; |
- break; |
- default: |
- return PP_ERROR_FAILED; |
- } |
- |
- PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this); |
- if (!plugin_instance) |
- return PP_ERROR_FAILED; |
- |
- if (!plugin_instance->delegate()->OpenFileSystem( |
- GURL(plugin_instance->container()->element().document().url()). |
- GetOrigin(), |
- file_system_type, expected_size, |
- new FileCallbacks(this, callback, NULL, |
- scoped_refptr<PPB_FileSystem_Impl>(this)))) |
- return PP_ERROR_FAILED; |
- return PP_OK_COMPLETIONPENDING; |
-} |
- |
-PP_FileSystemType PPB_FileSystem_Impl::GetType() { |
- return type_; |
-} |
- |
-} // namespace ppapi |
-} // namespace webkit |