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

Unified Diff: ppapi/cpp/private/flash_file.h

Issue 10638007: Pepper Flash: Add trivial C++ wrappers for PPB_Flash_File_{ModuleLocal,FileRef}. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ffffuuuuuuuuuuuuuuuuuuuuuuuuuuu Created 8 years, 6 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 | « no previous file | ppapi/cpp/private/flash_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/private/flash_file.h
diff --git a/ppapi/cpp/private/flash_file.h b/ppapi/cpp/private/flash_file.h
new file mode 100644
index 0000000000000000000000000000000000000000..1c19c9d0526a806f56d0b3754d0d9a9d8be9031e
--- /dev/null
+++ b/ppapi/cpp/private/flash_file.h
@@ -0,0 +1,74 @@
+// 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_CPP_PRIVATE_FLASH_FILE_H_
+#define PPAPI_CPP_PRIVATE_FLASH_FILE_H_
+
+#include <string>
+#include <vector>
+
+#include "ppapi/c/private/ppb_flash_file.h"
+
+namespace pp {
+
+class FileRef;
+class InstanceHandle;
+
+namespace flash {
+
+// FileModuleLocal -------------------------------------------------------------
+
+class FileModuleLocal {
+ public:
+ // Returns true if the required interface is available.
+ static bool IsAvailable();
+
+ static bool CreateThreadAdapterForInstance(const InstanceHandle& instance);
+ static void ClearThreadAdapterForInstance(const InstanceHandle& instance);
+
+ // Returns |PP_kInvalidFileHandle| on error.
+ static PP_FileHandle OpenFile(const InstanceHandle& instance,
+ const std::string& path,
+ int32_t mode);
+ static bool RenameFile(const InstanceHandle& instance,
+ const std::string& path_from,
+ const std::string& path_to);
+ static bool DeleteFileOrDir(const InstanceHandle& instance,
+ const std::string& path,
+ bool recursive);
+ static bool CreateDir(const InstanceHandle& instance,
+ const std::string& path);
+ static bool QueryFile(const InstanceHandle& instance,
+ const std::string& path,
+ PP_FileInfo* info);
+ // Note that, unlike the C interface, no |FreeDirContents()| is needed.
+ static bool GetDirContents(const InstanceHandle& instance,
+ const std::string& path,
+ std::vector<PP_DirEntry_Dev>* dir_contents);
+
+ // Returns true if |CreateTemporaryFile()| is supported.
+ // TODO(viettrungluu): Remove this sometime after M21 ships to Stable?
+ static bool IsCreateTemporaryFileAvailable();
+ // Returns |PP_kInvalidFileHandle| on error.
+ static PP_FileHandle CreateTemporaryFile(const InstanceHandle& instance);
+};
+
+// FileFileRef -----------------------------------------------------------------
+
+class FileFileRef {
+ public:
+ // Returns true if the required interface is available.
+ static bool IsAvailable();
+
+ // Returns |PP_kInvalidFileHandle| on error.
+ static PP_FileHandle OpenFile(const pp::FileRef& resource,
+ int32_t mode);
+ static bool QueryFile(const pp::FileRef& resource,
+ PP_FileInfo* info);
+};
+
+} // namespace flash
+} // namespace pp
+
+#endif // PPAPI_CPP_PRIVATE_FLASH_FILE_H_
« no previous file with comments | « no previous file | ppapi/cpp/private/flash_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698