diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-01 02:12:55 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-01 02:12:55 +0000 |
commit | 1598e4a9f0fe3572b7f2bb9459c26ec208fcbf12 (patch) | |
tree | 10cae214da22b6ed0da1d7651fc068e046adc3cd /webkit/plugins/ppapi/ppb_file_io_impl.h | |
parent | d0922eaaa02cf79caaa21f29613e4995fa0d2048 (diff) | |
download | chromium_src-1598e4a9f0fe3572b7f2bb9459c26ec208fcbf12.zip chromium_src-1598e4a9f0fe3572b7f2bb9459c26ec208fcbf12.tar.gz chromium_src-1598e4a9f0fe3572b7f2bb9459c26ec208fcbf12.tar.bz2 |
Convert more interfaces to the new thunk system. This goes up to and including
the ones starting with "F".
Since this adds a lot more interfaces, I added the macro stuff we used for the
old system to generate the various template specializations. This involded a
lot of renaming since the As* needs to match the name (I was previously leaving
off the "PPB_" part). I did other misc cleanup to the infrastructure.
Review URL: http://codereview.chromium.org/7082036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_file_io_impl.h')
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_io_impl.h | 76 |
1 files changed, 35 insertions, 41 deletions
diff --git a/webkit/plugins/ppapi/ppb_file_io_impl.h b/webkit/plugins/ppapi/ppb_file_io_impl.h index 621aa1e..0fc05c5 100644 --- a/webkit/plugins/ppapi/ppb_file_io_impl.h +++ b/webkit/plugins/ppapi/ppb_file_io_impl.h @@ -13,6 +13,7 @@ #include "base/platform_file.h" #include "ppapi/c/dev/pp_file_info_dev.h" #include "ppapi/c/pp_time.h" +#include "ppapi/thunk/ppb_file_io_api.h" #include "webkit/plugins/ppapi/callbacks.h" #include "webkit/plugins/ppapi/plugin_delegate.h" #include "webkit/plugins/ppapi/resource.h" @@ -27,51 +28,44 @@ namespace ppapi { class PluginModule; class PPB_FileRef_Impl; -class PPB_FileIO_Impl : public Resource { +class PPB_FileIO_Impl : public Resource, + public ::ppapi::thunk::PPB_FileIO_API { public: explicit PPB_FileIO_Impl(PluginInstance* instance); virtual ~PPB_FileIO_Impl(); - // Returns a pointer to the interface implementing PPB_FileIO that is exposed - // to the plugin. - static const PPB_FileIO_Dev* GetInterface(); - - // Returns a pointer to the interface implementing PPB_FileIOTrusted that is - // exposed to the plugin. - static const PPB_FileIOTrusted_Dev* GetTrustedInterface(); - - // Resource overrides. - virtual PPB_FileIO_Impl* AsPPB_FileIO_Impl(); - - // PPB_FileIO implementation. - int32_t Open(PPB_FileRef_Impl* file_ref, - int32_t open_flags, - PP_CompletionCallback callback); - int32_t Query(PP_FileInfo_Dev* info, - PP_CompletionCallback callback); - int32_t Touch(PP_Time last_access_time, - PP_Time last_modified_time, - PP_CompletionCallback callback); - int32_t Read(int64_t offset, - char* buffer, - int32_t bytes_to_read, - PP_CompletionCallback callback); - int32_t Write(int64_t offset, - const char* buffer, - int32_t bytes_to_write, - PP_CompletionCallback callback); - int32_t SetLength(int64_t length, - PP_CompletionCallback callback); - int32_t Flush(PP_CompletionCallback callback); - void Close(); - - // PPB_FileIOTrusted implementation. - int32_t GetOSFileDescriptor(); - int32_t WillWrite(int64_t offset, - int32_t bytes_to_write, - PP_CompletionCallback callback); - int32_t WillSetLength(int64_t length, - PP_CompletionCallback callback); + static PP_Resource Create(PP_Instance instance); + + // ResourceObjectBase overrides. + ::ppapi::thunk::PPB_FileIO_API* AsPPB_FileIO_API(); + + // PPB_FileIO_API implementation. + virtual int32_t Open(PP_Resource file_ref, + int32_t open_flags, + PP_CompletionCallback callback) OVERRIDE; + virtual int32_t Query(PP_FileInfo_Dev* info, + PP_CompletionCallback callback) OVERRIDE; + virtual int32_t Touch(PP_Time last_access_time, + PP_Time last_modified_time, + PP_CompletionCallback callback) OVERRIDE; + virtual int32_t Read(int64_t offset, + char* buffer, + int32_t bytes_to_read, + PP_CompletionCallback callback) OVERRIDE; + virtual int32_t Write(int64_t offset, + const char* buffer, + int32_t bytes_to_write, + PP_CompletionCallback callback) OVERRIDE; + virtual int32_t SetLength(int64_t length, + PP_CompletionCallback callback) OVERRIDE; + virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE; + virtual void Close() OVERRIDE; + virtual int32_t GetOSFileDescriptor() OVERRIDE; + virtual int32_t WillWrite(int64_t offset, + int32_t bytes_to_write, + PP_CompletionCallback callback) OVERRIDE; + virtual int32_t WillSetLength(int64_t length, + PP_CompletionCallback callback) OVERRIDE; private: // Verifies: |