summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/private/flash_file.cc
diff options
context:
space:
mode:
authorraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-06 03:25:24 +0000
committerraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-06 03:25:24 +0000
commitd146b8bf4a1ed1860452e0ebdeb9c52c135226e2 (patch)
tree27012d7f0c43fdfe8dacab51ddfdd9861a9fae7c /ppapi/cpp/private/flash_file.cc
parentf121ad61e72e32caf56df8732f2eee90343781b1 (diff)
downloadchromium_src-d146b8bf4a1ed1860452e0ebdeb9c52c135226e2.zip
chromium_src-d146b8bf4a1ed1860452e0ebdeb9c52c135226e2.tar.gz
chromium_src-d146b8bf4a1ed1860452e0ebdeb9c52c135226e2.tar.bz2
Revert 171080
> The refactors PPB_Flash_File_ModuleLocal/FileRef to the new resource model. Calls for both these interfaces are now made directly to the browser. This removes the in-process implementation for these interfaces also (as they are flash-only). Tests are added for PPB_Flash_File_ModuleLocal. > > Review URL: https://codereview.chromium.org/11359097 TBR=raymes@chromium.org Review URL: https://codereview.chromium.org/11437038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/private/flash_file.cc')
-rw-r--r--ppapi/cpp/private/flash_file.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/ppapi/cpp/private/flash_file.cc b/ppapi/cpp/private/flash_file.cc
index a38f007..2aea2c3 100644
--- a/ppapi/cpp/private/flash_file.cc
+++ b/ppapi/cpp/private/flash_file.cc
@@ -40,6 +40,32 @@ bool FileModuleLocal::IsAvailable() {
}
// static
+bool FileModuleLocal::CreateThreadAdapterForInstance(
+ const InstanceHandle& instance) {
+ bool rv = false;
+ if (has_interface<PPB_Flash_File_ModuleLocal_3_0>()) {
+ rv = get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
+ CreateThreadAdapterForInstance(instance.pp_instance());
+ } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
+ rv = get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
+ CreateThreadAdapterForInstance( instance.pp_instance());
+ }
+ return rv;
+}
+
+// static
+void FileModuleLocal::ClearThreadAdapterForInstance(
+ const InstanceHandle& instance) {
+ if (has_interface<PPB_Flash_File_ModuleLocal_3_0>()) {
+ get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
+ ClearThreadAdapterForInstance(instance.pp_instance());
+ } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
+ get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
+ ClearThreadAdapterForInstance(instance.pp_instance());
+ }
+}
+
+// static
PP_FileHandle FileModuleLocal::OpenFile(const InstanceHandle& instance,
const std::string& path,
int32_t mode) {
@@ -153,6 +179,11 @@ bool FileModuleLocal::GetDirContents(
}
// static
+bool FileModuleLocal::IsCreateTemporaryFileAvailable() {
+ return has_interface<PPB_Flash_File_ModuleLocal_3_0>();
+}
+
+// static
PP_FileHandle FileModuleLocal::CreateTemporaryFile(
const InstanceHandle& instance) {
PP_FileHandle file_handle = PP_kInvalidFileHandle;