diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-01 05:51:27 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-01 05:51:27 +0000 |
commit | 4697f72f5bdb2ead8aa9051b47fb0fade5acd1f5 (patch) | |
tree | 4b27e9a2b6f932059c57c20aed2f4841f5a15d0a /ppapi/thunk | |
parent | 2f89b6045896d8e8efc3984da72c3bf4c63d6e0f (diff) | |
download | chromium_src-4697f72f5bdb2ead8aa9051b47fb0fade5acd1f5.zip chromium_src-4697f72f5bdb2ead8aa9051b47fb0fade5acd1f5.tar.gz chromium_src-4697f72f5bdb2ead8aa9051b47fb0fade5acd1f5.tar.bz2 |
Revert 87415 - 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
TBR=brettw@chromium.org
Review URL: http://codereview.chromium.org/7006022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87438 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r-- | ppapi/thunk/enter.h | 16 | ||||
-rw-r--r-- | ppapi/thunk/ppb_directory_reader_api.h | 22 | ||||
-rw-r--r-- | ppapi/thunk/ppb_directory_reader_thunk.cc | 52 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_chooser_api.h | 22 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_chooser_thunk.cc | 59 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_io_api.h | 48 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_io_thunk.cc | 124 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_io_trusted_thunk.cc | 57 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_ref_api.h | 32 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_ref_thunk.cc | 115 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_system_api.h | 23 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_system_thunk.cc | 60 | ||||
-rw-r--r-- | ppapi/thunk/ppb_find_api.h | 29 | ||||
-rw-r--r-- | ppapi/thunk/ppb_find_thunk.cc | 42 | ||||
-rw-r--r-- | ppapi/thunk/resource_creation_api.h | 11 | ||||
-rw-r--r-- | ppapi/thunk/thunk.h | 14 |
16 files changed, 0 insertions, 726 deletions
diff --git a/ppapi/thunk/enter.h b/ppapi/thunk/enter.h index dc06381..b7e2f8b 100644 --- a/ppapi/thunk/enter.h +++ b/ppapi/thunk/enter.h @@ -52,11 +52,9 @@ class EnterFunction { bool succeeded() const { return !!functions_; } bool failed() const { return !functions_; } - PP_Instance instance() const { return instance_; } FunctionsT* functions() { return functions_; } private: - PP_Instance instance_; FunctionsT* functions_; DISALLOW_COPY_AND_ASSIGN(EnterFunction); @@ -73,20 +71,6 @@ class EnterFunctionNoLock : public EnterFunction<FunctionsT> { } }; -// Used when a caller has a resource, and wants to do EnterFunction for the -// instance corresponding to that resource. -template<typename FunctionsT> -class EnterFunctionGivenResource : public EnterFunction<FunctionsT> { - public: - EnterFunctionGivenResource(PP_Resource resource, bool report_error) - : EnterFunction<FunctionsT>( - TrackerBase::Get()->GetInstanceForResource(resource), - report_error) { - } -}; - -// EnterResource --------------------------------------------------------------- - template<typename ResourceT> class EnterResource { public: diff --git a/ppapi/thunk/ppb_directory_reader_api.h b/ppapi/thunk/ppb_directory_reader_api.h deleted file mode 100644 index b651a57..0000000 --- a/ppapi/thunk/ppb_directory_reader_api.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_THUNK_DIRECTORY_READER_API_H_ -#define PPAPI_THUNK_DIRECTORY_READER_API_H_ - -#include "ppapi/c/dev/ppb_directory_reader_dev.h" - -namespace ppapi { -namespace thunk { - -class PPB_DirectoryReader_API { - public: - virtual int32_t GetNextEntry(PP_DirectoryEntry_Dev* entry, - PP_CompletionCallback callback) = 0; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_DIRECTORY_READER_API_H_ diff --git a/ppapi/thunk/ppb_directory_reader_thunk.cc b/ppapi/thunk/ppb_directory_reader_thunk.cc deleted file mode 100644 index d1dfed4..0000000 --- a/ppapi/thunk/ppb_directory_reader_thunk.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/dev/ppb_directory_reader_dev.h" -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_directory_reader_api.h" -#include "ppapi/thunk/resource_creation_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -PP_Resource Create(PP_Resource directory_ref) { - EnterFunctionGivenResource<ResourceCreationAPI> enter(directory_ref, true); - if (enter.failed()) - return 0; - return enter.functions()->CreateDirectoryReader(directory_ref); -} - -PP_Bool IsDirectoryReader(PP_Resource resource) { - EnterResource<PPB_DirectoryReader_API> enter(resource, false); - return PP_FromBool(enter.succeeded()); -} - -int32_t GetNextEntry(PP_Resource directory_reader, - PP_DirectoryEntry_Dev* entry, - PP_CompletionCallback callback) { - EnterResource<PPB_DirectoryReader_API> enter(directory_reader, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->GetNextEntry(entry, callback); -} - -const PPB_DirectoryReader_Dev g_ppb_directory_reader_thunk = { - &Create, - &IsDirectoryReader, - &GetNextEntry -}; - -} // namespace - -const PPB_DirectoryReader_Dev* GetPPB_DirectoryReader_Thunk() { - return &g_ppb_directory_reader_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/ppb_file_chooser_api.h b/ppapi/thunk/ppb_file_chooser_api.h deleted file mode 100644 index cc54527..0000000 --- a/ppapi/thunk/ppb_file_chooser_api.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_THUNK_PPB_FILE_CHOOSER_API_H_ -#define PPAPI_THUNK_PPB_FILE_CHOOSER_API_H_ - -#include "ppapi/c/dev/ppb_file_chooser_dev.h" - -namespace ppapi { -namespace thunk { - -class PPB_FileChooser_API { - public: - virtual int32_t Show(PP_CompletionCallback callback) = 0; - virtual PP_Resource GetNextChosenFile() = 0; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_PPB_FILE_CHOOSER_API_H_ diff --git a/ppapi/thunk/ppb_file_chooser_thunk.cc b/ppapi/thunk/ppb_file_chooser_thunk.cc deleted file mode 100644 index 8389725..0000000 --- a/ppapi/thunk/ppb_file_chooser_thunk.cc +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/dev/ppb_file_chooser_dev.h" -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_file_chooser_api.h" -#include "ppapi/thunk/resource_creation_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -PP_Resource Create(PP_Instance instance, - const PP_FileChooserOptions_Dev* options) { - EnterFunction<ResourceCreationAPI> enter(instance, true); - if (enter.failed()) - return 0; - return enter.functions()->CreateFileChooser(instance, options); -} - -PP_Bool IsFileChooser(PP_Resource resource) { - EnterResource<PPB_FileChooser_API> enter(resource, false); - return PP_FromBool(enter.succeeded()); -} - -int32_t Show(PP_Resource chooser, PP_CompletionCallback callback) { - EnterResource<PPB_FileChooser_API> enter(chooser, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Show(callback); -} - -PP_Resource GetNextChosenFile(PP_Resource chooser) { - EnterResource<PPB_FileChooser_API> enter(chooser, true); - if (enter.failed()) - return 0; - return enter.object()->GetNextChosenFile(); -} - -const PPB_FileChooser_Dev g_ppb_file_chooser_thunk = { - &Create, - &IsFileChooser, - &Show, - &GetNextChosenFile -}; - -} // namespace - -const PPB_FileChooser_Dev* GetPPB_FileChooser_Thunk() { - return &g_ppb_file_chooser_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/ppb_file_io_api.h b/ppapi/thunk/ppb_file_io_api.h deleted file mode 100644 index 123e4c2..0000000 --- a/ppapi/thunk/ppb_file_io_api.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_THUNK_PPB_FILE_IO_API_H_ -#define PPAPI_THUNK_PPB_FILE_IO_API_H_ - -#include "ppapi/c/dev/ppb_file_io_dev.h" - -namespace ppapi { -namespace thunk { - -class PPB_FileIO_API { - public: - virtual int32_t Open(PP_Resource file_ref, - int32_t open_flags, - PP_CompletionCallback callback) = 0; - virtual int32_t Query(PP_FileInfo_Dev* info, - PP_CompletionCallback callback) = 0; - virtual int32_t Touch(PP_Time last_access_time, - PP_Time last_modified_time, - PP_CompletionCallback callback) = 0; - virtual int32_t Read(int64_t offset, - char* buffer, - int32_t bytes_to_read, - PP_CompletionCallback callback) = 0; - virtual int32_t Write(int64_t offset, - const char* buffer, - int32_t bytes_to_write, - PP_CompletionCallback callback) = 0; - virtual int32_t SetLength(int64_t length, - PP_CompletionCallback callback) = 0; - virtual int32_t Flush(PP_CompletionCallback callback) = 0; - virtual void Close() = 0; - - // Trusted API. - virtual int32_t GetOSFileDescriptor() = 0; - virtual int32_t WillWrite(int64_t offset, - int32_t bytes_to_write, - PP_CompletionCallback callback) = 0; - virtual int32_t WillSetLength(int64_t length, - PP_CompletionCallback callback) = 0; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_PPB_FILE_IO_API_H_ diff --git a/ppapi/thunk/ppb_file_io_thunk.cc b/ppapi/thunk/ppb_file_io_thunk.cc deleted file mode 100644 index 2aaaaa4..0000000 --- a/ppapi/thunk/ppb_file_io_thunk.cc +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/dev/ppb_file_io_dev.h" -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_file_io_api.h" -#include "ppapi/thunk/resource_creation_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -PP_Resource Create(PP_Instance instance) { - EnterFunction<ResourceCreationAPI> enter(instance, true); - if (enter.failed()) - return 0; - return enter.functions()->CreateFileIO(instance); -} - -PP_Bool IsFileIO(PP_Resource resource) { - EnterResource<PPB_FileIO_API> enter(resource, false); - return PP_FromBool(enter.succeeded()); -} - -int32_t Open(PP_Resource file_io, - PP_Resource file_ref, - int32_t open_flags, - PP_CompletionCallback callback) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Open(file_ref, open_flags, callback); -} - -int32_t Query(PP_Resource file_io, - PP_FileInfo_Dev* info, - PP_CompletionCallback callback) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Query(info, callback); -} - -int32_t Touch(PP_Resource file_io, - PP_Time last_access_time, - PP_Time last_modified_time, - PP_CompletionCallback callback) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Touch(last_access_time, last_modified_time, callback); -} - -int32_t Read(PP_Resource file_io, - int64_t offset, - char* buffer, - int32_t bytes_to_read, - PP_CompletionCallback callback) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Read(offset, buffer, bytes_to_read, callback); -} - -int32_t Write(PP_Resource file_io, - int64_t offset, - const char* buffer, - int32_t bytes_to_write, - PP_CompletionCallback callback) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Write(offset, buffer, bytes_to_write, callback); -} - -int32_t SetLength(PP_Resource file_io, - int64_t length, - PP_CompletionCallback callback) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->SetLength(length, callback); -} - -int32_t Flush(PP_Resource file_io, - PP_CompletionCallback callback) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Flush(callback); -} - -void Close(PP_Resource file_io) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.succeeded()) - enter.object()->Close(); -} - -const PPB_FileIO_Dev g_ppb_file_io_thunk = { - &Create, - &IsFileIO, - &Open, - &Query, - &Touch, - &Read, - &Write, - &SetLength, - &Flush, - &Close -}; - -} // namespace - -const PPB_FileIO_Dev* GetPPB_FileIO_Thunk() { - return &g_ppb_file_io_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/ppb_file_io_trusted_thunk.cc b/ppapi/thunk/ppb_file_io_trusted_thunk.cc deleted file mode 100644 index 1cba025..0000000 --- a/ppapi/thunk/ppb_file_io_trusted_thunk.cc +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/dev/ppb_file_io_trusted_dev.h" -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_file_io_api.h" -#include "ppapi/thunk/resource_creation_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -int32_t GetOSFileDescriptor(PP_Resource file_io) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->GetOSFileDescriptor(); -} - -int32_t WillWrite(PP_Resource file_io, - int64_t offset, - int32_t bytes_to_write, - PP_CompletionCallback callback) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->WillWrite(offset, bytes_to_write, callback); -} - -int32_t WillSetLength(PP_Resource file_io, - int64_t length, - PP_CompletionCallback callback) { - EnterResource<PPB_FileIO_API> enter(file_io, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->WillSetLength(length, callback); -} - -const PPB_FileIOTrusted_Dev g_ppb_file_io_trusted_thunk = { - &GetOSFileDescriptor, - &WillWrite, - &WillSetLength -}; - -} // namespace - -const PPB_FileIOTrusted_Dev* GetPPB_FileIOTrusted_Thunk() { - return &g_ppb_file_io_trusted_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/ppb_file_ref_api.h b/ppapi/thunk/ppb_file_ref_api.h deleted file mode 100644 index 936fa3d..0000000 --- a/ppapi/thunk/ppb_file_ref_api.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_THUNK_PPB_FILE_REF_API_H_ -#define PPAPI_THUNK_PPB_FILE_REF_API_H_ - -#include "ppapi/c/dev/ppb_file_ref_dev.h" - -namespace ppapi { -namespace thunk { - -class PPB_FileRef_API { - public: - virtual PP_FileSystemType_Dev GetFileSystemType() const = 0; - virtual PP_Var GetName() const = 0; - virtual PP_Var GetPath() const = 0; - virtual PP_Resource GetParent() = 0; - virtual int32_t MakeDirectory(PP_Bool make_ancestors, - PP_CompletionCallback callback) = 0; - virtual int32_t Touch(PP_Time last_access_time, - PP_Time last_modified_time, - PP_CompletionCallback callback) = 0; - virtual int32_t Delete(PP_CompletionCallback callback) = 0; - virtual int32_t Rename(PP_Resource new_file_ref, - PP_CompletionCallback callback) = 0; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_PPB_FILE_REF_API_H_ diff --git a/ppapi/thunk/ppb_file_ref_thunk.cc b/ppapi/thunk/ppb_file_ref_thunk.cc deleted file mode 100644 index aeac135..0000000 --- a/ppapi/thunk/ppb_file_ref_thunk.cc +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/dev/pp_file_info_dev.h" -#include "ppapi/c/dev/ppb_file_ref_dev.h" -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_file_ref_api.h" -#include "ppapi/thunk/resource_creation_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -PP_Resource Create(PP_Resource file_system, const char* path) { - EnterFunctionGivenResource<ResourceCreationAPI> enter(file_system, true); - if (enter.failed()) - return 0; - return enter.functions()->CreateFileRef(file_system, path); -} - -PP_Bool IsFileRef(PP_Resource resource) { - EnterResource<PPB_FileRef_API> enter(resource, false); - return PP_FromBool(enter.succeeded()); -} - -PP_FileSystemType_Dev GetFileSystemType(PP_Resource file_ref) { - EnterResource<PPB_FileRef_API> enter(file_ref, true); - if (enter.failed()) - return PP_FILESYSTEMTYPE_INVALID; - return enter.object()->GetFileSystemType(); -} - -PP_Var GetName(PP_Resource file_ref) { - EnterResource<PPB_FileRef_API> enter(file_ref, true); - if (enter.failed()) - return PP_MakeUndefined(); - return enter.object()->GetName(); -} - -PP_Var GetPath(PP_Resource file_ref) { - EnterResource<PPB_FileRef_API> enter(file_ref, true); - if (enter.failed()) - return PP_MakeUndefined(); - return enter.object()->GetPath(); -} - -PP_Resource GetParent(PP_Resource file_ref) { - EnterResource<PPB_FileRef_API> enter(file_ref, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->GetParent(); -} - -int32_t MakeDirectory(PP_Resource directory_ref, - PP_Bool make_ancestors, - PP_CompletionCallback callback) { - EnterResource<PPB_FileRef_API> enter(directory_ref, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->MakeDirectory(make_ancestors, callback); -} - -int32_t Touch(PP_Resource file_ref, - PP_Time last_access_time, - PP_Time last_modified_time, - PP_CompletionCallback callback) { - EnterResource<PPB_FileRef_API> enter(file_ref, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Touch(last_access_time, last_modified_time, callback); -} - -int32_t Delete(PP_Resource file_ref, - PP_CompletionCallback callback) { - EnterResource<PPB_FileRef_API> enter(file_ref, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Delete(callback); -} - -int32_t Rename(PP_Resource file_ref, - PP_Resource new_file_ref, - PP_CompletionCallback callback) { - EnterResource<PPB_FileRef_API> enter(file_ref, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Rename(new_file_ref, callback); -} - -const PPB_FileRef_Dev g_ppb_file_ref_thunk = { - &Create, - &IsFileRef, - &GetFileSystemType, - &GetName, - &GetPath, - &GetParent, - &MakeDirectory, - &Touch, - &Delete, - &Rename -}; - -} // namespace - -const PPB_FileRef_Dev* GetPPB_FileRef_Thunk() { - return &g_ppb_file_ref_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/ppb_file_system_api.h b/ppapi/thunk/ppb_file_system_api.h deleted file mode 100644 index 097d53f..0000000 --- a/ppapi/thunk/ppb_file_system_api.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_THUNK_PPB_FILE_SYSTEM_API_H_ -#define PPAPI_THUNK_PPB_FILE_SYSTEM_API_H_ - -#include "ppapi/c/dev/ppb_file_system_dev.h" - -namespace ppapi { -namespace thunk { - -class PPB_FileSystem_API { - public: - virtual int32_t Open(int64_t expected_size, - PP_CompletionCallback callback) = 0; - virtual PP_FileSystemType_Dev GetType() = 0; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_PPB_FILE_SYSTEM_API_H_ diff --git a/ppapi/thunk/ppb_file_system_thunk.cc b/ppapi/thunk/ppb_file_system_thunk.cc deleted file mode 100644 index e1c4f6a..0000000 --- a/ppapi/thunk/ppb_file_system_thunk.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/dev/ppb_file_system_dev.h" -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_file_system_api.h" -#include "ppapi/thunk/resource_creation_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -PP_Resource Create(PP_Instance instance, PP_FileSystemType_Dev type) { - EnterFunction<ResourceCreationAPI> enter(instance, true); - if (enter.failed()) - return 0; - return enter.functions()->CreateFileSystem(instance, type); -} - -PP_Bool IsFileSystem(PP_Resource resource) { - EnterResource<PPB_FileSystem_API> enter(resource, false); - return PP_FromBool(enter.succeeded()); -} - -int32_t Open(PP_Resource file_system, - int64 expected_size, - PP_CompletionCallback callback) { - EnterResource<PPB_FileSystem_API> enter(file_system, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Open(expected_size, callback); -} - -PP_FileSystemType_Dev GetType(PP_Resource file_system) { - EnterResource<PPB_FileSystem_API> enter(file_system, true); - if (enter.failed()) - return PP_FILESYSTEMTYPE_INVALID; - return enter.object()->GetType(); -} - -const PPB_FileSystem_Dev g_ppb_file_system_thunk = { - &Create, - &IsFileSystem, - &Open, - &GetType -}; - -} // namespace - -const PPB_FileSystem_Dev* GetPPB_FileSystem_Thunk() { - return &g_ppb_file_system_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/ppb_find_api.h b/ppapi/thunk/ppb_find_api.h deleted file mode 100644 index 2c0e058..0000000 --- a/ppapi/thunk/ppb_find_api.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_THUNK_PPB_FIND_API_H_ -#define PPAPI_THUNK_PPB_FIND_API_H_ - -#include "ppapi/c/dev/ppb_find_dev.h" -#include "ppapi/proxy/interface_id.h" - -namespace ppapi { -namespace thunk { - -class PPB_Find_FunctionAPI { - public: - static const ::pp::proxy::InterfaceID interface_id = - ::pp::proxy::INTERFACE_ID_PPB_FIND; - - virtual void NumberOfFindResultsChanged(PP_Instance instance, - int32_t total, - PP_Bool final_result) = 0; - virtual void SelectedFindResultChanged(PP_Instance instance, - int32_t index) = 0; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_PPB_FIND_API_H_ diff --git a/ppapi/thunk/ppb_find_thunk.cc b/ppapi/thunk/ppb_find_thunk.cc deleted file mode 100644 index e37e8ed..0000000 --- a/ppapi/thunk/ppb_find_thunk.cc +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/dev/ppb_find_dev.h" -#include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_find_api.h" -#include "ppapi/thunk/resource_creation_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -void NumberOfFindResultsChanged(PP_Instance instance, - int32_t total, - PP_Bool final) { - EnterFunction<PPB_Find_FunctionAPI> enter(instance, true); - if (enter.succeeded()) - enter.functions()->NumberOfFindResultsChanged(instance, total, final); -} - -void SelectedFindResultChanged(PP_Instance instance, int32_t index) { - EnterFunction<PPB_Find_FunctionAPI> enter(instance, true); - if (enter.succeeded()) - enter.functions()->SelectedFindResultChanged(instance, index); -} - -const PPB_Find_Dev g_ppb_find_thunk = { - &NumberOfFindResultsChanged, - &SelectedFindResultChanged -}; - -} // namespace - -const PPB_Find_Dev* GetPPB_Find_Thunk() { - return &g_ppb_find_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h index 8a8cefc..d25285f 100644 --- a/ppapi/thunk/resource_creation_api.h +++ b/ppapi/thunk/resource_creation_api.h @@ -5,8 +5,6 @@ #ifndef PPAPI_THUNK_RESOURCE_CREATION_API_H_ #define PPAPI_THUNK_RESOURCE_CREATION_API_H_ -#include "ppapi/c/dev/ppb_file_chooser_dev.h" -#include "ppapi/c/dev/ppb_file_system_dev.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_resource.h" @@ -41,15 +39,6 @@ class ResourceCreationAPI { uint32_t sample_frame_count) = 0; virtual PP_Resource CreateBroker(PP_Instance instance) = 0; virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) = 0; - virtual PP_Resource CreateDirectoryReader(PP_Resource directory_ref) = 0; - virtual PP_Resource CreateFileChooser( - PP_Instance instance, - const PP_FileChooserOptions_Dev* options) = 0; - virtual PP_Resource CreateFileIO(PP_Instance instance) = 0; - virtual PP_Resource CreateFileRef(PP_Resource file_system, - const char* path) = 0; - virtual PP_Resource CreateFileSystem(PP_Instance instance, - PP_FileSystemType_Dev type) = 0; // Note: can't be called CreateFont due to Windows #defines. virtual PP_Resource CreateFontObject( PP_Instance instance, diff --git a/ppapi/thunk/thunk.h b/ppapi/thunk/thunk.h index 1738edd..647f6eb 100644 --- a/ppapi/thunk/thunk.h +++ b/ppapi/thunk/thunk.h @@ -12,13 +12,6 @@ struct PPB_BrokerTrusted; struct PPB_Buffer_Dev; struct PPB_CharSet_Dev; struct PPB_CursorControl_Dev; -struct PPB_DirectoryReader_Dev; -struct PPB_FileChooser_Dev; -struct PPB_FileIO_Dev; -struct PPB_FileIOTrusted_Dev; -struct PPB_FileRef_Dev; -struct PPB_FileSystem_Dev; -struct PPB_Find_Dev; struct PPB_Font_Dev; struct PPB_Graphics2D; struct PPB_ImageData; @@ -33,13 +26,6 @@ const PPB_BrokerTrusted* GetPPB_Broker_Thunk(); const PPB_Buffer_Dev* GetPPB_Buffer_Thunk(); const PPB_CharSet_Dev* GetPPB_CharSet_Thunk(); const PPB_CursorControl_Dev* GetPPB_CursorControl_Thunk(); -const PPB_DirectoryReader_Dev* GetPPB_DirectoryReader_Thunk(); -const PPB_FileChooser_Dev* GetPPB_FileChooser_Thunk(); -const PPB_FileIO_Dev* GetPPB_FileIO_Thunk(); -const PPB_FileIOTrusted_Dev* GetPPB_FileIOTrusted_Thunk(); -const PPB_FileRef_Dev* GetPPB_FileRef_Thunk(); -const PPB_FileSystem_Dev* GetPPB_FileSystem_Thunk(); -const PPB_Find_Dev* GetPPB_Find_Thunk(); const PPB_Font_Dev* GetPPB_Font_Thunk(); const PPB_Graphics2D* GetPPB_Graphics2D_Thunk(); const PPB_ImageData* GetPPB_ImageData_Thunk(); |