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

Unified Diff: ppapi/proxy/flash_file_resource.h

Issue 11359097: Refactored the PPB_Flash_File_ModuleLocal/FileRef to the new ppapi resource model (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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: ppapi/proxy/flash_file_resource.h
diff --git a/ppapi/proxy/flash_file_resource.h b/ppapi/proxy/flash_file_resource.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3dfb43b6b5122dcec7fd6cd2e69aee4c40c6c50
--- /dev/null
+++ b/ppapi/proxy/flash_file_resource.h
@@ -0,0 +1,77 @@
+// 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.
+
+#ifndef PPAPI_PROXY_FLASH_FILE_RESOURCE_H_
+#define PPAPI_PROXY_FLASH_FILE_RESOURCE_H_
+
+#include <string>
+
+#include "ppapi/proxy/connection.h"
+#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/shared_impl/file_path.h"
+#include "ppapi/thunk/ppb_flash_file_api.h"
+
+struct PP_ArrayOutput;
yzshen1 2012/11/21 00:38:59 Why do we need this?
raymes 2012/11/21 22:44:53 Done.
+
+namespace ppapi {
+namespace proxy {
+
+class FlashFileResource
+ : public PluginResource,
+ public NON_EXPORTED_BASE(thunk::PPB_Flash_File_API) {
yzshen1 2012/11/21 00:38:59 You don't need NON_EXPORTED_BASE here.
raymes 2012/11/21 22:44:53 Done.
+ public:
+ FlashFileResource(Connection connection, PP_Instance instance);
+ virtual ~FlashFileResource();
+
+ // Resource overrides.
+ virtual thunk::PPB_Flash_File_API* AsPPB_Flash_File_API() OVERRIDE;
+
+ // PPB_Flash_Functions_API.
+ virtual int32_t OpenFile(PP_Instance instance,
+ const char* path,
+ int32_t mode,
+ PP_FileHandle* file) OVERRIDE;
+ virtual int32_t RenameFile(PP_Instance instance,
+ const char* path_from,
+ const char* path_to) OVERRIDE;
+ virtual int32_t DeleteFileOrDir(PP_Instance instance,
+ const char* path,
+ PP_Bool recursive) OVERRIDE;
+ virtual int32_t CreateDir(PP_Instance instance, const char* path) OVERRIDE;
+ virtual int32_t QueryFile(PP_Instance instance,
+ const char* path,
+ PP_FileInfo* info) OVERRIDE;
+ virtual int32_t GetDirContents(PP_Instance instance,
+ const char* path,
+ PP_DirContents_Dev** contents) OVERRIDE;
+ virtual void FreeDirContents(PP_Instance instance,
+ PP_DirContents_Dev* contents) OVERRIDE;
+ virtual int32_t CreateTemporaryFile(PP_Instance instance,
+ PP_FileHandle* file) OVERRIDE;
+ virtual int32_t OpenFileRef(PP_Instance instance,
+ PP_Resource file_ref,
+ int32_t mode,
+ PP_FileHandle* file) OVERRIDE;
+ virtual int32_t QueryFileRef(PP_Instance instance,
+ PP_Resource file_ref,
+ PP_FileInfo* info) OVERRIDE;
+
+ private:
+ int32_t OpenFileHelper(PP_Instance instance,
+ const std::string& path,
+ PepperFilePath::Domain domain_type,
+ int32_t mode,
+ PP_FileHandle* file);
+ int32_t QueryFileHelper(PP_Instance instance,
+ const std::string& path,
+ PepperFilePath::Domain domain_type,
+ PP_FileInfo* info);
+
+ DISALLOW_COPY_AND_ASSIGN(FlashFileResource);
+};
+
+} // namespace proxy
+} // namespace ppapi
+
+#endif // PPAPI_PROXY_FLASH_FILE_RESOURCE_H_

Powered by Google App Engine
This is Rietveld 408576698