diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 01:31:07 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 01:31:07 +0000 |
commit | 81870ae8c94f96486435a11a490fa53e4dafb096 (patch) | |
tree | e4ce9353aec4ae676710e139381169b6a4965014 /webkit/glue | |
parent | f58bddab858b88bddd77d7ef8d01a4a2eea55364 (diff) | |
download | chromium_src-81870ae8c94f96486435a11a490fa53e4dafb096.zip chromium_src-81870ae8c94f96486435a11a490fa53e4dafb096.tar.gz chromium_src-81870ae8c94f96486435a11a490fa53e4dafb096.tar.bz2 |
Pull new PPAPI, rename non-P0 interfaces to Dev, rename DeviceContext2D to Graphics2D.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/3255003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57825 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
43 files changed, 346 insertions, 352 deletions
diff --git a/webkit/glue/plugins/pepper_buffer.cc b/webkit/glue/plugins/pepper_buffer.cc index 7cd0195..c3acef8 100644 --- a/webkit/glue/plugins/pepper_buffer.cc +++ b/webkit/glue/plugins/pepper_buffer.cc @@ -8,10 +8,10 @@ #include "base/logging.h" #include "base/scoped_ptr.h" +#include "third_party/ppapi/c/dev/ppb_buffer_dev.h" #include "third_party/ppapi/c/pp_instance.h" #include "third_party/ppapi/c/pp_module.h" #include "third_party/ppapi/c/pp_resource.h" -#include "third_party/ppapi/c/ppb_buffer.h" #include "webkit/glue/plugins/pepper_plugin_instance.h" #include "webkit/glue/plugins/pepper_plugin_module.h" @@ -57,7 +57,7 @@ void Unmap(PP_Resource resource) { return buffer->Unmap(); } -const PPB_Buffer ppb_buffer = { +const PPB_Buffer_Dev ppb_buffer = { &Create, &IsBuffer, &Describe, @@ -76,7 +76,7 @@ Buffer::~Buffer() { } // static -const PPB_Buffer* Buffer::GetInterface() { +const PPB_Buffer_Dev* Buffer::GetInterface() { return &ppb_buffer; } diff --git a/webkit/glue/plugins/pepper_buffer.h b/webkit/glue/plugins/pepper_buffer.h index 5d750ec..2f20e55 100644 --- a/webkit/glue/plugins/pepper_buffer.h +++ b/webkit/glue/plugins/pepper_buffer.h @@ -7,9 +7,10 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" -#include "third_party/ppapi/c/ppb_buffer.h" #include "webkit/glue/plugins/pepper_resource.h" +struct PPB_Buffer_Dev; + namespace pepper { class PluginInstance; @@ -28,7 +29,7 @@ class Buffer : public Resource { // Returns a pointer to the interface implementing PPB_Buffer that is // exposed to the plugin. - static const PPB_Buffer* GetInterface(); + static const PPB_Buffer_Dev* GetInterface(); // Resource overrides. Buffer* AsBuffer() { return this; } diff --git a/webkit/glue/plugins/pepper_cursor_control.cc b/webkit/glue/plugins/pepper_cursor_control.cc index 055e190..997efef 100644 --- a/webkit/glue/plugins/pepper_cursor_control.cc +++ b/webkit/glue/plugins/pepper_cursor_control.cc @@ -6,10 +6,10 @@ #include "base/logging.h" #include "base/ref_counted.h" -#include "third_party/ppapi/c/pp_cursor_type.h" +#include "third_party/ppapi/c/dev/pp_cursor_type_dev.h" +#include "third_party/ppapi/c/dev/ppb_cursor_control_dev.h" #include "third_party/ppapi/c/pp_point.h" #include "third_party/ppapi/c/pp_resource.h" -#include "third_party/ppapi/c/ppb_cursor_control.h" #include "webkit/glue/plugins/pepper_image_data.h" #include "webkit/glue/plugins/pepper_plugin_instance.h" #include "webkit/glue/plugins/pepper_resource.h" @@ -19,7 +19,7 @@ namespace pepper { namespace { bool SetCursor(PP_Instance instance_id, - PP_CursorType type, + PP_CursorType_Dev type, PP_Resource custom_image_id, const PP_Point* hot_spot) { PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); @@ -73,7 +73,7 @@ bool CanLockCursor(PP_Instance) { return false; } -const PPB_CursorControl cursor_control_interface = { +const PPB_CursorControl_Dev cursor_control_interface = { &SetCursor, &LockCursor, &UnlockCursor, @@ -83,7 +83,7 @@ const PPB_CursorControl cursor_control_interface = { } // namespace -const PPB_CursorControl* GetCursorControlInterface() { +const PPB_CursorControl_Dev* GetCursorControlInterface() { return &cursor_control_interface; } diff --git a/webkit/glue/plugins/pepper_cursor_control.h b/webkit/glue/plugins/pepper_cursor_control.h index f3e09e1..693fb4a 100644 --- a/webkit/glue/plugins/pepper_cursor_control.h +++ b/webkit/glue/plugins/pepper_cursor_control.h @@ -5,13 +5,13 @@ #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_CURSOR_CONTROL_H_ #define WEBKIT_GLUE_PLUGINS_PEPPER_CURSOR_CONTROL_H_ -typedef struct _ppb_CursorControl PPB_CursorControl; +struct PPB_CursorControl_Dev; namespace pepper { // There's no class implementing CursorControl so we just expose a getter for // the interface implemented in the .cc file here. -const PPB_CursorControl* GetCursorControlInterface(); +const PPB_CursorControl_Dev* GetCursorControlInterface(); } // namespace pepper diff --git a/webkit/glue/plugins/pepper_directory_reader.cc b/webkit/glue/plugins/pepper_directory_reader.cc index 93f19eef..bcf2533 100644 --- a/webkit/glue/plugins/pepper_directory_reader.cc +++ b/webkit/glue/plugins/pepper_directory_reader.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "third_party/ppapi/c/pp_completion_callback.h" +#include "third_party/ppapi/c/dev/ppb_directory_reader_dev.h" #include "third_party/ppapi/c/pp_errors.h" #include "webkit/glue/plugins/pepper_file_ref.h" #include "webkit/glue/plugins/pepper_resource_tracker.h" @@ -29,7 +30,7 @@ bool IsDirectoryReader(PP_Resource resource) { } int32_t GetNextEntry(PP_Resource reader_id, - PP_DirectoryEntry* entry, + PP_DirectoryEntry_Dev* entry, PP_CompletionCallback callback) { scoped_refptr<DirectoryReader> reader( Resource::GetAs<DirectoryReader>(reader_id)); @@ -39,7 +40,7 @@ int32_t GetNextEntry(PP_Resource reader_id, return reader->GetNextEntry(entry, callback); } -const PPB_DirectoryReader ppb_directoryreader = { +const PPB_DirectoryReader_Dev ppb_directoryreader = { &Create, &IsDirectoryReader, &GetNextEntry @@ -55,11 +56,11 @@ DirectoryReader::DirectoryReader(FileRef* directory_ref) DirectoryReader::~DirectoryReader() { } -const PPB_DirectoryReader* DirectoryReader::GetInterface() { +const PPB_DirectoryReader_Dev* DirectoryReader::GetInterface() { return &ppb_directoryreader; } -int32_t DirectoryReader::GetNextEntry(PP_DirectoryEntry* entry, +int32_t DirectoryReader::GetNextEntry(PP_DirectoryEntry_Dev* entry, PP_CompletionCallback callback) { NOTIMPLEMENTED(); // TODO(darin): Implement me! return PP_ERROR_FAILED; diff --git a/webkit/glue/plugins/pepper_directory_reader.h b/webkit/glue/plugins/pepper_directory_reader.h index c477a3e..a56d546 100644 --- a/webkit/glue/plugins/pepper_directory_reader.h +++ b/webkit/glue/plugins/pepper_directory_reader.h @@ -5,9 +5,12 @@ #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_DIRECTORY_READER_H_ #define WEBKIT_GLUE_PLUGINS_PEPPER_DIRECTORY_READER_H_ -#include "third_party/ppapi/c/ppb_directory_reader.h" #include "webkit/glue/plugins/pepper_resource.h" +struct PP_CompletionCallback; +struct PP_DirectoryEntry_Dev; +struct PPB_DirectoryReader_Dev; + namespace pepper { class FileRef; @@ -19,13 +22,13 @@ class DirectoryReader : public Resource { // Returns a pointer to the interface implementing PPB_DirectoryReader that // is exposed to the plugin. - static const PPB_DirectoryReader* GetInterface(); + static const PPB_DirectoryReader_Dev* GetInterface(); // Resource overrides. DirectoryReader* AsDirectoryReader() { return this; } // PPB_DirectoryReader implementation. - int32_t GetNextEntry(PP_DirectoryEntry* entry, + int32_t GetNextEntry(PP_DirectoryEntry_Dev* entry, PP_CompletionCallback callback); private: diff --git a/webkit/glue/plugins/pepper_event_conversion.h b/webkit/glue/plugins/pepper_event_conversion.h index 2d699cd..3f3fa68 100644 --- a/webkit/glue/plugins/pepper_event_conversion.h +++ b/webkit/glue/plugins/pepper_event_conversion.h @@ -5,7 +5,7 @@ #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_EVENT_H_ #define WEBKIT_GLUE_PLUGINS_PEPPER_EVENT_H_ -typedef struct _pp_Event PP_Event; +struct PP_Event; namespace WebKit { class WebInputEvent; diff --git a/webkit/glue/plugins/pepper_file_chooser.cc b/webkit/glue/plugins/pepper_file_chooser.cc index 00b8786..138efd7 100644 --- a/webkit/glue/plugins/pepper_file_chooser.cc +++ b/webkit/glue/plugins/pepper_file_chooser.cc @@ -32,7 +32,7 @@ namespace pepper { namespace { PP_Resource Create(PP_Instance instance_id, - const PP_FileChooserOptions* options) { + const PP_FileChooserOptions_Dev* options) { PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); if (!instance) return 0; @@ -67,7 +67,7 @@ PP_Resource GetNextChosenFile(PP_Resource chooser_id) { return file_ref->GetReference(); } -const PPB_FileChooser ppb_filechooser = { +const PPB_FileChooser_Dev ppb_filechooser = { &Create, &IsFileChooser, &Show, @@ -98,7 +98,7 @@ class FileChooserCompletionImpl : public WebFileChooserCompletion { } // namespace FileChooser::FileChooser(PluginInstance* instance, - const PP_FileChooserOptions* options) + const PP_FileChooserOptions_Dev* options) : Resource(instance->module()), delegate_(instance->delegate()), mode_(options->mode), @@ -110,7 +110,7 @@ FileChooser::~FileChooser() { } // static -const PPB_FileChooser* FileChooser::GetInterface() { +const PPB_FileChooser_Dev* FileChooser::GetInterface() { return &ppb_filechooser; } diff --git a/webkit/glue/plugins/pepper_file_chooser.h b/webkit/glue/plugins/pepper_file_chooser.h index b0f24e8..eafdd0e 100644 --- a/webkit/glue/plugins/pepper_file_chooser.h +++ b/webkit/glue/plugins/pepper_file_chooser.h @@ -9,8 +9,8 @@ #include <vector> #include "base/scoped_ptr.h" +#include "third_party/ppapi/c/dev/ppb_file_chooser_dev.h" #include "third_party/ppapi/c/pp_completion_callback.h" -#include "third_party/ppapi/c/ppb_file_chooser.h" #include "webkit/glue/plugins/pepper_resource.h" namespace pepper { @@ -20,12 +20,13 @@ class PluginInstance; class FileChooser : public Resource { public: - FileChooser(PluginInstance* instance, const PP_FileChooserOptions* options); + FileChooser(PluginInstance* instance, + const PP_FileChooserOptions_Dev* options); virtual ~FileChooser(); // Returns a pointer to the interface implementing PPB_FileChooser that is // exposed to the plugin. - static const PPB_FileChooser* GetInterface(); + static const PPB_FileChooser_Dev* GetInterface(); // Resource overrides. FileChooser* AsFileChooser() { return this; } @@ -39,10 +40,10 @@ class FileChooser : public Resource { private: PluginDelegate* delegate_; - PP_FileChooserMode mode_; + PP_FileChooserMode_Dev mode_; std::string accept_mime_types_; PP_CompletionCallback completion_callback_; - std::vector<scoped_refptr<FileRef> > chosen_files_; + std::vector< scoped_refptr<FileRef> > chosen_files_; size_t next_chosen_file_index_; }; diff --git a/webkit/glue/plugins/pepper_file_io.cc b/webkit/glue/plugins/pepper_file_io.cc index 46f7276..c0aa92c 100644 --- a/webkit/glue/plugins/pepper_file_io.cc +++ b/webkit/glue/plugins/pepper_file_io.cc @@ -5,10 +5,10 @@ #include "webkit/glue/plugins/pepper_file_io.h" #include "base/logging.h" +#include "third_party/ppapi/c/dev/ppb_file_io_dev.h" +#include "third_party/ppapi/c/dev/ppb_file_io_trusted_dev.h" #include "third_party/ppapi/c/pp_completion_callback.h" #include "third_party/ppapi/c/pp_errors.h" -#include "third_party/ppapi/c/ppb_file_io.h" -#include "third_party/ppapi/c/ppb_file_io_trusted.h" #include "webkit/glue/plugins/pepper_file_ref.h" #include "webkit/glue/plugins/pepper_plugin_module.h" #include "webkit/glue/plugins/pepper_resource_tracker.h" @@ -46,12 +46,11 @@ int32_t Open(PP_Resource file_io_id, } int32_t Query(PP_Resource file_io_id, - PP_FileInfo* info, + PP_FileInfo_Dev* info, PP_CompletionCallback callback) { scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return PP_ERROR_BADRESOURCE; - return file_io->Query(info, callback); } @@ -62,7 +61,6 @@ int32_t Touch(PP_Resource file_io_id, scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return PP_ERROR_BADRESOURCE; - return file_io->Touch(last_access_time, last_modified_time, callback); } @@ -74,7 +72,6 @@ int32_t Read(PP_Resource file_io_id, scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return PP_ERROR_BADRESOURCE; - return file_io->Read(offset, buffer, bytes_to_read, callback); } @@ -86,7 +83,6 @@ int32_t Write(PP_Resource file_io_id, scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return PP_ERROR_BADRESOURCE; - return file_io->Write(offset, buffer, bytes_to_write, callback); } @@ -96,7 +92,6 @@ int32_t SetLength(PP_Resource file_io_id, scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return PP_ERROR_BADRESOURCE; - return file_io->SetLength(length, callback); } @@ -105,7 +100,6 @@ int32_t Flush(PP_Resource file_io_id, scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return PP_ERROR_BADRESOURCE; - return file_io->Flush(callback); } @@ -113,11 +107,10 @@ void Close(PP_Resource file_io_id) { scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return; - file_io->Close(); } -const PPB_FileIO ppb_fileio = { +const PPB_FileIO_Dev ppb_fileio = { &Create, &IsFileIO, &Open, @@ -134,7 +127,6 @@ int32_t GetOSFileDescriptor(PP_Resource file_io_id) { scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return PP_ERROR_BADRESOURCE; - return file_io->GetOSFileDescriptor(); } @@ -145,7 +137,6 @@ int32_t WillWrite(PP_Resource file_io_id, scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return PP_ERROR_BADRESOURCE; - return file_io->WillWrite(offset, bytes_to_write, callback); } @@ -155,11 +146,10 @@ int32_t WillSetLength(PP_Resource file_io_id, scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id)); if (!file_io) return PP_ERROR_BADRESOURCE; - return file_io->WillSetLength(length, callback); } -const PPB_FileIOTrusted ppb_fileiotrusted = { +const PPB_FileIOTrusted_Dev ppb_fileiotrusted = { &GetOSFileDescriptor, &WillWrite, &WillSetLength @@ -174,12 +164,12 @@ FileIO::~FileIO() { } // static -const PPB_FileIO* FileIO::GetInterface() { +const PPB_FileIO_Dev* FileIO::GetInterface() { return &ppb_fileio; } // static -const PPB_FileIOTrusted* FileIO::GetTrustedInterface() { +const PPB_FileIOTrusted_Dev* FileIO::GetTrustedInterface() { return &ppb_fileiotrusted; } @@ -190,7 +180,7 @@ int32_t FileIO::Open(FileRef* file_ref, return PP_ERROR_FAILED; } -int32_t FileIO::Query(PP_FileInfo* info, +int32_t FileIO::Query(PP_FileInfo_Dev* info, PP_CompletionCallback callback) { NOTIMPLEMENTED(); // TODO(darin): Implement me! return PP_ERROR_FAILED; diff --git a/webkit/glue/plugins/pepper_file_io.h b/webkit/glue/plugins/pepper_file_io.h index 4af6f2b..2d2eed2 100644 --- a/webkit/glue/plugins/pepper_file_io.h +++ b/webkit/glue/plugins/pepper_file_io.h @@ -8,10 +8,10 @@ #include "third_party/ppapi/c/pp_time.h" #include "webkit/glue/plugins/pepper_resource.h" -typedef struct _pp_CompletionCallback PP_CompletionCallback; -typedef struct _pp_FileInfo PP_FileInfo; -typedef struct _ppb_FileIO PPB_FileIO; -typedef struct _ppb_FileIOTrusted PPB_FileIOTrusted; +struct PP_CompletionCallback; +struct PP_FileInfo_Dev; +struct PPB_FileIO_Dev; +struct PPB_FileIOTrusted_Dev; namespace pepper { @@ -24,11 +24,11 @@ class FileIO : public Resource { // Returns a pointer to the interface implementing PPB_FileIO that is exposed // to the plugin. - static const PPB_FileIO* GetInterface(); + 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* GetTrustedInterface(); + static const PPB_FileIOTrusted_Dev* GetTrustedInterface(); // Resource overrides. FileIO* AsFileIO() { return this; } @@ -37,7 +37,7 @@ class FileIO : public Resource { int32_t Open(FileRef* file_ref, int32_t open_flags, PP_CompletionCallback callback); - int32_t Query(PP_FileInfo* info, + int32_t Query(PP_FileInfo_Dev* info, PP_CompletionCallback callback); int32_t Touch(PP_Time last_access_time, PP_Time last_modified_time, diff --git a/webkit/glue/plugins/pepper_file_ref.cc b/webkit/glue/plugins/pepper_file_ref.cc index a3181a9..3438c95 100644 --- a/webkit/glue/plugins/pepper_file_ref.cc +++ b/webkit/glue/plugins/pepper_file_ref.cc @@ -33,7 +33,7 @@ void TrimTrailingSlash(std::string* path) { } PP_Resource CreateFileRef(PP_Instance instance_id, - PP_FileSystemType fs_type, + PP_FileSystemType_Dev fs_type, const char* path) { PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); if (!instance) @@ -65,11 +65,10 @@ bool IsFileRef(PP_Resource resource) { return !!Resource::GetAs<FileRef>(resource); } -PP_FileSystemType GetFileSystemType(PP_Resource file_ref_id) { +PP_FileSystemType_Dev GetFileSystemType(PP_Resource file_ref_id) { scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id)); if (!file_ref) return PP_FILESYSTEMTYPE_EXTERNAL; - return file_ref->file_system_type(); } @@ -77,7 +76,6 @@ PP_Var GetName(PP_Resource file_ref_id) { scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id)); if (!file_ref) return PP_MakeVoid(); - return StringToPPVar(file_ref->GetName()); } @@ -107,7 +105,7 @@ PP_Resource GetParent(PP_Resource file_ref_id) { return parent_ref->GetReference(); } -const PPB_FileRef ppb_fileref = { +const PPB_FileRef_Dev ppb_fileref = { &CreatePersistentFileRef, &CreateTemporaryFileRef, &IsFileRef, @@ -120,7 +118,7 @@ const PPB_FileRef ppb_fileref = { } // namespace FileRef::FileRef(PluginModule* module, - PP_FileSystemType file_system_type, + PP_FileSystemType_Dev file_system_type, const std::string& validated_path, const std::string& origin) : Resource(module), @@ -141,7 +139,7 @@ FileRef::~FileRef() { } // static -const PPB_FileRef* FileRef::GetInterface() { +const PPB_FileRef_Dev* FileRef::GetInterface() { return &ppb_fileref; } diff --git a/webkit/glue/plugins/pepper_file_ref.h b/webkit/glue/plugins/pepper_file_ref.h index 52ef8cf..0fa8b149 100644 --- a/webkit/glue/plugins/pepper_file_ref.h +++ b/webkit/glue/plugins/pepper_file_ref.h @@ -8,7 +8,7 @@ #include <string> #include "base/file_path.h" -#include "third_party/ppapi/c/ppb_file_ref.h" +#include "third_party/ppapi/c/dev/ppb_file_ref_dev.h" #include "webkit/glue/plugins/pepper_resource.h" namespace pepper { @@ -18,7 +18,7 @@ class PluginModule; class FileRef : public Resource { public: FileRef(PluginModule* module, - PP_FileSystemType file_system_type, + PP_FileSystemType_Dev file_system_type, const std::string& validated_path, const std::string& origin); FileRef(PluginModule* module, @@ -27,7 +27,7 @@ class FileRef : public Resource { // Returns a pointer to the interface implementing PPB_FileRef that is // exposed to the plugin. - static const PPB_FileRef* GetInterface(); + static const PPB_FileRef_Dev* GetInterface(); // Resource overrides. FileRef* AsFileRef() { return this; } @@ -36,7 +36,7 @@ class FileRef : public Resource { std::string GetName() const; scoped_refptr<FileRef> GetParent(); - PP_FileSystemType file_system_type() const { return fs_type_; } + PP_FileSystemType_Dev file_system_type() const { return fs_type_; } // Returns the virtual path (i.e., the path that the pepper plugin sees) // corresponding to this file. @@ -47,7 +47,7 @@ class FileRef : public Resource { private: FilePath system_path_; - PP_FileSystemType fs_type_; + PP_FileSystemType_Dev fs_type_; std::string path_; // UTF-8 encoded. std::string origin_; }; diff --git a/webkit/glue/plugins/pepper_file_system.cc b/webkit/glue/plugins/pepper_file_system.cc index 678399e..475b3e1 100644 --- a/webkit/glue/plugins/pepper_file_system.cc +++ b/webkit/glue/plugins/pepper_file_system.cc @@ -4,9 +4,9 @@ #include "webkit/glue/plugins/pepper_file_system.h" +#include "third_party/ppapi/c/dev/ppb_file_system_dev.h" #include "third_party/ppapi/c/pp_completion_callback.h" #include "third_party/ppapi/c/pp_errors.h" -#include "third_party/ppapi/c/ppb_file_system.h" namespace pepper { @@ -19,7 +19,7 @@ int32_t MakeDirectory(PP_Resource directory_ref, } int32_t Query(PP_Resource file_ref, - PP_FileInfo* info, + PP_FileInfo_Dev* info, PP_CompletionCallback callback) { return PP_ERROR_FAILED; // TODO(darin): Implement me! } @@ -42,7 +42,7 @@ int32_t Rename(PP_Resource file_ref, return PP_ERROR_FAILED; // TODO(darin): Implement me! } -const PPB_FileSystem ppb_filesystem = { +const PPB_FileSystem_Dev ppb_filesystem = { &MakeDirectory, &Query, &Touch, @@ -52,7 +52,7 @@ const PPB_FileSystem ppb_filesystem = { } // namespace -const PPB_FileSystem* FileSystem::GetInterface() { +const PPB_FileSystem_Dev* FileSystem::GetInterface() { return &ppb_filesystem; } diff --git a/webkit/glue/plugins/pepper_file_system.h b/webkit/glue/plugins/pepper_file_system.h index b8ad01a9..b0a2f47 100644 --- a/webkit/glue/plugins/pepper_file_system.h +++ b/webkit/glue/plugins/pepper_file_system.h @@ -5,7 +5,7 @@ #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_FILE_SYSTEM_H_ #define WEBKIT_GLUE_PLUGINS_PEPPER_FILE_SYSTEM_H_ -typedef struct _ppb_FileSystem PPB_FileSystem; +struct PPB_FileSystem_Dev; namespace pepper { @@ -13,7 +13,7 @@ class FileSystem { public: // Returns a pointer to the interface implementing PPB_FileSystem that is // exposed to the plugin. - static const PPB_FileSystem* GetInterface(); + static const PPB_FileSystem_Dev* GetInterface(); }; } // namespace pepper diff --git a/webkit/glue/plugins/pepper_font.cc b/webkit/glue/plugins/pepper_font.cc index e30f0ce0..fbf334fa 100644 --- a/webkit/glue/plugins/pepper_font.cc +++ b/webkit/glue/plugins/pepper_font.cc @@ -6,8 +6,8 @@ #include "base/logging.h" #include "base/utf_string_conversions.h" +#include "third_party/ppapi/c/dev/ppb_font_dev.h" #include "third_party/ppapi/c/pp_rect.h" -#include "third_party/ppapi/c/ppb_font.h" #include "third_party/WebKit/WebKit/chromium/public/WebFont.h" #include "third_party/WebKit/WebKit/chromium/public/WebFontDescription.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" @@ -31,7 +31,7 @@ namespace pepper { namespace { -bool IsPPFontDescriptionValid(const PP_FontDescription& desc) { +bool IsPPFontDescriptionValid(const PP_FontDescription_Dev& desc) { // Check validity of UTF-8. if (desc.face.type != PP_VARTYPE_STRING && desc.face.type != PP_VARTYPE_VOID) return false; @@ -59,7 +59,7 @@ bool IsPPFontDescriptionValid(const PP_FontDescription& desc) { static_cast<WebFontDescription::GenericFamily>(f + 1) // Assumes the given PP_FontDescription has been validated. -WebFontDescription PPFontDescToWebFontDesc(const PP_FontDescription& font) { +WebFontDescription PPFontDescToWebFontDesc(const PP_FontDescription_Dev& font) { // Verify that the enums match so we can just static cast. COMPILE_ASSERT(static_cast<int>(WebFontDescription::Weight100) == static_cast<int>(PP_FONTWEIGHT_100), @@ -96,7 +96,7 @@ WebFontDescription PPFontDescToWebFontDesc(const PP_FontDescription& font) { // Converts the given PP_TextRun to a WebTextRun, returning true on success. // False means the input was invalid. -bool PPTextRunToWebTextRun(const PP_TextRun* run, WebTextRun* output) { +bool PPTextRunToWebTextRun(const PP_TextRun_Dev* run, WebTextRun* output) { String* text_string = GetString(run->text); if (!text_string) return false; @@ -106,7 +106,7 @@ bool PPTextRunToWebTextRun(const PP_TextRun* run, WebTextRun* output) { } PP_Resource Create(PP_Module module_id, - const PP_FontDescription* description) { + const PP_FontDescription_Dev* description) { PluginModule* module = PluginModule::FromPPModule(module_id); if (!module) return 0; @@ -123,8 +123,8 @@ bool IsFont(PP_Resource resource) { } bool Describe(PP_Resource font_id, - PP_FontDescription* description, - PP_FontMetrics* metrics) { + PP_FontDescription_Dev* description, + PP_FontMetrics_Dev* metrics) { scoped_refptr<Font> font(Resource::GetAs<Font>(font_id)); if (!font.get()) return false; @@ -133,7 +133,7 @@ bool Describe(PP_Resource font_id, bool DrawTextAt(PP_Resource font_id, PP_Resource image_data, - const PP_TextRun* text, + const PP_TextRun_Dev* text, const PP_Point* position, uint32_t color, const PP_Rect* clip, @@ -145,7 +145,7 @@ bool DrawTextAt(PP_Resource font_id, image_data_is_opaque); } -int32_t MeasureText(PP_Resource font_id, const PP_TextRun* text) { +int32_t MeasureText(PP_Resource font_id, const PP_TextRun_Dev* text) { scoped_refptr<Font> font(Resource::GetAs<Font>(font_id)); if (!font.get()) return -1; @@ -153,7 +153,7 @@ int32_t MeasureText(PP_Resource font_id, const PP_TextRun* text) { } uint32_t CharacterOffsetForPixel(PP_Resource font_id, - const PP_TextRun* text, + const PP_TextRun_Dev* text, int32_t pixel_position) { scoped_refptr<Font> font(Resource::GetAs<Font>(font_id)); if (!font.get()) @@ -162,7 +162,7 @@ uint32_t CharacterOffsetForPixel(PP_Resource font_id, } int32_t PixelOffsetForCharacter(PP_Resource font_id, - const PP_TextRun* text, + const PP_TextRun_Dev* text, uint32_t char_offset) { scoped_refptr<Font> font(Resource::GetAs<Font>(font_id)); if (!font.get()) @@ -170,7 +170,7 @@ int32_t PixelOffsetForCharacter(PP_Resource font_id, return font->PixelOffsetForCharacter(text, char_offset); } -const PPB_Font ppb_font = { +const PPB_Font_Dev ppb_font = { &Create, &IsFont, &Describe, @@ -182,7 +182,7 @@ const PPB_Font ppb_font = { } // namespace -Font::Font(PluginModule* module, const PP_FontDescription& desc) +Font::Font(PluginModule* module, const PP_FontDescription_Dev& desc) : Resource(module) { WebFontDescription web_font_desc = PPFontDescToWebFontDesc(desc); font_.reset(WebFont::create(web_font_desc)); @@ -192,12 +192,12 @@ Font::~Font() { } // static -const PPB_Font* Font::GetInterface() { +const PPB_Font_Dev* Font::GetInterface() { return &ppb_font; } -bool Font::Describe(PP_FontDescription* description, - PP_FontMetrics* metrics) { +bool Font::Describe(PP_FontDescription_Dev* description, + PP_FontMetrics_Dev* metrics) { if (description->face.type != PP_VARTYPE_VOID) return false; @@ -206,9 +206,9 @@ bool Font::Describe(PP_FontDescription* description, // While converting the other way in PPFontDescToWebFontDesc we validated // that the enums can be casted. description->face = StringToPPVar(UTF16ToUTF8(web_desc.family)); - description->family = static_cast<PP_FontFamily>(web_desc.genericFamily); + description->family = static_cast<PP_FontFamily_Dev>(web_desc.genericFamily); description->size = static_cast<uint32_t>(web_desc.size); - description->weight = static_cast<PP_FontWeight>(web_desc.weight); + description->weight = static_cast<PP_FontWeight_Dev>(web_desc.weight); description->italic = web_desc.italic; description->small_caps = web_desc.smallCaps; @@ -222,7 +222,7 @@ bool Font::Describe(PP_FontDescription* description, } bool Font::DrawTextAt(PP_Resource image_data, - const PP_TextRun* text, + const PP_TextRun_Dev* text, const PP_Point* position, uint32_t color, const PP_Rect* clip, @@ -257,14 +257,14 @@ bool Font::DrawTextAt(PP_Resource image_data, return true; } -int32_t Font::MeasureText(const PP_TextRun* text) { +int32_t Font::MeasureText(const PP_TextRun_Dev* text) { WebTextRun run; if (!PPTextRunToWebTextRun(text, &run)) return -1; return font_->calculateWidth(run); } -uint32_t Font::CharacterOffsetForPixel(const PP_TextRun* text, +uint32_t Font::CharacterOffsetForPixel(const PP_TextRun_Dev* text, int32_t pixel_position) { WebTextRun run; if (!PPTextRunToWebTextRun(text, &run)) @@ -274,7 +274,7 @@ uint32_t Font::CharacterOffsetForPixel(const PP_TextRun* text, run, static_cast<float>(pixel_position))); } -int32_t Font::PixelOffsetForCharacter(const PP_TextRun* text, +int32_t Font::PixelOffsetForCharacter(const PP_TextRun_Dev* text, uint32_t char_offset) { WebTextRun run; if (!PPTextRunToWebTextRun(text, &run)) diff --git a/webkit/glue/plugins/pepper_font.h b/webkit/glue/plugins/pepper_font.h index 269464a..34fe521 100644 --- a/webkit/glue/plugins/pepper_font.h +++ b/webkit/glue/plugins/pepper_font.h @@ -6,7 +6,7 @@ #define WEBKIT_GLUE_PLUGINS_PEPPER_FONT_H_ #include "base/scoped_ptr.h" -#include "third_party/ppapi/c/ppb_font.h" +#include "third_party/ppapi/c/dev/ppb_font_dev.h" #include "webkit/glue/plugins/pepper_resource.h" namespace WebKit { @@ -19,29 +19,29 @@ class PluginInstance; class Font : public Resource { public: - Font(PluginModule* module, const PP_FontDescription& desc); + Font(PluginModule* module, const PP_FontDescription_Dev& desc); virtual ~Font(); // Returns a pointer to the interface implementing PPB_Font that is exposed to // the plugin. - static const PPB_Font* GetInterface(); + static const PPB_Font_Dev* GetInterface(); // Resource overrides. Font* AsFont() { return this; } // PPB_Font implementation. - bool Describe(PP_FontDescription* description, - PP_FontMetrics* metrics); + bool Describe(PP_FontDescription_Dev* description, + PP_FontMetrics_Dev* metrics); bool DrawTextAt(PP_Resource image_data, - const PP_TextRun* text, + const PP_TextRun_Dev* text, const PP_Point* position, uint32_t color, const PP_Rect* clip, bool image_data_is_opaque); - int32_t MeasureText(const PP_TextRun* text); - uint32_t CharacterOffsetForPixel(const PP_TextRun* text, + int32_t MeasureText(const PP_TextRun_Dev* text); + uint32_t CharacterOffsetForPixel(const PP_TextRun_Dev* text, int32_t pixel_position); - int32_t PixelOffsetForCharacter(const PP_TextRun* text, + int32_t PixelOffsetForCharacter(const PP_TextRun_Dev* text, uint32_t char_offset); private: diff --git a/webkit/glue/plugins/pepper_device_context_2d.cc b/webkit/glue/plugins/pepper_graphics_2d.cc index 8407da3..049c17d 100644 --- a/webkit/glue/plugins/pepper_device_context_2d.cc +++ b/webkit/glue/plugins/pepper_graphics_2d.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/pepper_device_context_2d.h" +#include "webkit/glue/plugins/pepper_graphics_2d.h" #include <iterator> @@ -17,7 +17,7 @@ #include "third_party/ppapi/c/pp_module.h" #include "third_party/ppapi/c/pp_rect.h" #include "third_party/ppapi/c/pp_resource.h" -#include "third_party/ppapi/c/ppb_device_context_2d.h" +#include "third_party/ppapi/c/ppb_graphics_2d.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/plugins/pepper_image_data.h" #include "webkit/glue/plugins/pepper_plugin_instance.h" @@ -70,21 +70,21 @@ PP_Resource Create(PP_Module module_id, if (!module) return 0; - scoped_refptr<DeviceContext2D> context(new DeviceContext2D(module)); + scoped_refptr<Graphics2D> context(new Graphics2D(module)); if (!context->Init(size->width, size->height, is_always_opaque)) return 0; return context->GetReference(); } -bool IsDeviceContext2D(PP_Resource resource) { - return !!Resource::GetAs<DeviceContext2D>(resource); +bool IsGraphics2D(PP_Resource resource) { + return !!Resource::GetAs<Graphics2D>(resource); } bool Describe(PP_Resource device_context, PP_Size* size, bool* is_always_opaque) { - scoped_refptr<DeviceContext2D> context( - Resource::GetAs<DeviceContext2D>(device_context)); + scoped_refptr<Graphics2D> context( + Resource::GetAs<Graphics2D>(device_context)); if (!context) return false; return context->Describe(size, is_always_opaque); @@ -94,8 +94,8 @@ bool PaintImageData(PP_Resource device_context, PP_Resource image, const PP_Point* top_left, const PP_Rect* src_rect) { - scoped_refptr<DeviceContext2D> context( - Resource::GetAs<DeviceContext2D>(device_context)); + scoped_refptr<Graphics2D> context( + Resource::GetAs<Graphics2D>(device_context)); if (!context) return false; return context->PaintImageData(image, top_left, src_rect); @@ -104,16 +104,16 @@ bool PaintImageData(PP_Resource device_context, bool Scroll(PP_Resource device_context, const PP_Rect* clip_rect, const PP_Point* amount) { - scoped_refptr<DeviceContext2D> context( - Resource::GetAs<DeviceContext2D>(device_context)); + scoped_refptr<Graphics2D> context( + Resource::GetAs<Graphics2D>(device_context)); if (!context) return false; return context->Scroll(clip_rect, amount); } bool ReplaceContents(PP_Resource device_context, PP_Resource image) { - scoped_refptr<DeviceContext2D> context( - Resource::GetAs<DeviceContext2D>(device_context)); + scoped_refptr<Graphics2D> context( + Resource::GetAs<Graphics2D>(device_context)); if (!context) return false; return context->ReplaceContents(image); @@ -121,16 +121,16 @@ bool ReplaceContents(PP_Resource device_context, PP_Resource image) { int32_t Flush(PP_Resource device_context, PP_CompletionCallback callback) { - scoped_refptr<DeviceContext2D> context( - Resource::GetAs<DeviceContext2D>(device_context)); + scoped_refptr<Graphics2D> context( + Resource::GetAs<Graphics2D>(device_context)); if (!context) return PP_ERROR_BADRESOURCE; return context->Flush(callback); } -const PPB_DeviceContext2D ppb_devicecontext2d = { +const PPB_Graphics2D ppb_graphics_2d = { &Create, - &IsDeviceContext2D, + &IsGraphics2D, &Describe, &PaintImageData, &Scroll, @@ -140,7 +140,7 @@ const PPB_DeviceContext2D ppb_devicecontext2d = { } // namespace -struct DeviceContext2D::QueuedOperation { +struct Graphics2D::QueuedOperation { enum Type { PAINT, SCROLL, @@ -170,22 +170,22 @@ struct DeviceContext2D::QueuedOperation { scoped_refptr<ImageData> replace_image; }; -DeviceContext2D::DeviceContext2D(PluginModule* module) +Graphics2D::Graphics2D(PluginModule* module) : Resource(module), bound_instance_(NULL), flushed_any_data_(false), offscreen_flush_pending_(false) { } -DeviceContext2D::~DeviceContext2D() { +Graphics2D::~Graphics2D() { } // static -const PPB_DeviceContext2D* DeviceContext2D::GetInterface() { - return &ppb_devicecontext2d; +const PPB_Graphics2D* Graphics2D::GetInterface() { + return &ppb_graphics_2d; } -bool DeviceContext2D::Init(int width, int height, bool is_always_opaque) { +bool Graphics2D::Init(int width, int height, bool is_always_opaque) { // The underlying ImageData will validate the dimensions. image_data_ = new ImageData(module()); if (!image_data_->Init(PP_IMAGEDATAFORMAT_BGRA_PREMUL, width, height, true) || @@ -197,16 +197,16 @@ bool DeviceContext2D::Init(int width, int height, bool is_always_opaque) { return true; } -bool DeviceContext2D::Describe(PP_Size* size, bool* is_always_opaque) { +bool Graphics2D::Describe(PP_Size* size, bool* is_always_opaque) { size->width = image_data_->width(); size->height = image_data_->height(); *is_always_opaque = false; // TODO(brettw) implement this. return true; } -bool DeviceContext2D::PaintImageData(PP_Resource image, - const PP_Point* top_left, - const PP_Rect* src_rect) { +bool Graphics2D::PaintImageData(PP_Resource image, + const PP_Point* top_left, + const PP_Rect* src_rect) { if (!top_left) return false; @@ -240,8 +240,7 @@ bool DeviceContext2D::PaintImageData(PP_Resource image, return true; } -bool DeviceContext2D::Scroll(const PP_Rect* clip_rect, - const PP_Point* amount) { +bool Graphics2D::Scroll(const PP_Rect* clip_rect, const PP_Point* amount) { QueuedOperation operation(QueuedOperation::SCROLL); if (!ValidateAndConvertRect(clip_rect, image_data_->width(), @@ -264,7 +263,7 @@ bool DeviceContext2D::Scroll(const PP_Rect* clip_rect, return false; } -bool DeviceContext2D::ReplaceContents(PP_Resource image) { +bool Graphics2D::ReplaceContents(PP_Resource image) { scoped_refptr<ImageData> image_resource(Resource::GetAs<ImageData>(image)); if (!image_resource) return false; @@ -282,7 +281,7 @@ bool DeviceContext2D::ReplaceContents(PP_Resource image) { return true; } -int32_t DeviceContext2D::Flush(const PP_CompletionCallback& callback) { +int32_t Graphics2D::Flush(const PP_CompletionCallback& callback) { // Don't allow more than one pending flush at a time. if (HasPendingFlush()) return PP_ERROR_INPROGRESS; @@ -336,8 +335,8 @@ int32_t DeviceContext2D::Flush(const PP_CompletionCallback& callback) { return PP_ERROR_WOULDBLOCK; } -bool DeviceContext2D::ReadImageData(PP_Resource image, - const PP_Point* top_left) { +bool Graphics2D::ReadImageData(PP_Resource image, + const PP_Point* top_left) { // Get and validate the image object to paint into. scoped_refptr<ImageData> image_resource(Resource::GetAs<ImageData>(image)); if (!image_resource) @@ -378,7 +377,7 @@ bool DeviceContext2D::ReadImageData(PP_Resource image, return true; } -bool DeviceContext2D::BindToInstance(PluginInstance* new_instance) { +bool Graphics2D::BindToInstance(PluginInstance* new_instance) { if (bound_instance_ == new_instance) return true; // Rebinding the same device, nothing to do. if (bound_instance_ && new_instance) @@ -412,9 +411,9 @@ bool DeviceContext2D::BindToInstance(PluginInstance* new_instance) { return true; } -void DeviceContext2D::Paint(WebKit::WebCanvas* canvas, - const gfx::Rect& plugin_rect, - const gfx::Rect& paint_rect) { +void Graphics2D::Paint(WebKit::WebCanvas* canvas, + const gfx::Rect& plugin_rect, + const gfx::Rect& paint_rect) { // We're guaranteed to have a mapped canvas since we mapped it in Init(). const SkBitmap& backing_bitmap = *image_data_->GetMappedBitmap(); @@ -456,7 +455,7 @@ void DeviceContext2D::Paint(WebKit::WebCanvas* canvas, #endif } -void DeviceContext2D::ViewInitiatedPaint() { +void Graphics2D::ViewInitiatedPaint() { // Move any "unpainted" callback to the painted state. See // |unpainted_flush_callback_| in the header for more. if (!unpainted_flush_callback_.is_null()) { @@ -465,7 +464,7 @@ void DeviceContext2D::ViewInitiatedPaint() { } } -void DeviceContext2D::ViewFlushedPaint() { +void Graphics2D::ViewFlushedPaint() { // Notify any "painted" callback. See |unpainted_flush_callback_| in the // header for more. if (!painted_flush_callback_.is_null()) { @@ -478,10 +477,10 @@ void DeviceContext2D::ViewFlushedPaint() { } } -void DeviceContext2D::ExecutePaintImageData(ImageData* image, - int x, int y, - const gfx::Rect& src_rect, - gfx::Rect* invalidated_rect) { +void Graphics2D::ExecutePaintImageData(ImageData* image, + int x, int y, + const gfx::Rect& src_rect, + gfx::Rect* invalidated_rect) { // Ensure the source image is mapped to read from it. ImageDataAutoMapper auto_mapper(image); if (!auto_mapper.is_valid()) @@ -509,32 +508,31 @@ void DeviceContext2D::ExecutePaintImageData(ImageData* image, &src_irect, dest_rect, &paint); } -void DeviceContext2D::ExecuteScroll(const gfx::Rect& clip, int dx, int dy, - gfx::Rect* invalidated_rect) { +void Graphics2D::ExecuteScroll(const gfx::Rect& clip, int dx, int dy, + gfx::Rect* invalidated_rect) { gfx::ScrollCanvas(image_data_->mapped_canvas(), clip, gfx::Point(dx, dy)); *invalidated_rect = clip; } -void DeviceContext2D::ExecuteReplaceContents(ImageData* image, - gfx::Rect* invalidated_rect) { +void Graphics2D::ExecuteReplaceContents(ImageData* image, + gfx::Rect* invalidated_rect) { image_data_->Swap(image); *invalidated_rect = gfx::Rect(0, 0, image_data_->width(), image_data_->height()); } -void DeviceContext2D::ScheduleOffscreenCallback( - const FlushCallbackData& callback) { +void Graphics2D::ScheduleOffscreenCallback(const FlushCallbackData& callback) { DCHECK(!HasPendingFlush()); offscreen_flush_pending_ = true; MessageLoop::current()->PostTask( FROM_HERE, NewRunnableMethod(this, - &DeviceContext2D::ExecuteOffscreenCallback, + &Graphics2D::ExecuteOffscreenCallback, callback)); } -void DeviceContext2D::ExecuteOffscreenCallback(FlushCallbackData data) { +void Graphics2D::ExecuteOffscreenCallback(FlushCallbackData data) { DCHECK(offscreen_flush_pending_); // We must clear this flag before issuing the callback. It will be @@ -544,7 +542,7 @@ void DeviceContext2D::ExecuteOffscreenCallback(FlushCallbackData data) { data.Execute(PP_OK); } -bool DeviceContext2D::HasPendingFlush() const { +bool Graphics2D::HasPendingFlush() const { return !unpainted_flush_callback_.is_null() || !painted_flush_callback_.is_null() || offscreen_flush_pending_; diff --git a/webkit/glue/plugins/pepper_device_context_2d.h b/webkit/glue/plugins/pepper_graphics_2d.h index 603bd52..c3fad68 100644 --- a/webkit/glue/plugins/pepper_device_context_2d.h +++ b/webkit/glue/plugins/pepper_graphics_2d.h @@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_PEPPER_DEVICE_CONTEXT_2D_H_ -#define WEBKIT_GLUE_PLUGINS_PEPPER_DEVICE_CONTEXT_2D_H_ +#ifndef WEBKIT_GLUE_PLUGINS_PEPPER_GRAPHICS_2D_H_ +#define WEBKIT_GLUE_PLUGINS_PEPPER_GRAPHICS_2D_H_ #include <vector> #include "base/basictypes.h" #include "third_party/ppapi/c/pp_completion_callback.h" -#include "third_party/ppapi/c/ppb_device_context_2d.h" +#include "third_party/ppapi/c/ppb_graphics_2d.h" #include "third_party/WebKit/WebKit/chromium/public/WebCanvas.h" #include "webkit/glue/plugins/pepper_resource.h" -typedef struct _ppb_DeviceContext2D PPB_DeviceContext2D; +struct PPB_Graphics2D; namespace gfx { class Rect; @@ -25,21 +25,21 @@ class ImageData; class PluginInstance; class PluginModule; -class DeviceContext2D : public Resource { +class Graphics2D : public Resource { public: - DeviceContext2D(PluginModule* module); - virtual ~DeviceContext2D(); + Graphics2D(PluginModule* module); + virtual ~Graphics2D(); // Returns a pointer to the interface implementing PPB_ImageData that is // exposed to the plugin. - static const PPB_DeviceContext2D* GetInterface(); + static const PPB_Graphics2D* GetInterface(); bool Init(int width, int height, bool is_always_opaque); // Resource override. - virtual DeviceContext2D* AsDeviceContext2D() { return this; } + virtual Graphics2D* AsGraphics2D() { return this; } - // PPB_DeviceContext2D functions. + // PPB_Graphics2D functions. bool Describe(PP_Size* size, bool* is_always_opaque); bool PaintImageData(PP_Resource image, const PP_Point* top_left, @@ -126,9 +126,8 @@ class DeviceContext2D : public Resource { scoped_refptr<ImageData> image_data_; - // Non-owning pointer to the plugin instance this device context is currently - // bound to, if any. If the device context is currently unbound, this will - // be NULL. + // Non-owning pointer to the plugin instance this context is currently bound + // to, if any. If the context is currently unbound, this will be NULL. PluginInstance* bound_instance_; // Keeps track of all drawing commands queued before a Flush call. @@ -167,9 +166,9 @@ class DeviceContext2D : public Resource { // enforce the "only one pending flush at a time" constraint in the API. bool offscreen_flush_pending_; - DISALLOW_COPY_AND_ASSIGN(DeviceContext2D); + DISALLOW_COPY_AND_ASSIGN(Graphics2D); }; } // namespace pepper -#endif // WEBKIT_GLUE_PLUGINS_PEPPER_DEVICE_CONTEXT_2D_H_ +#endif // WEBKIT_GLUE_PLUGINS_PEPPER_GRAPHICS_2D_H_ diff --git a/webkit/glue/plugins/pepper_graphics_3d.cc b/webkit/glue/plugins/pepper_graphics_3d.cc index d01189a..18e5cd1 100644 --- a/webkit/glue/plugins/pepper_graphics_3d.cc +++ b/webkit/glue/plugins/pepper_graphics_3d.cc @@ -7,6 +7,7 @@ #include "gpu/command_buffer/common/command_buffer.h" #include "base/singleton.h" #include "base/thread_local.h" +#include "third_party/ppapi/c/dev/ppb_graphics_3d_dev.h" #include "webkit/glue/plugins/pepper_plugin_instance.h" namespace pepper { @@ -104,7 +105,7 @@ uint32_t GetError() { return PP_GRAPHICS_3D_ERROR_SUCCESS; } -const PPB_Graphics3D ppb_graphics3d = { +const PPB_Graphics3D_Dev ppb_graphics3d = { &IsGraphics3D, &GetConfigs, &ChooseConfig, @@ -118,7 +119,6 @@ const PPB_Graphics3D ppb_graphics3d = { &GetError }; - } // namespace Graphics3D::Graphics3D(PluginModule* module) @@ -128,7 +128,7 @@ Graphics3D::Graphics3D(PluginModule* module) method_factory3d_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { } -const PPB_Graphics3D* Graphics3D::GetInterface() { +const PPB_Graphics3D_Dev* Graphics3D::GetInterface() { return &ppb_graphics3d; } diff --git a/webkit/glue/plugins/pepper_graphics_3d.h b/webkit/glue/plugins/pepper_graphics_3d.h index 97893e8..16258ed 100644 --- a/webkit/glue/plugins/pepper_graphics_3d.h +++ b/webkit/glue/plugins/pepper_graphics_3d.h @@ -8,11 +8,10 @@ #include "base/scoped_ptr.h" #include "gpu/command_buffer/client/gles2_cmd_helper.h" #include "gpu/command_buffer/client/gles2_implementation.h" -#include "third_party/ppapi/c/ppb_graphics_3d.h" +#include "third_party/ppapi/c/pp_instance.h" #include "webkit/glue/plugins/pepper_plugin_delegate.h" #include "webkit/glue/plugins/pepper_resource.h" - namespace gfx { class Rect; } // namespace gfx @@ -21,7 +20,8 @@ namespace gpu { class CommandBuffer; } // namespace gpu -typedef struct _ppb_OpenGLES PPB_OpenGLES; +struct PPB_Graphics3D_Dev; +struct PPB_OpenGLES_Dev; namespace pepper { @@ -31,9 +31,8 @@ class Graphics3D : public Resource { virtual ~Graphics3D(); - static const PPB_Graphics3D* GetInterface(); - - static const PPB_OpenGLES* GetOpenGLESInterface(); + static const PPB_Graphics3D_Dev* GetInterface(); + static const PPB_OpenGLES_Dev* GetOpenGLESInterface(); static bool Shutdown(); diff --git a/webkit/glue/plugins/pepper_graphics_3d_gl.cc b/webkit/glue/plugins/pepper_graphics_3d_gl.cc index 8b64216..897e459 100644 --- a/webkit/glue/plugins/pepper_graphics_3d_gl.cc +++ b/webkit/glue/plugins/pepper_graphics_3d_gl.cc @@ -7,7 +7,7 @@ #include "webkit/glue/plugins/pepper_graphics_3d.h" #include "gpu/command_buffer/client/gles2_implementation.h" -#include "third_party/ppapi/c/ppb_opengles.h" +#include "third_party/ppapi/c/dev/ppb_opengles_dev.h" namespace pepper { @@ -551,7 +551,7 @@ void UnmapTexSubImage2D(const void* mem) { Graphics3D::GetCurrent()->impl()->UnmapTexSubImage2D(mem); } -const PPB_OpenGLES ppb_opengles = { +const PPB_OpenGLES_Dev ppb_opengles = { &ActiveTexture, &AttachShader, &BindAttribLocation, @@ -708,7 +708,7 @@ const PPB_OpenGLES ppb_opengles = { } // namespace -const PPB_OpenGLES* Graphics3D::GetOpenGLESInterface() { +const PPB_OpenGLES_Dev* Graphics3D::GetOpenGLESInterface() { return &ppb_opengles; } diff --git a/webkit/glue/plugins/pepper_plugin_instance.cc b/webkit/glue/plugins/pepper_plugin_instance.cc index 2b56394..9b5f10e 100644 --- a/webkit/glue/plugins/pepper_plugin_instance.cc +++ b/webkit/glue/plugins/pepper_plugin_instance.cc @@ -22,17 +22,17 @@ #include "printing/units.h" #include "skia/ext/vector_platform_device.h" #include "skia/ext/platform_canvas.h" -#include "third_party/ppapi/c/pp_instance.h" +#include "third_party/ppapi/c/dev/ppb_find_dev.h" +#include "third_party/ppapi/c/dev/ppp_find_dev.h" +#include "third_party/ppapi/c/dev/ppp_zoom_dev.h" #include "third_party/ppapi/c/pp_event.h" +#include "third_party/ppapi/c/pp_instance.h" #include "third_party/ppapi/c/pp_rect.h" #include "third_party/ppapi/c/pp_resource.h" #include "third_party/ppapi/c/pp_var.h" #include "third_party/ppapi/c/ppb_core.h" -#include "third_party/ppapi/c/ppb_find.h" #include "third_party/ppapi/c/ppb_instance.h" -#include "third_party/ppapi/c/ppp_find.h" #include "third_party/ppapi/c/ppp_instance.h" -#include "third_party/ppapi/c/ppp_zoom.h" #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" @@ -41,7 +41,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "webkit/glue/plugins/pepper_buffer.h" -#include "webkit/glue/plugins/pepper_device_context_2d.h" +#include "webkit/glue/plugins/pepper_graphics_2d.h" #include "webkit/glue/plugins/pepper_event_conversion.h" #include "webkit/glue/plugins/pepper_image_data.h" #include "webkit/glue/plugins/pepper_plugin_delegate.h" @@ -146,11 +146,11 @@ PP_Var GetOwnerElementObject(PP_Instance instance_id) { return instance->GetOwnerElementObject(); } -bool BindGraphicsDeviceContext(PP_Instance instance_id, PP_Resource device_id) { +bool BindGraphics(PP_Instance instance_id, PP_Resource device_id) { PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); if (!instance) return false; - return instance->BindGraphicsDeviceContext(device_id); + return instance->BindGraphics(device_id); } bool IsFullFrame(PP_Instance instance_id) { @@ -163,7 +163,7 @@ bool IsFullFrame(PP_Instance instance_id) { const PPB_Instance ppb_instance = { &GetWindowObject, &GetOwnerElementObject, - &BindGraphicsDeviceContext, + &BindGraphics, &IsFullFrame, }; @@ -190,7 +190,7 @@ void SelectedFindResultChanged(PP_Instance instance_id, instance->find_identifier(), index); } -const PPB_Find ppb_find = { +const PPB_Find_Dev ppb_find = { &NumberOfFindResultsChanged, &SelectedFindResultChanged, }; @@ -236,7 +236,7 @@ PluginInstance* PluginInstance::FromPPInstance(PP_Instance instance) { } // static -const PPB_Find* PluginInstance::GetFindInterface() { +const PPB_Find_Dev* PluginInstance::GetFindInterface() { return &ppb_find; } @@ -247,8 +247,8 @@ PP_Instance PluginInstance::GetPPInstance() { void PluginInstance::Paint(WebCanvas* canvas, const gfx::Rect& plugin_rect, const gfx::Rect& paint_rect) { - if (device_context_2d_) - device_context_2d_->Paint(canvas, plugin_rect, paint_rect); + if (bound_graphics_2d_) + bound_graphics_2d_->Paint(canvas, plugin_rect, paint_rect); } void PluginInstance::InvalidateRect(const gfx::Rect& rect) { @@ -278,19 +278,18 @@ PP_Var PluginInstance::GetOwnerElementObject() { return NPObjectToPPVar(container_->scriptableObjectForElement()); } -bool PluginInstance::BindGraphicsDeviceContext(PP_Resource device_id) { +bool PluginInstance::BindGraphics(PP_Resource device_id) { if (!device_id) { // Special-case clearing the current device. - if (device_context_2d_) { - device_context_2d_->BindToInstance(NULL); - device_context_2d_ = NULL; + if (bound_graphics_2d_) { + bound_graphics_2d_->BindToInstance(NULL); + bound_graphics_2d_ = NULL; InvalidateRect(gfx::Rect()); } return true; } - scoped_refptr<DeviceContext2D> device_2d = - Resource::GetAs<DeviceContext2D>(device_id); + scoped_refptr<Graphics2D> device_2d = Resource::GetAs<Graphics2D>(device_id); if (device_2d) { if (!device_2d->BindToInstance(this)) @@ -298,11 +297,11 @@ bool PluginInstance::BindGraphicsDeviceContext(PP_Resource device_id) { // See http://crbug.com/49403: this can be further optimized by keeping the // old device around and painting from it. - if (device_context_2d_.get()) { + if (bound_graphics_2d_.get()) { // Start the new image with the content of the old image until the plugin // repaints. const SkBitmap* old_backing_bitmap = - device_context_2d_->image_data()->GetMappedBitmap(); + bound_graphics_2d_->image_data()->GetMappedBitmap(); SkRect old_size = SkRect::MakeWH( SkScalar(static_cast<float>(old_backing_bitmap->width())), SkScalar(static_cast<float>(old_backing_bitmap->height()))); @@ -315,7 +314,7 @@ bool PluginInstance::BindGraphicsDeviceContext(PP_Resource device_id) { canvas.drawARGB(255, 255, 255, 255); } - device_context_2d_ = device_2d; + bound_graphics_2d_ = device_2d; // BindToInstance will have invalidated the plugin if necessary. } @@ -397,13 +396,13 @@ void PluginInstance::ViewChanged(const gfx::Rect& position, } void PluginInstance::ViewInitiatedPaint() { - if (device_context_2d_) - device_context_2d_->ViewInitiatedPaint(); + if (bound_graphics_2d_) + bound_graphics_2d_->ViewInitiatedPaint(); } void PluginInstance::ViewFlushedPaint() { - if (device_context_2d_) - device_context_2d_->ViewFlushedPaint(); + if (bound_graphics_2d_) + bound_graphics_2d_->ViewFlushedPaint(); } string16 PluginInstance::GetSelectedText(bool html) { @@ -447,8 +446,8 @@ void PluginInstance::StopFind() { bool PluginInstance::LoadFindInterface() { if (!plugin_find_interface_) { plugin_find_interface_ = - reinterpret_cast<const PPP_Find*>(module_->GetPluginInterface( - PPP_FIND_INTERFACE)); + reinterpret_cast<const PPP_Find_Dev*>(module_->GetPluginInterface( + PPP_FIND_DEV_INTERFACE)); } return !!plugin_find_interface_; @@ -457,24 +456,24 @@ bool PluginInstance::LoadFindInterface() { bool PluginInstance::LoadZoomInterface() { if (!plugin_zoom_interface_) { plugin_zoom_interface_ = - reinterpret_cast<const PPP_Zoom*>(module_->GetPluginInterface( - PPP_ZOOM_INTERFACE)); + reinterpret_cast<const PPP_Zoom_Dev*>(module_->GetPluginInterface( + PPP_ZOOM_DEV_INTERFACE)); } return !!plugin_zoom_interface_; } bool PluginInstance::GetPreferredPrintOutputFormat( - PP_PrintOutputFormat* format) { + PP_PrintOutputFormat_Dev* format) { if (!plugin_print_interface_) { plugin_print_interface_ = - reinterpret_cast<const PPP_Printing*>(module_->GetPluginInterface( - PPP_PRINTING_INTERFACE)); + reinterpret_cast<const PPP_Printing_Dev*>(module_->GetPluginInterface( + PPP_PRINTING_DEV_INTERFACE)); } if (!plugin_print_interface_) return false; uint32_t format_count = 0; - PP_PrintOutputFormat* supported_formats = + PP_PrintOutputFormat_Dev* supported_formats = plugin_print_interface_->QuerySupportedFormats(GetPPInstance(), &format_count); if (!supported_formats) @@ -498,13 +497,13 @@ bool PluginInstance::GetPreferredPrintOutputFormat( } bool PluginInstance::SupportsPrintInterface() { - PP_PrintOutputFormat format; + PP_PrintOutputFormat_Dev format; return GetPreferredPrintOutputFormat(&format); } int PluginInstance::PrintBegin(const gfx::Rect& printable_area, int printer_dpi) { - PP_PrintOutputFormat format; + PP_PrintOutputFormat_Dev format; if (!GetPreferredPrintOutputFormat(&format)) { // PrintBegin should not have been called since SupportsPrintInterface // would have returned false; @@ -512,7 +511,7 @@ int PluginInstance::PrintBegin(const gfx::Rect& printable_area, return 0; } - PP_PrintSettings print_settings; + PP_PrintSettings_Dev print_settings; RectToPPRect(printable_area, &print_settings.printable_area); print_settings.dpi = printer_dpi; print_settings.orientation = PP_PRINTORIENTATION_NORMAL; @@ -532,7 +531,7 @@ int PluginInstance::PrintBegin(const gfx::Rect& printable_area, bool PluginInstance::PrintPage(int page_number, WebKit::WebCanvas* canvas) { DCHECK(plugin_print_interface_); - PP_PrintPageNumberRange page_range; + PP_PrintPageNumberRange_Dev page_range; #if defined(OS_LINUX) if (current_print_settings_.format == PP_PRINTOUTPUTFORMAT_PDF) { // On Linux we will try and output all pages as PDF in the first call to @@ -583,8 +582,8 @@ void PluginInstance::PrintEnd() { void PluginInstance::Graphics3DContextLost() { if (!plugin_graphics_3d_interface_) { plugin_graphics_3d_interface_ = - reinterpret_cast<const PPP_Graphics3D*>(module_->GetPluginInterface( - PPP_GRAPHICS_3D_INTERFACE)); + reinterpret_cast<const PPP_Graphics3D_Dev*>(module_->GetPluginInterface( + PPP_GRAPHICS_3D_DEV_INTERFACE)); } if (plugin_graphics_3d_interface_) plugin_graphics_3d_interface_->Graphics3DContextLost(GetPPInstance()); diff --git a/webkit/glue/plugins/pepper_plugin_instance.h b/webkit/glue/plugins/pepper_plugin_instance.h index 6c3b674..d8663ea 100644 --- a/webkit/glue/plugins/pepper_plugin_instance.h +++ b/webkit/glue/plugins/pepper_plugin_instance.h @@ -14,19 +14,19 @@ #include "base/string16.h" #include "gfx/rect.h" #include "third_party/ppapi/c/dev/pp_cursor_type_dev.h" +#include "third_party/ppapi/c/dev/ppp_graphics_3d_dev.h" +#include "third_party/ppapi/c/dev/ppp_printing_dev.h" #include "third_party/ppapi/c/pp_instance.h" #include "third_party/ppapi/c/pp_resource.h" -#include "third_party/ppapi/c/ppp_printing.h" -#include "third_party/ppapi/c/ppp_graphics_3d.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/WebKit/chromium/public/WebCanvas.h" -typedef struct _pp_Var PP_Var; -typedef struct _ppb_Instance PPB_Instance; -typedef struct _ppb_Find PPB_Find; -typedef struct _ppp_Find PPP_Find; -typedef struct _ppp_Instance PPP_Instance; -typedef struct _ppp_Zoom PPP_Zoom; +struct PP_Var; +struct PPB_Instance; +struct PPB_Find_Dev; +struct PPP_Find_Dev; +struct PPP_Instance; +struct PPP_Zoom_Dev; class SkBitmap; @@ -42,7 +42,7 @@ class WebPluginContainer; namespace pepper { -class DeviceContext2D; +class Graphics2D; class ImageData; class PluginDelegate; class PluginModule; @@ -62,7 +62,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> { // Returns a pointer to the interface implementing PPB_Find that is // exposed to the plugin. - static const PPB_Find* GetFindInterface(); + static const PPB_Find_Dev* GetFindInterface(); PluginDelegate* delegate() const { return delegate_; } PluginModule* module() const { return module_.get(); } @@ -90,7 +90,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> { // PPB_Instance implementation. PP_Var GetWindowObject(); PP_Var GetOwnerElementObject(); - bool BindGraphicsDeviceContext(PP_Resource device_id); + bool BindGraphics(PP_Resource device_id); bool full_frame() const { return full_frame_; } bool SetCursor(PP_CursorType_Dev type); @@ -134,7 +134,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> { // Queries the plugin for supported print formats and sets |format| to the // best format to use. Returns false if the plugin does not support any // print format that we can handle (we can handle raster and PDF). - bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat* format); + bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); bool PrintRasterOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); #if defined(OS_WIN) @@ -170,18 +170,18 @@ class PluginInstance : public base::RefCounted<PluginInstance> { gfx::Rect clip_; // The current device context for painting in 2D. - scoped_refptr<DeviceContext2D> device_context_2d_; + scoped_refptr<Graphics2D> bound_graphics_2d_; // The id of the current find operation, or -1 if none is in process. int find_identifier_; // The plugin find and zoom interfaces. - const PPP_Find* plugin_find_interface_; - const PPP_Zoom* plugin_zoom_interface_; + const PPP_Find_Dev* plugin_find_interface_; + const PPP_Zoom_Dev* plugin_zoom_interface_; // This is only valid between a successful PrintBegin call and a PrintEnd // call. - PP_PrintSettings current_print_settings_; + PP_PrintSettings_Dev current_print_settings_; #if defined(OS_MACOSX) // On the Mac, when we draw the bitmap to the PDFContext, it seems necessary // to keep the pixels valid until CGContextEndPage is called. We use this @@ -201,10 +201,10 @@ class PluginInstance : public base::RefCounted<PluginInstance> { #endif // defined(OS_LINUX) // The plugin print interface. - const PPP_Printing* plugin_print_interface_; + const PPP_Printing_Dev* plugin_print_interface_; // The plugin 3D interface. - const PPP_Graphics3D* plugin_graphics_3d_interface_; + const PPP_Graphics3D_Dev* plugin_graphics_3d_interface_; // Containes the cursor if it's set by the plugin. scoped_ptr<WebKit::WebCursorInfo> cursor_; diff --git a/webkit/glue/plugins/pepper_plugin_module.cc b/webkit/glue/plugins/pepper_plugin_module.cc index 39df9cf..a0785cc 100644 --- a/webkit/glue/plugins/pepper_plugin_module.cc +++ b/webkit/glue/plugins/pepper_plugin_module.cc @@ -12,42 +12,44 @@ #include "base/logging.h" #include "base/scoped_ptr.h" #include "base/time.h" +#include "third_party/ppapi/c/dev/ppb_buffer_dev.h" #include "third_party/ppapi/c/dev/ppb_char_set_dev.h" +#include "third_party/ppapi/c/dev/ppb_directory_reader_dev.h" +#include "third_party/ppapi/c/dev/ppb_file_io_dev.h" +#include "third_party/ppapi/c/dev/ppb_file_io_trusted_dev.h" +#include "third_party/ppapi/c/dev/ppb_file_system_dev.h" +#include "third_party/ppapi/c/dev/ppb_find_dev.h" +#include "third_party/ppapi/c/dev/ppb_font_dev.h" +#include "third_party/ppapi/c/dev/ppb_graphics_3d_dev.h" +#include "third_party/ppapi/c/dev/ppb_opengles_dev.h" +#include "third_party/ppapi/c/dev/ppb_scrollbar_dev.h" +#include "third_party/ppapi/c/dev/ppb_testing_dev.h" +#include "third_party/ppapi/c/dev/ppb_url_loader_dev.h" +#include "third_party/ppapi/c/dev/ppb_url_request_info_dev.h" +#include "third_party/ppapi/c/dev/ppb_url_response_info_dev.h" +#include "third_party/ppapi/c/dev/ppb_url_util_dev.h" #include "third_party/ppapi/c/dev/ppb_video_decoder_dev.h" -#include "third_party/ppapi/c/ppb_buffer.h" +#include "third_party/ppapi/c/dev/ppb_widget_dev.h" +#include "third_party/ppapi/c/pp_module.h" +#include "third_party/ppapi/c/pp_resource.h" +#include "third_party/ppapi/c/pp_var.h" #include "third_party/ppapi/c/ppb_core.h" -#include "third_party/ppapi/c/ppb_device_context_2d.h" -#include "third_party/ppapi/c/ppb_file_io.h" -#include "third_party/ppapi/c/ppb_file_io_trusted.h" -#include "third_party/ppapi/c/ppb_file_system.h" -#include "third_party/ppapi/c/ppb_find.h" -#include "third_party/ppapi/c/ppb_font.h" +#include "third_party/ppapi/c/ppb_graphics_2d.h" #include "third_party/ppapi/c/ppb_image_data.h" #include "third_party/ppapi/c/ppb_instance.h" -#include "third_party/ppapi/c/ppb_opengles.h" -#include "third_party/ppapi/c/ppb_scrollbar.h" -#include "third_party/ppapi/c/ppb_testing.h" -#include "third_party/ppapi/c/ppb_url_loader.h" -#include "third_party/ppapi/c/ppb_url_request_info.h" -#include "third_party/ppapi/c/ppb_url_response_info.h" -#include "third_party/ppapi/c/ppb_url_util.h" #include "third_party/ppapi/c/ppb_var.h" -#include "third_party/ppapi/c/ppb_widget.h" #include "third_party/ppapi/c/ppp.h" #include "third_party/ppapi/c/ppp_instance.h" -#include "third_party/ppapi/c/pp_module.h" -#include "third_party/ppapi/c/pp_resource.h" -#include "third_party/ppapi/c/pp_var.h" #include "webkit/glue/plugins/pepper_audio.h" #include "webkit/glue/plugins/pepper_buffer.h" #include "webkit/glue/plugins/pepper_char_set.h" -#include "webkit/glue/plugins/pepper_device_context_2d.h" #include "webkit/glue/plugins/pepper_directory_reader.h" #include "webkit/glue/plugins/pepper_file_chooser.h" #include "webkit/glue/plugins/pepper_file_io.h" #include "webkit/glue/plugins/pepper_file_ref.h" #include "webkit/glue/plugins/pepper_file_system.h" #include "webkit/glue/plugins/pepper_font.h" +#include "webkit/glue/plugins/pepper_graphics_2d.h" #include "webkit/glue/plugins/pepper_image_data.h" #include "webkit/glue/plugins/pepper_plugin_instance.h" #include "webkit/glue/plugins/pepper_private.h" @@ -139,8 +141,8 @@ const PPB_Core core_interface = { bool ReadImageData(PP_Resource device_context_2d, PP_Resource image, const PP_Point* top_left) { - scoped_refptr<DeviceContext2D> context( - Resource::GetAs<DeviceContext2D>(device_context_2d)); + scoped_refptr<Graphics2D> context( + Resource::GetAs<Graphics2D>(device_context_2d)); if (!context.get()) return false; return context->ReadImageData(image, top_left); @@ -157,7 +159,7 @@ void QuitMessageLoop() { MessageLoop::current()->Quit(); } -const PPB_Testing testing_interface = { +const PPB_Testing_Dev testing_interface = { &ReadImageData, &RunMessageLoop, &QuitMessageLoop, @@ -180,45 +182,45 @@ const void* GetInterface(const char* name) { return Audio::GetInterface(); if (strcmp(name, PPB_AUDIO_TRUSTED_DEV_INTERFACE) == 0) return Audio::GetTrustedInterface(); - if (strcmp(name, PPB_DEVICECONTEXT2D_INTERFACE) == 0) - return DeviceContext2D::GetInterface(); + if (strcmp(name, PPB_GRAPHICS_2D_INTERFACE) == 0) + return Graphics2D::GetInterface(); #ifdef ENABLE_GPU - if (strcmp(name, PPB_GRAPHICS_3D_INTERFACE) == 0) + if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0) return Graphics3D::GetInterface(); - if (strcmp(name, PPB_OPENGLES_INTERFACE) == 0) + if (strcmp(name, PPB_OPENGLES_DEV_INTERFACE) == 0) return Graphics3D::GetOpenGLESInterface(); #endif // ENABLE_GPU - if (strcmp(name, PPB_URLLOADER_INTERFACE) == 0) + if (strcmp(name, PPB_URLLOADER_DEV_INTERFACE) == 0) return URLLoader::GetInterface(); - if (strcmp(name, PPB_URLREQUESTINFO_INTERFACE) == 0) + if (strcmp(name, PPB_URLREQUESTINFO_DEV_INTERFACE) == 0) return URLRequestInfo::GetInterface(); - if (strcmp(name, PPB_URLRESPONSEINFO_INTERFACE) == 0) + if (strcmp(name, PPB_URLRESPONSEINFO_DEV_INTERFACE) == 0) return URLResponseInfo::GetInterface(); - if (strcmp(name, PPB_BUFFER_INTERFACE) == 0) + if (strcmp(name, PPB_BUFFER_DEV_INTERFACE) == 0) return Buffer::GetInterface(); - if (strcmp(name, PPB_FILEREF_INTERFACE) == 0) + if (strcmp(name, PPB_FILEREF_DEV_INTERFACE) == 0) return FileRef::GetInterface(); - if (strcmp(name, PPB_FILEIO_INTERFACE) == 0) + if (strcmp(name, PPB_FILEIO_DEV_INTERFACE) == 0) return FileIO::GetInterface(); - if (strcmp(name, PPB_FILEIOTRUSTED_INTERFACE) == 0) + if (strcmp(name, PPB_FILEIOTRUSTED_DEV_INTERFACE) == 0) return FileIO::GetTrustedInterface(); - if (strcmp(name, PPB_FILESYSTEM_INTERFACE) == 0) + if (strcmp(name, PPB_FILESYSTEM_DEV_INTERFACE) == 0) return FileSystem::GetInterface(); - if (strcmp(name, PPB_DIRECTORYREADER_INTERFACE) == 0) + if (strcmp(name, PPB_DIRECTORYREADER_DEV_INTERFACE) == 0) return DirectoryReader::GetInterface(); - if (strcmp(name, PPB_WIDGET_INTERFACE) == 0) + if (strcmp(name, PPB_WIDGET_DEV_INTERFACE) == 0) return Widget::GetInterface(); - if (strcmp(name, PPB_SCROLLBAR_INTERFACE) == 0) + if (strcmp(name, PPB_SCROLLBAR_DEV_INTERFACE) == 0) return Scrollbar::GetInterface(); - if (strcmp(name, PPB_FONT_INTERFACE) == 0) + if (strcmp(name, PPB_FONT_DEV_INTERFACE) == 0) return Font::GetInterface(); - if (strcmp(name, PPB_FIND_INTERFACE) == 0) + if (strcmp(name, PPB_FIND_DEV_INTERFACE) == 0) return PluginInstance::GetFindInterface(); - if (strcmp(name, PPB_URLUTIL_INTERFACE) == 0) - return GetUrlUtilInterface(); + if (strcmp(name, PPB_URLUTIL_DEV_INTERFACE) == 0) + return UrlUtil::GetInterface(); if (strcmp(name, PPB_PRIVATE_INTERFACE) == 0) return Private::GetInterface(); - if (strcmp(name, PPB_FILECHOOSER_INTERFACE) == 0) + if (strcmp(name, PPB_FILECHOOSER_DEV_INTERFACE) == 0) return FileChooser::GetInterface(); if (strcmp(name, PPB_VIDEODECODER_DEV_INTERFACE) == 0) return VideoDecoder::GetInterface(); @@ -228,7 +230,7 @@ const void* GetInterface(const char* name) { // Only support the testing interface when the command line switch is // specified. This allows us to prevent people from (ab)using this interface // in production code. - if (strcmp(name, PPB_TESTING_INTERFACE) == 0) { + if (strcmp(name, PPB_TESTING_DEV_INTERFACE) == 0) { if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) return &testing_interface; } diff --git a/webkit/glue/plugins/pepper_plugin_module.h b/webkit/glue/plugins/pepper_plugin_module.h index f624110..ab089a1 100644 --- a/webkit/glue/plugins/pepper_plugin_module.h +++ b/webkit/glue/plugins/pepper_plugin_module.h @@ -15,7 +15,7 @@ class FilePath; -typedef struct _ppb_Core PPB_Core; +struct PPB_Core; namespace pepper { diff --git a/webkit/glue/plugins/pepper_private.h b/webkit/glue/plugins/pepper_private.h index fda75a7..06016f0 100644 --- a/webkit/glue/plugins/pepper_private.h +++ b/webkit/glue/plugins/pepper_private.h @@ -7,7 +7,7 @@ #include "webkit/glue/plugins/pepper_resource.h" -typedef struct _ppb_Private PPB_Private; +struct PPB_Private; namespace pepper { diff --git a/webkit/glue/plugins/pepper_resource.h b/webkit/glue/plugins/pepper_resource.h index 8c1e85c..3bea5b5 100644 --- a/webkit/glue/plugins/pepper_resource.h +++ b/webkit/glue/plugins/pepper_resource.h @@ -15,12 +15,12 @@ namespace pepper { class Buffer; class Audio; class AudioConfig; -class DeviceContext2D; class DirectoryReader; class FileChooser; class FileIO; class FileRef; class Font; +class Graphics2D; class Graphics3D; class ImageData; class PluginModule; @@ -79,12 +79,12 @@ class Resource : public base::RefCountedThreadSafe<Resource> { virtual Audio* AsAudio() { return NULL; } virtual AudioConfig* AsAudioConfig() { return NULL; } virtual Buffer* AsBuffer() { return NULL; } - virtual DeviceContext2D* AsDeviceContext2D() { return NULL; } virtual DirectoryReader* AsDirectoryReader() { return NULL; } virtual FileChooser* AsFileChooser() { return NULL; } virtual FileIO* AsFileIO() { return NULL; } virtual FileRef* AsFileRef() { return NULL; } virtual Font* AsFont() { return NULL; } + virtual Graphics2D* AsGraphics2D() { return NULL; } virtual Graphics3D* AsGraphics3D() { return NULL; } virtual ImageData* AsImageData() { return NULL; } virtual PrivateFontFile* AsPrivateFontFile() { return NULL; } @@ -124,12 +124,12 @@ class Resource : public base::RefCountedThreadSafe<Resource> { DEFINE_RESOURCE_CAST(Audio) DEFINE_RESOURCE_CAST(AudioConfig) DEFINE_RESOURCE_CAST(Buffer) -DEFINE_RESOURCE_CAST(DeviceContext2D) DEFINE_RESOURCE_CAST(DirectoryReader) DEFINE_RESOURCE_CAST(FileChooser) DEFINE_RESOURCE_CAST(FileIO) DEFINE_RESOURCE_CAST(FileRef) DEFINE_RESOURCE_CAST(Font) +DEFINE_RESOURCE_CAST(Graphics2D) DEFINE_RESOURCE_CAST(Graphics3D) DEFINE_RESOURCE_CAST(ImageData) DEFINE_RESOURCE_CAST(PrivateFontFile) diff --git a/webkit/glue/plugins/pepper_scrollbar.cc b/webkit/glue/plugins/pepper_scrollbar.cc index 1dc9f7e..c704112 100644 --- a/webkit/glue/plugins/pepper_scrollbar.cc +++ b/webkit/glue/plugins/pepper_scrollbar.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/message_loop.h" #include "skia/ext/platform_canvas.h" -#include "third_party/ppapi/c/ppp_scrollbar.h" +#include "third_party/ppapi/c/dev/ppp_scrollbar_dev.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebScrollbar.h" @@ -74,13 +74,13 @@ void SetTickMarks(PP_Resource resource, scrollbar->SetTickMarks(tick_marks, count); } -void ScrollBy(PP_Resource resource, PP_ScrollBy unit, int32_t multiplier) { +void ScrollBy(PP_Resource resource, PP_ScrollBy_Dev unit, int32_t multiplier) { scoped_refptr<Scrollbar> scrollbar(Resource::GetAs<Scrollbar>(resource)); if (scrollbar) scrollbar->ScrollBy(unit, multiplier); } -const PPB_Scrollbar ppb_scrollbar = { +const PPB_Scrollbar_Dev ppb_scrollbar = { &Create, &IsScrollbar, &GetThickness, @@ -104,7 +104,7 @@ Scrollbar::~Scrollbar() { } // static -const PPB_Scrollbar* Scrollbar::GetInterface() { +const PPB_Scrollbar_Dev* Scrollbar::GetInterface() { return &ppb_scrollbar; } @@ -132,7 +132,7 @@ void Scrollbar::SetTickMarks(const PP_Rect* tick_marks, uint32_t count) { Invalidate(&rect); } -void Scrollbar::ScrollBy(PP_ScrollBy unit, int32_t multiplier) { +void Scrollbar::ScrollBy(PP_ScrollBy_Dev unit, int32_t multiplier) { WebScrollbar::ScrollDirection direction = multiplier >= 0 ? WebScrollbar::ScrollForward : WebScrollbar::ScrollBackward; float fmultiplier = 1.0; @@ -189,8 +189,9 @@ void Scrollbar::SetLocationInternal(const PP_Rect* location) { } void Scrollbar::valueChanged(WebKit::WebScrollbar* scrollbar) { - const PPP_Scrollbar* ppp_scrollbar = static_cast<const PPP_Scrollbar*>( - module()->GetPluginInterface(PPP_SCROLLBAR_INTERFACE)); + const PPP_Scrollbar_Dev* ppp_scrollbar = + static_cast<const PPP_Scrollbar_Dev*>( + module()->GetPluginInterface(PPP_SCROLLBAR_DEV_INTERFACE)); if (!ppp_scrollbar) return; ScopedResourceId resource(this); diff --git a/webkit/glue/plugins/pepper_scrollbar.h b/webkit/glue/plugins/pepper_scrollbar.h index bf25136..4b1e478 100644 --- a/webkit/glue/plugins/pepper_scrollbar.h +++ b/webkit/glue/plugins/pepper_scrollbar.h @@ -8,13 +8,11 @@ #include <vector> #include "gfx/rect.h" -#include "third_party/ppapi/c/ppb_scrollbar.h" +#include "third_party/ppapi/c/dev/ppb_scrollbar_dev.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebScrollbarClient.h" #include "webkit/glue/plugins/pepper_widget.h" -typedef struct _ppb_Scrollbar PPB_Scrollbar; - namespace pepper { class PluginInstance; @@ -26,7 +24,7 @@ class Scrollbar : public Widget, public WebKit::WebScrollbarClient { // Returns a pointer to the interface implementing PPB_Scrollbar that is // exposed to the plugin. - static const PPB_Scrollbar* GetInterface(); + static const PPB_Scrollbar_Dev* GetInterface(); // Resource overrides. Scrollbar* AsScrollbar() { return this; } @@ -36,7 +34,7 @@ class Scrollbar : public Widget, public WebKit::WebScrollbarClient { void SetValue(uint32_t value); void SetDocumentSize(uint32_t size); void SetTickMarks(const PP_Rect* tick_marks, uint32_t count); - void ScrollBy(PP_ScrollBy unit, int32_t multiplier); + void ScrollBy(PP_ScrollBy_Dev unit, int32_t multiplier); // PPB_Widget implementation. virtual bool Paint(const PP_Rect* rect, ImageData* image); diff --git a/webkit/glue/plugins/pepper_url_loader.cc b/webkit/glue/plugins/pepper_url_loader.cc index 26dadad..788e697 100644 --- a/webkit/glue/plugins/pepper_url_loader.cc +++ b/webkit/glue/plugins/pepper_url_loader.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "third_party/ppapi/c/pp_completion_callback.h" #include "third_party/ppapi/c/pp_errors.h" -#include "third_party/ppapi/c/ppb_url_loader.h" +#include "third_party/ppapi/c/dev/ppb_url_loader_dev.h" #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" @@ -139,7 +139,7 @@ void Close(PP_Resource loader_id) { loader->Close(); } -const PPB_URLLoader ppb_urlloader = { +const PPB_URLLoader_Dev ppb_urlloader = { &Create, &IsURLLoader, &Open, @@ -171,7 +171,7 @@ URLLoader::~URLLoader() { } // static -const PPB_URLLoader* URLLoader::GetInterface() { +const PPB_URLLoader_Dev* URLLoader::GetInterface() { return &ppb_urlloader; } diff --git a/webkit/glue/plugins/pepper_url_loader.h b/webkit/glue/plugins/pepper_url_loader.h index 5cf3e81..c8cb652 100644 --- a/webkit/glue/plugins/pepper_url_loader.h +++ b/webkit/glue/plugins/pepper_url_loader.h @@ -13,7 +13,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h" #include "webkit/glue/plugins/pepper_resource.h" -typedef struct _ppb_URLLoader PPB_URLLoader; +struct PPB_URLLoader_Dev; namespace pepper { @@ -28,7 +28,7 @@ class URLLoader : public Resource, public WebKit::WebURLLoaderClient { // Returns a pointer to the interface implementing PPB_URLLoader that is // exposed to the plugin. - static const PPB_URLLoader* GetInterface(); + static const PPB_URLLoader_Dev* GetInterface(); // Resource overrides. URLLoader* AsURLLoader() { return this; } diff --git a/webkit/glue/plugins/pepper_url_request_info.cc b/webkit/glue/plugins/pepper_url_request_info.cc index 1229b51..3c26767 100644 --- a/webkit/glue/plugins/pepper_url_request_info.cc +++ b/webkit/glue/plugins/pepper_url_request_info.cc @@ -62,7 +62,7 @@ bool IsURLRequestInfo(PP_Resource resource) { } bool SetProperty(PP_Resource request_id, - PP_URLRequestProperty property, + PP_URLRequestProperty_Dev property, PP_Var var) { scoped_refptr<URLRequestInfo> request( Resource::GetAs<URLRequestInfo>(request_id)); @@ -111,7 +111,7 @@ bool AppendFileToBody(PP_Resource request_id, expected_last_modified_time); } -const PPB_URLRequestInfo ppb_urlrequestinfo = { +const PPB_URLRequestInfo_Dev ppb_urlrequestinfo = { &Create, &IsURLRequestInfo, &SetProperty, @@ -130,11 +130,11 @@ URLRequestInfo::~URLRequestInfo() { } // static -const PPB_URLRequestInfo* URLRequestInfo::GetInterface() { +const PPB_URLRequestInfo_Dev* URLRequestInfo::GetInterface() { return &ppb_urlrequestinfo; } -bool URLRequestInfo::SetBooleanProperty(PP_URLRequestProperty property, +bool URLRequestInfo::SetBooleanProperty(PP_URLRequestProperty_Dev property, bool value) { switch (property) { case PP_URLREQUESTPROPERTY_STREAMTOFILE: @@ -146,7 +146,7 @@ bool URLRequestInfo::SetBooleanProperty(PP_URLRequestProperty property, } } -bool URLRequestInfo::SetStringProperty(PP_URLRequestProperty property, +bool URLRequestInfo::SetStringProperty(PP_URLRequestProperty_Dev property, const std::string& value) { // TODO(darin): Validate input. Perhaps at a different layer? switch (property) { diff --git a/webkit/glue/plugins/pepper_url_request_info.h b/webkit/glue/plugins/pepper_url_request_info.h index a75a013..7220531 100644 --- a/webkit/glue/plugins/pepper_url_request_info.h +++ b/webkit/glue/plugins/pepper_url_request_info.h @@ -9,7 +9,7 @@ #include <vector> #include "base/ref_counted.h" -#include "third_party/ppapi/c/ppb_url_request_info.h" +#include "third_party/ppapi/c/dev/ppb_url_request_info_dev.h" #include "webkit/glue/plugins/pepper_file_ref.h" #include "webkit/glue/plugins/pepper_resource.h" @@ -27,14 +27,14 @@ class URLRequestInfo : public Resource { // Returns a pointer to the interface implementing PPB_URLRequestInfo that is // exposed to the plugin. - static const PPB_URLRequestInfo* GetInterface(); + static const PPB_URLRequestInfo_Dev* GetInterface(); // Resource overrides. URLRequestInfo* AsURLRequestInfo() { return this; } // PPB_URLRequestInfo implementation. - bool SetBooleanProperty(PP_URLRequestProperty property, bool value); - bool SetStringProperty(PP_URLRequestProperty property, + bool SetBooleanProperty(PP_URLRequestProperty_Dev property, bool value); + bool SetStringProperty(PP_URLRequestProperty_Dev property, const std::string& value); bool AppendDataToBody(const std::string& data); bool AppendFileToBody(FileRef* file_ref, diff --git a/webkit/glue/plugins/pepper_url_response_info.cc b/webkit/glue/plugins/pepper_url_response_info.cc index 878fed5..3e80994 100644 --- a/webkit/glue/plugins/pepper_url_response_info.cc +++ b/webkit/glue/plugins/pepper_url_response_info.cc @@ -43,7 +43,7 @@ bool IsURLResponseInfo(PP_Resource resource) { } PP_Var GetProperty(PP_Resource response_id, - PP_URLResponseProperty property) { + PP_URLResponseProperty_Dev property) { scoped_refptr<URLResponseInfo> response( Resource::GetAs<URLResponseInfo>(response_id)); if (!response) @@ -66,7 +66,7 @@ PP_Resource GetBody(PP_Resource response_id) { return body->GetReference(); } -const PPB_URLResponseInfo ppb_urlresponseinfo = { +const PPB_URLResponseInfo_Dev ppb_urlresponseinfo = { &IsURLResponseInfo, &GetProperty, &GetBody @@ -83,11 +83,11 @@ URLResponseInfo::~URLResponseInfo() { } // static -const PPB_URLResponseInfo* URLResponseInfo::GetInterface() { +const PPB_URLResponseInfo_Dev* URLResponseInfo::GetInterface() { return &ppb_urlresponseinfo; } -PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) { +PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty_Dev property) { switch (property) { case PP_URLRESPONSEPROPERTY_URL: return StringToPPVar(url_); diff --git a/webkit/glue/plugins/pepper_url_response_info.h b/webkit/glue/plugins/pepper_url_response_info.h index 8874919..d8e1321 100644 --- a/webkit/glue/plugins/pepper_url_response_info.h +++ b/webkit/glue/plugins/pepper_url_response_info.h @@ -7,7 +7,7 @@ #include <string> -#include "third_party/ppapi/c/ppb_url_response_info.h" +#include "third_party/ppapi/c/dev/ppb_url_response_info_dev.h" #include "webkit/glue/plugins/pepper_resource.h" namespace WebKit { @@ -23,13 +23,13 @@ class URLResponseInfo : public Resource { // Returns a pointer to the interface implementing PPB_URLResponseInfo that // is exposed to the plugin. - static const PPB_URLResponseInfo* GetInterface(); + static const PPB_URLResponseInfo_Dev* GetInterface(); // Resource overrides. URLResponseInfo* AsURLResponseInfo() { return this; } // PPB_URLResponseInfo implementation. - PP_Var GetProperty(PP_URLResponseProperty property); + PP_Var GetProperty(PP_URLResponseProperty_Dev property); bool Initialize(const WebKit::WebURLResponse& response); diff --git a/webkit/glue/plugins/pepper_url_util.cc b/webkit/glue/plugins/pepper_url_util.cc index 1ba091f..07a0691 100644 --- a/webkit/glue/plugins/pepper_url_util.cc +++ b/webkit/glue/plugins/pepper_url_util.cc @@ -5,7 +5,7 @@ #include "webkit/glue/plugins/pepper_url_util.h" #include "googleurl/src/gurl.h" -#include "third_party/ppapi/c/ppb_url_util.h" +#include "third_party/ppapi/c/dev/ppb_url_util_dev.h" #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" @@ -22,7 +22,7 @@ namespace pepper { namespace { void ConvertComponent(const url_parse::Component& input, - PP_UrlComponent* output) { + PP_UrlComponent_Dev* output) { output->begin = input.begin; output->len = input.len; } @@ -30,7 +30,7 @@ void ConvertComponent(const url_parse::Component& input, // Output can be NULL to specify "do nothing." This rule is followed by all the // url util functions, so we implement it once here. void ConvertComponents(const url_parse::Parsed& input, - PP_UrlComponents* output) { + PP_UrlComponents_Dev* output) { if (!output) return; @@ -46,7 +46,7 @@ void ConvertComponents(const url_parse::Parsed& input, // Used for returning the given GURL from a PPAPI function, with an optional // out param indicating the components. -PP_Var GenerateUrlReturn(const GURL& url, PP_UrlComponents* components) { +PP_Var GenerateUrlReturn(const GURL& url, PP_UrlComponents_Dev* components) { if (!url.is_valid()) return PP_MakeNull(); ConvertComponents(url.parsed_for_possibly_invalid_spec(), components); @@ -72,7 +72,7 @@ bool SecurityOriginForInstance(PP_Instance instance_id, return true; } -PP_Var Canonicalize(PP_Var url, PP_UrlComponents* components) { +PP_Var Canonicalize(PP_Var url, PP_UrlComponents_Dev* components) { String* url_string = GetString(url); if (!url_string) return PP_MakeNull(); @@ -81,7 +81,7 @@ PP_Var Canonicalize(PP_Var url, PP_UrlComponents* components) { PP_Var ResolveRelativeToUrl(PP_Var base_url, PP_Var relative, - PP_UrlComponents* components) { + PP_UrlComponents_Dev* components) { String* base_url_string = GetString(base_url); String* relative_string = GetString(relative); if (!base_url_string || !relative_string) @@ -96,7 +96,7 @@ PP_Var ResolveRelativeToUrl(PP_Var base_url, PP_Var ResolveRelativeToDocument(PP_Instance instance_id, PP_Var relative, - PP_UrlComponents* components) { + PP_UrlComponents_Dev* components) { PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); if (!instance) return PP_MakeNull(); @@ -155,7 +155,7 @@ bool DocumentCanAccessDocument(PP_Instance active, PP_Instance target) { } // namespace -const PPB_UrlUtil ppb_url_util = { +const PPB_UrlUtil_Dev ppb_url_util = { &Canonicalize, &ResolveRelativeToUrl, &ResolveRelativeToDocument, @@ -164,7 +164,8 @@ const PPB_UrlUtil ppb_url_util = { &DocumentCanAccessDocument }; -const PPB_UrlUtil* GetUrlUtilInterface() { +// static +const PPB_UrlUtil_Dev* UrlUtil::GetInterface() { return &ppb_url_util; } diff --git a/webkit/glue/plugins/pepper_url_util.h b/webkit/glue/plugins/pepper_url_util.h index d68d65a..ffb7c76 100644 --- a/webkit/glue/plugins/pepper_url_util.h +++ b/webkit/glue/plugins/pepper_url_util.h @@ -5,11 +5,14 @@ #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_URL_UTIL_H_ #define WEBKIT_GLUE_PLUGINS_PEPPER_URL_UTIL_H_ -typedef struct _ppb_UrlUtil PPB_UrlUtil; +struct PPB_UrlUtil_Dev; namespace pepper { -const PPB_UrlUtil* GetUrlUtilInterface(); +class UrlUtil { + public: + static const PPB_UrlUtil_Dev* GetInterface(); +}; } // namespace pepper diff --git a/webkit/glue/plugins/pepper_var.h b/webkit/glue/plugins/pepper_var.h index 7b95b33..58aaa7d 100644 --- a/webkit/glue/plugins/pepper_var.h +++ b/webkit/glue/plugins/pepper_var.h @@ -7,8 +7,8 @@ #include <string> -typedef struct _pp_Var PP_Var; -typedef struct _ppb_Var PPB_Var; +struct PP_Var; +struct PPB_Var; typedef struct NPObject NPObject; typedef struct _NPVariant NPVariant; typedef void* NPIdentifier; diff --git a/webkit/glue/plugins/pepper_widget.cc b/webkit/glue/plugins/pepper_widget.cc index a8a4ee2..af1bb59 100644 --- a/webkit/glue/plugins/pepper_widget.cc +++ b/webkit/glue/plugins/pepper_widget.cc @@ -5,10 +5,10 @@ #include "webkit/glue/plugins/pepper_widget.h" #include "base/logging.h" +#include "third_party/ppapi/c/dev/ppb_widget_dev.h" +#include "third_party/ppapi/c/dev/ppp_widget_dev.h" #include "third_party/ppapi/c/pp_completion_callback.h" #include "third_party/ppapi/c/pp_errors.h" -#include "third_party/ppapi/c/ppb_widget.h" -#include "third_party/ppapi/c/ppp_widget.h" #include "webkit/glue/plugins/pepper_image_data.h" #include "webkit/glue/plugins/pepper_plugin_instance.h" #include "webkit/glue/plugins/pepper_plugin_module.h" @@ -49,7 +49,7 @@ void SetLocation(PP_Resource resource, const PP_Rect* location) { widget->SetLocation(location); } -const PPB_Widget ppb_widget = { +const PPB_Widget_Dev ppb_widget = { &IsWidget, &Paint, &HandleEvent, @@ -68,7 +68,7 @@ Widget::~Widget() { } // static -const PPB_Widget* Widget::GetInterface() { +const PPB_Widget_Dev* Widget::GetInterface() { return &ppb_widget; } @@ -83,8 +83,8 @@ void Widget::SetLocation(const PP_Rect* location) { } void Widget::Invalidate(const PP_Rect* dirty) { - const PPP_Widget* widget = static_cast<const PPP_Widget*>( - module()->GetPluginInterface(PPP_WIDGET_INTERFACE)); + const PPP_Widget_Dev* widget = static_cast<const PPP_Widget_Dev*>( + module()->GetPluginInterface(PPP_WIDGET_DEV_INTERFACE)); if (!widget) return; ScopedResourceId resource(this); diff --git a/webkit/glue/plugins/pepper_widget.h b/webkit/glue/plugins/pepper_widget.h index 048a718..e2726e2 100644 --- a/webkit/glue/plugins/pepper_widget.h +++ b/webkit/glue/plugins/pepper_widget.h @@ -9,8 +9,8 @@ #include "third_party/ppapi/c/pp_rect.h" #include "webkit/glue/plugins/pepper_resource.h" -typedef struct _ppb_Widget PPB_Widget; -typedef struct _pp_Event PP_Event; +struct PPB_Widget_Dev; +struct PP_Event; namespace pepper { @@ -24,7 +24,7 @@ class Widget : public Resource { // Returns a pointer to the interface implementing PPB_Widget that is // exposed to the plugin. - static const PPB_Widget* GetInterface(); + static const PPB_Widget_Dev* GetInterface(); // Resource overrides. Widget* AsWidget() { return this; } diff --git a/webkit/glue/plugins/ppb_private.h b/webkit/glue/plugins/ppb_private.h index 24831c1..41ef0df 100644 --- a/webkit/glue/plugins/ppb_private.h +++ b/webkit/glue/plugins/ppb_private.h @@ -10,22 +10,22 @@ #define PPB_PRIVATE_INTERFACE "PPB_Private;1" -typedef enum _pp_ResourceString { +typedef enum { PP_RESOURCESTRING_PDFGETPASSWORD = 0, } PP_ResourceString; -typedef enum _pp_PrivateFontPitch { +typedef enum { PP_PRIVATEFONTPITCH_DEFAULT = 0, PP_PRIVATEFONTPITCH_FIXED = 1 } PP_PrivateFontPitch; -typedef enum _pp_PrivateFontFamily { +typedef enum { PP_PRIVATEFONTFAMILY_DEFAULT = 0, PP_PRIVATEFONTFAMILY_ROMAN = 1, PP_PRIVATEFONTFAMILY_SCRIPT = 2 } PP_PrivateFontFamily; -typedef enum _pp_PrivateFontCharset { +typedef enum { PP_PRIVATEFONTCHARSET_ANSI = 0, PP_PRIVATEFONTCHARSET_DEFAULT = 1, PP_PRIVATEFONTCHARSET_SYMBOL = 2, @@ -47,16 +47,16 @@ typedef enum _pp_PrivateFontCharset { PP_PRIVATEFONTCHARSET_OEM = 255 } PP_PrivateFontCharset; -typedef struct _pp_PrivateFontFileDescription { +struct PP_PrivateFontFileDescription { const char* face; uint32_t weight; bool italic; PP_PrivateFontPitch pitch; PP_PrivateFontFamily family; PP_PrivateFontCharset charset; -} PP_PrivateFontFileDescription; +}; -typedef struct _ppb_Private { +struct PPB_Private { // Returns a localized string. PP_Var (*GetLocalizedString)(PP_ResourceString string_id); @@ -72,6 +72,6 @@ typedef struct _ppb_Private { uint32_t table, void* output, uint32_t* output_length); -} PPB_Private; +}; #endif // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index 3c6fcc5..2f5f96b 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -193,8 +193,6 @@ 'plugins/pepper_buffer.h', 'plugins/pepper_char_set.cc', 'plugins/pepper_char_set.h', - 'plugins/pepper_device_context_2d.cc', - 'plugins/pepper_device_context_2d.h', 'plugins/pepper_directory_reader.cc', 'plugins/pepper_directory_reader.h', 'plugins/pepper_event_conversion.cc', @@ -209,6 +207,8 @@ 'plugins/pepper_file_system.h', 'plugins/pepper_font.cc', 'plugins/pepper_font.h', + 'plugins/pepper_graphics_2d.cc', + 'plugins/pepper_graphics_2d.h', 'plugins/pepper_image_data.cc', 'plugins/pepper_image_data.h', 'plugins/pepper_plugin_delegate.h', |