#ifndef PPAPI_SHARED_IMPL_PPB_FILE_REF_SHARED_H_
#define PPAPI_SHARED_IMPL_PPB_FILE_REF_SHARED_H_
#include <string>
#include "base/compiler_specific.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/thunk/ppb_file_ref_api.h"
namespace ppapi {
class StringVar;
struct PPB_FileRef_CreateInfo {
PPB_FileRef_CreateInfo() : file_system_type(PP_FILESYSTEMTYPE_EXTERNAL) {}
ppapi::HostResource resource;
int file_system_type;
std::string path;
std::string name;
};
class PPAPI_SHARED_EXPORT PPB_FileRef_Shared
: public Resource,
public thunk::PPB_FileRef_API {
public:
PPB_FileRef_Shared(ResourceObjectType type,
const PPB_FileRef_CreateInfo& info);
virtual ~PPB_FileRef_Shared();
virtual thunk::PPB_FileRef_API* AsPPB_FileRef_API() OVERRIDE;
virtual PP_FileSystemType GetFileSystemType() const OVERRIDE;
virtual PP_Var GetName() const OVERRIDE;
virtual PP_Var GetPath() const OVERRIDE;
virtual const PPB_FileRef_CreateInfo& GetCreateInfo() const OVERRIDE;
virtual PP_Var GetAbsolutePath() = 0;
private:
PPB_FileRef_CreateInfo create_info_;
mutable scoped_refptr<StringVar> name_var_;
mutable scoped_refptr<StringVar> path_var_;
DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_FileRef_Shared);
};
}
#endif