summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-19 17:25:10 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-19 17:25:10 +0000
commit42f8c930d298f8edc24c11a2a2dd2567dbc4955b (patch)
tree68b772db0be7911ec58cb2a774b6bd4df272e948
parentf77b651f037cca5021fa620f1849500afdc3a8a0 (diff)
downloadchromium_src-42f8c930d298f8edc24c11a2a2dd2567dbc4955b.zip
chromium_src-42f8c930d298f8edc24c11a2a2dd2567dbc4955b.tar.gz
chromium_src-42f8c930d298f8edc24c11a2a2dd2567dbc4955b.tar.bz2
Update Chrome to use the new int64-typedefed module, instance, and resources in ppapi
TEST=none BUG=none Review URL: http://codereview.chromium.org/2072010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47681 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rw-r--r--webkit/glue/plugins/pepper_device_context_2d.cc4
-rw-r--r--webkit/glue/plugins/pepper_image_data.cc9
-rw-r--r--webkit/glue/plugins/pepper_plugin_instance.cc6
-rw-r--r--webkit/glue/plugins/pepper_plugin_module.cc6
-rw-r--r--webkit/glue/plugins/pepper_plugin_module.h3
-rw-r--r--webkit/glue/plugins/pepper_resource.cc9
-rw-r--r--webkit/glue/plugins/pepper_resource.h4
-rw-r--r--webkit/glue/plugins/pepper_resource_tracker.cc2
9 files changed, 17 insertions, 28 deletions
diff --git a/DEPS b/DEPS
index 1003c32..ebda750 100644
--- a/DEPS
+++ b/DEPS
@@ -143,7 +143,7 @@ deps = {
Var("ffmpeg_revision"),
"src/third_party/ppapi":
- "http://ppapi.googlecode.com/svn/trunk@42",
+ "http://ppapi.googlecode.com/svn/trunk@44",
}
diff --git a/webkit/glue/plugins/pepper_device_context_2d.cc b/webkit/glue/plugins/pepper_device_context_2d.cc
index 926d194..5419815 100644
--- a/webkit/glue/plugins/pepper_device_context_2d.cc
+++ b/webkit/glue/plugins/pepper_device_context_2d.cc
@@ -61,11 +61,11 @@ PP_Resource Create(PP_Module module_id, int32_t width, int32_t height,
bool is_always_opaque) {
PluginModule* module = PluginModule::FromPPModule(module_id);
if (!module)
- return NullPPResource();
+ return NULL;
scoped_refptr<DeviceContext2D> context(new DeviceContext2D(module));
if (!context->Init(width, height, is_always_opaque))
- return NullPPResource();
+ return NULL;
context->AddRef(); // AddRef for the caller.
return context->GetResource();
}
diff --git a/webkit/glue/plugins/pepper_image_data.cc b/webkit/glue/plugins/pepper_image_data.cc
index ba6ebd7..25642b9 100644
--- a/webkit/glue/plugins/pepper_image_data.cc
+++ b/webkit/glue/plugins/pepper_image_data.cc
@@ -30,17 +30,21 @@ ImageData* ResourceAsImageData(PP_Resource resource) {
return image_resource->AsImageData();
}
+PP_ImageDataFormat GetNativeImageDataFormat() {
+ return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
+}
+
PP_Resource Create(PP_Module module_id,
PP_ImageDataFormat format,
int32_t width, int32_t height,
bool init_to_zero) {
PluginModule* module = PluginModule::FromPPModule(module_id);
if (!module)
- return NullPPResource();
+ return NULL;
scoped_refptr<ImageData> data(new ImageData(module));
if (!data->Init(format, width, height, init_to_zero))
- return NullPPResource();
+ return NULL;
data->AddRef(); // AddRef for the caller.
return data->GetResource();
@@ -80,6 +84,7 @@ void Unmap(PP_Resource resource) {
}
const PPB_ImageData ppb_imagedata = {
+ &GetNativeImageDataFormat,
&Create,
&IsImageData,
&Describe,
diff --git a/webkit/glue/plugins/pepper_plugin_instance.cc b/webkit/glue/plugins/pepper_plugin_instance.cc
index 83f68db..13fd302 100644
--- a/webkit/glue/plugins/pepper_plugin_instance.cc
+++ b/webkit/glue/plugins/pepper_plugin_instance.cc
@@ -158,13 +158,11 @@ const PPB_Instance* PluginInstance::GetInterface() {
// static
PluginInstance* PluginInstance::FromPPInstance(PP_Instance instance) {
- return reinterpret_cast<PluginInstance*>(instance.id);
+ return reinterpret_cast<PluginInstance*>(instance);
}
PP_Instance PluginInstance::GetPPInstance() {
- PP_Instance ret;
- ret.id = reinterpret_cast<intptr_t>(this);
- return ret;
+ return reinterpret_cast<intptr_t>(this);
}
void PluginInstance::Paint(WebKit::WebCanvas* canvas,
diff --git a/webkit/glue/plugins/pepper_plugin_module.cc b/webkit/glue/plugins/pepper_plugin_module.cc
index 3eac61e..37c090c 100644
--- a/webkit/glue/plugins/pepper_plugin_module.cc
+++ b/webkit/glue/plugins/pepper_plugin_module.cc
@@ -122,7 +122,7 @@ scoped_refptr<PluginModule> PluginModule::CreateModule(
// static
PluginModule* PluginModule::FromPPModule(PP_Module module) {
- PluginModule* lib = reinterpret_cast<PluginModule*>(module.id);
+ PluginModule* lib = reinterpret_cast<PluginModule*>(module);
if (GetLivePluginSet()->find(lib) == GetLivePluginSet()->end())
return NULL; // Invalid plugin.
return lib;
@@ -166,9 +166,7 @@ bool PluginModule::Load() {
}
PP_Module PluginModule::GetPPModule() const {
- PP_Module ret;
- ret.id = reinterpret_cast<intptr_t>(this);
- return ret;
+ return reinterpret_cast<intptr_t>(this);
}
PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) {
diff --git a/webkit/glue/plugins/pepper_plugin_module.h b/webkit/glue/plugins/pepper_plugin_module.h
index d14b641..0498c45 100644
--- a/webkit/glue/plugins/pepper_plugin_module.h
+++ b/webkit/glue/plugins/pepper_plugin_module.h
@@ -11,8 +11,7 @@
#include "base/file_path.h"
#include "base/native_library.h"
#include "base/ref_counted.h"
-
-typedef struct _pp_Module PP_Module;
+#include "third_party/ppapi/c/pp_module.h"
namespace pepper {
diff --git a/webkit/glue/plugins/pepper_resource.cc b/webkit/glue/plugins/pepper_resource.cc
index d7ed281..fe2cf4b 100644
--- a/webkit/glue/plugins/pepper_resource.cc
+++ b/webkit/glue/plugins/pepper_resource.cc
@@ -9,11 +9,6 @@
namespace pepper {
-PP_Resource NullPPResource() {
- PP_Resource ret = { 0 };
- return ret;
-}
-
Resource::Resource(PluginModule* module) : module_(module) {
ResourceTracker::Get()->AddResource(this);
}
@@ -23,9 +18,7 @@ Resource::~Resource() {
}
PP_Resource Resource::GetResource() const {
- PP_Resource ret;
- ret.id = reinterpret_cast<intptr_t>(this);
- return ret;
+ return reinterpret_cast<intptr_t>(this);
}
} // namespace pepper
diff --git a/webkit/glue/plugins/pepper_resource.h b/webkit/glue/plugins/pepper_resource.h
index e70ff4a..6c16f14 100644
--- a/webkit/glue/plugins/pepper_resource.h
+++ b/webkit/glue/plugins/pepper_resource.h
@@ -35,10 +35,6 @@ class Resource : public base::RefCountedThreadSafe<Resource> {
DISALLOW_COPY_AND_ASSIGN(Resource);
};
-// Returns a "NULL" resource. This is just a helper function so callers
-// can avoid creating a resource with a 0 ID.
-PP_Resource NullPPResource();
-
} // namespace pepper
#endif // WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_
diff --git a/webkit/glue/plugins/pepper_resource_tracker.cc b/webkit/glue/plugins/pepper_resource_tracker.cc
index 8a58256..3fb9ae8 100644
--- a/webkit/glue/plugins/pepper_resource_tracker.cc
+++ b/webkit/glue/plugins/pepper_resource_tracker.cc
@@ -27,7 +27,7 @@ ResourceTracker* ResourceTracker::Get() {
scoped_refptr<Resource> ResourceTracker::GetResource(PP_Resource res) const {
AutoLock lock(lock_);
- Resource* resource = reinterpret_cast<Resource*>(res.id);
+ Resource* resource = reinterpret_cast<Resource*>(res);
if (live_resources_.find(resource) == live_resources_.end())
return scoped_refptr<Resource>();
return scoped_refptr<Resource>(resource);