| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 12 #include "ppapi/c/ppb_file_ref.h" | 12 #include "ppapi/c/ppb_file_ref.h" |
| 13 #include "ppapi/shared_impl/file_ref_impl.h" | 13 #include "ppapi/shared_impl/ppb_file_ref_shared.h" |
| 14 #include "ppapi/shared_impl/var.h" | 14 #include "ppapi/shared_impl/var.h" |
| 15 | 15 |
| 16 namespace webkit { | 16 namespace webkit { |
| 17 namespace ppapi { | 17 namespace ppapi { |
| 18 | 18 |
| 19 using ::ppapi::StringVar; | 19 using ::ppapi::StringVar; |
| 20 | 20 |
| 21 class PPB_FileSystem_Impl; | 21 class PPB_FileSystem_Impl; |
| 22 | 22 |
| 23 class PPB_FileRef_Impl : public ::ppapi::FileRefImpl { | 23 class PPB_FileRef_Impl : public ::ppapi::PPB_FileRef_Shared { |
| 24 public: | 24 public: |
| 25 PPB_FileRef_Impl(const ::ppapi::PPB_FileRef_CreateInfo& info, | 25 PPB_FileRef_Impl(const ::ppapi::PPB_FileRef_CreateInfo& info, |
| 26 PPB_FileSystem_Impl* file_system); | 26 PPB_FileSystem_Impl* file_system); |
| 27 PPB_FileRef_Impl(const ::ppapi::PPB_FileRef_CreateInfo& info, | 27 PPB_FileRef_Impl(const ::ppapi::PPB_FileRef_CreateInfo& info, |
| 28 const FilePath& external_file_path); | 28 const FilePath& external_file_path); |
| 29 virtual ~PPB_FileRef_Impl(); | 29 virtual ~PPB_FileRef_Impl(); |
| 30 | 30 |
| 31 // The returned object will have a refcount of 0 (just like "new"). | 31 // The returned object will have a refcount of 0 (just like "new"). |
| 32 static PPB_FileRef_Impl* CreateInternal(PP_Resource pp_file_system, | 32 static PPB_FileRef_Impl* CreateInternal(PP_Resource pp_file_system, |
| 33 const std::string& path); | 33 const std::string& path); |
| 34 | 34 |
| 35 // The returned object will have a refcount of 0 (just like "new"). | 35 // The returned object will have a refcount of 0 (just like "new"). |
| 36 static PPB_FileRef_Impl* CreateExternal(PP_Instance instance, | 36 static PPB_FileRef_Impl* CreateExternal(PP_Instance instance, |
| 37 const FilePath& external_file_path); | 37 const FilePath& external_file_path); |
| 38 | 38 |
| 39 // PPB_FileRef_API implementation (not provided by FileRefImpl). | 39 // PPB_FileRef_API implementation (not provided by PPB_FileRef_Shared). |
| 40 virtual PP_Resource GetParent() OVERRIDE; | 40 virtual PP_Resource GetParent() OVERRIDE; |
| 41 virtual int32_t MakeDirectory(PP_Bool make_ancestors, | 41 virtual int32_t MakeDirectory(PP_Bool make_ancestors, |
| 42 PP_CompletionCallback callback) OVERRIDE; | 42 PP_CompletionCallback callback) OVERRIDE; |
| 43 virtual int32_t Touch(PP_Time last_access_time, | 43 virtual int32_t Touch(PP_Time last_access_time, |
| 44 PP_Time last_modified_time, | 44 PP_Time last_modified_time, |
| 45 PP_CompletionCallback callback) OVERRIDE; | 45 PP_CompletionCallback callback) OVERRIDE; |
| 46 virtual int32_t Delete(PP_CompletionCallback callback) OVERRIDE; | 46 virtual int32_t Delete(PP_CompletionCallback callback) OVERRIDE; |
| 47 virtual int32_t Rename(PP_Resource new_file_ref, | 47 virtual int32_t Rename(PP_Resource new_file_ref, |
| 48 PP_CompletionCallback callback) OVERRIDE; | 48 PP_CompletionCallback callback) OVERRIDE; |
| 49 virtual PP_Var GetAbsolutePath(); | 49 virtual PP_Var GetAbsolutePath(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 75 // return the identical string object every time it is requested. | 75 // return the identical string object every time it is requested. |
| 76 scoped_refptr<StringVar> external_path_var_; | 76 scoped_refptr<StringVar> external_path_var_; |
| 77 | 77 |
| 78 DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Impl); | 78 DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Impl); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace ppapi | 81 } // namespace ppapi |
| 82 } // namespace webkit | 82 } // namespace webkit |
| 83 | 83 |
| 84 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_ | 84 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_ |
| OLD | NEW |