| 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 PPAPI_SHARED_IMPL_PPB_FILE_REF_SHARED_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PPB_FILE_REF_SHARED_H_ |
| 6 #define PPAPI_SHARED_IMPL_PPB_FILE_REF_SHARED_H_ | 6 #define PPAPI_SHARED_IMPL_PPB_FILE_REF_SHARED_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 std::string name; | 26 std::string name; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // This class provides the shared implementation of a FileRef. The functions | 29 // This class provides the shared implementation of a FileRef. The functions |
| 30 // that actually "do stuff" like Touch and MakeDirectory are implemented | 30 // that actually "do stuff" like Touch and MakeDirectory are implemented |
| 31 // differently for the proxied and non-proxied derived classes. | 31 // differently for the proxied and non-proxied derived classes. |
| 32 class PPAPI_SHARED_EXPORT PPB_FileRef_Shared | 32 class PPAPI_SHARED_EXPORT PPB_FileRef_Shared |
| 33 : public Resource, | 33 : public Resource, |
| 34 public thunk::PPB_FileRef_API { | 34 public thunk::PPB_FileRef_API { |
| 35 public: | 35 public: |
| 36 struct InitAsImpl {}; | 36 PPB_FileRef_Shared(ResourceObjectType type, |
| 37 struct InitAsProxy {}; | 37 const PPB_FileRef_CreateInfo& info); |
| 38 | |
| 39 PPB_FileRef_Shared(const InitAsImpl&, const PPB_FileRef_CreateInfo& info); | |
| 40 PPB_FileRef_Shared(const InitAsProxy&, const PPB_FileRef_CreateInfo& info); | |
| 41 virtual ~PPB_FileRef_Shared(); | 38 virtual ~PPB_FileRef_Shared(); |
| 42 | 39 |
| 43 // Resource overrides. | 40 // Resource overrides. |
| 44 virtual thunk::PPB_FileRef_API* AsPPB_FileRef_API() OVERRIDE; | 41 virtual thunk::PPB_FileRef_API* AsPPB_FileRef_API() OVERRIDE; |
| 45 | 42 |
| 46 // PPB_FileRef_API implementation (partial). | 43 // PPB_FileRef_API implementation (partial). |
| 47 virtual PP_FileSystemType GetFileSystemType() const OVERRIDE; | 44 virtual PP_FileSystemType GetFileSystemType() const OVERRIDE; |
| 48 virtual PP_Var GetName() const OVERRIDE; | 45 virtual PP_Var GetName() const OVERRIDE; |
| 49 virtual PP_Var GetPath() const OVERRIDE; | 46 virtual PP_Var GetPath() const OVERRIDE; |
| 50 virtual const PPB_FileRef_CreateInfo& GetCreateInfo() const OVERRIDE; | 47 virtual const PPB_FileRef_CreateInfo& GetCreateInfo() const OVERRIDE; |
| 51 virtual PP_Var GetAbsolutePath() = 0; | 48 virtual PP_Var GetAbsolutePath() = 0; |
| 52 | 49 |
| 53 private: | 50 private: |
| 54 PPB_FileRef_CreateInfo create_info_; | 51 PPB_FileRef_CreateInfo create_info_; |
| 55 | 52 |
| 56 // Lazily initialized vars created from the create_info_. This is so we can | 53 // Lazily initialized vars created from the create_info_. This is so we can |
| 57 // return the identical string object every time they're requested. | 54 // return the identical string object every time they're requested. |
| 58 mutable scoped_refptr<StringVar> name_var_; | 55 mutable scoped_refptr<StringVar> name_var_; |
| 59 mutable scoped_refptr<StringVar> path_var_; | 56 mutable scoped_refptr<StringVar> path_var_; |
| 60 | 57 |
| 61 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_FileRef_Shared); | 58 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_FileRef_Shared); |
| 62 }; | 59 }; |
| 63 | 60 |
| 64 } // namespace ppapi | 61 } // namespace ppapi |
| 65 | 62 |
| 66 #endif // PPAPI_SHARED_IMPL_PPB_FILE_REF_SHARED_H_ | 63 #endif // PPAPI_SHARED_IMPL_PPB_FILE_REF_SHARED_H_ |
| OLD | NEW |