summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/ppb_audio_impl.cc15
-rw-r--r--webkit/plugins/ppapi/ppb_graphics_2d_impl.cc9
-rw-r--r--webkit/plugins/ppapi/ppb_image_data_impl.cc9
-rw-r--r--webkit/plugins/ppapi/var.cc16
4 files changed, 33 insertions, 16 deletions
diff --git a/webkit/plugins/ppapi/ppb_audio_impl.cc b/webkit/plugins/ppapi/ppb_audio_impl.cc
index db11eba..c535334 100644
--- a/webkit/plugins/ppapi/ppb_audio_impl.cc
+++ b/webkit/plugins/ppapi/ppb_audio_impl.cc
@@ -19,11 +19,11 @@ namespace {
uint32_t RecommendSampleFrameCount(uint32_t requested_sample_frame_count);
-PP_Resource CreateStereo16bit(PP_Module module_id,
+PP_Resource CreateStereo16bit(PP_Instance instance_id,
PP_AudioSampleRate_Dev sample_rate,
uint32_t sample_frame_count) {
- PluginModule* module = ResourceTracker::Get()->GetModule(module_id);
- if (!module)
+ PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id);
+ if (!instance)
return 0;
// TODO(brettw): Currently we don't actually check what the hardware
@@ -38,7 +38,8 @@ PP_Resource CreateStereo16bit(PP_Module module_id,
return 0;
scoped_refptr<PPB_AudioConfig_Impl> config(
- new PPB_AudioConfig_Impl(module, sample_rate, sample_frame_count));
+ new PPB_AudioConfig_Impl(instance->module(), sample_rate,
+ sample_frame_count));
return config->GetReference();
}
@@ -102,7 +103,8 @@ PP_Bool IsAudio(PP_Resource resource) {
}
PP_Resource GetCurrentConfig(PP_Resource audio_id) {
- scoped_refptr<PPB_Audio_Impl> audio = Resource::GetAs<PPB_Audio_Impl>(audio_id);
+ scoped_refptr<PPB_Audio_Impl> audio =
+ Resource::GetAs<PPB_Audio_Impl>(audio_id);
return audio ? audio->GetCurrentConfig() : 0;
}
@@ -132,7 +134,8 @@ PP_Resource CreateTrusted(PP_Instance instance_id) {
PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id);
if (!instance)
return 0;
- scoped_refptr<PPB_Audio_Impl> audio(new PPB_Audio_Impl(instance->module(), instance_id));
+ scoped_refptr<PPB_Audio_Impl> audio(
+ new PPB_Audio_Impl(instance->module(), instance_id));
return audio->GetReference();
}
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
index a783be4..0925f52 100644
--- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
@@ -112,14 +112,15 @@ void ConvertImageData(PPB_ImageData_Impl* src_image, const SkIRect& src_rect,
}
}
-PP_Resource Create(PP_Module module_id,
+PP_Resource Create(PP_Instance instance_id,
const PP_Size* size,
PP_Bool is_always_opaque) {
- PluginModule* module = ResourceTracker::Get()->GetModule(module_id);
- if (!module)
+ PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id);
+ if (!instance)
return 0;
- scoped_refptr<PPB_Graphics2D_Impl> context(new PPB_Graphics2D_Impl(module));
+ scoped_refptr<PPB_Graphics2D_Impl> context(new PPB_Graphics2D_Impl(
+ instance->module()));
if (!context->Init(size->width, size->height, PPBoolToBool(is_always_opaque)))
return 0;
return context->GetReference();
diff --git a/webkit/plugins/ppapi/ppb_image_data_impl.cc b/webkit/plugins/ppapi/ppb_image_data_impl.cc
index ee89cc3..b961a66 100644
--- a/webkit/plugins/ppapi/ppb_image_data_impl.cc
+++ b/webkit/plugins/ppapi/ppb_image_data_impl.cc
@@ -33,15 +33,16 @@ PP_Bool IsImageDataFormatSupported(PP_ImageDataFormat format) {
return BoolToPPBool(PPB_ImageData_Impl::IsImageDataFormatSupported(format));
}
-PP_Resource Create(PP_Module module_id,
+PP_Resource Create(PP_Instance instance_id,
PP_ImageDataFormat format,
const PP_Size* size,
PP_Bool init_to_zero) {
- PluginModule* module = ResourceTracker::Get()->GetModule(module_id);
- if (!module)
+ PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id);
+ if (!instance)
return 0;
- scoped_refptr<PPB_ImageData_Impl> data(new PPB_ImageData_Impl(module));
+ scoped_refptr<PPB_ImageData_Impl> data(
+ new PPB_ImageData_Impl(instance->module()));
if (!data->Init(format,
size->width,
size->height,
diff --git a/webkit/plugins/ppapi/var.cc b/webkit/plugins/ppapi/var.cc
index 132cdfb..4ed0e10 100644
--- a/webkit/plugins/ppapi/var.cc
+++ b/webkit/plugins/ppapi/var.cc
@@ -600,9 +600,20 @@ bool IsInstanceOfDeprecated(PP_Var var,
ppp_class, ppp_class_data);
}
-PP_Var CreateObjectDeprecated(PP_Module module_id,
+PP_Var CreateObjectDeprecated(PP_Instance instance_id,
const PPP_Class_Deprecated* ppp_class,
void* ppp_class_data) {
+ PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id);
+ if (!instance) {
+ DLOG(ERROR) << "Create object passed an invalid instance.";
+ return PP_MakeNull();
+ }
+ return PluginObject::Create(instance->module(), ppp_class, ppp_class_data);
+}
+
+PP_Var CreateObjectWithModuleDeprecated(PP_Module module_id,
+ const PPP_Class_Deprecated* ppp_class,
+ void* ppp_class_data) {
PluginModule* module = ResourceTracker::Get()->GetModule(module_id);
if (!module)
return PP_MakeNull();
@@ -623,7 +634,8 @@ const PPB_Var_Deprecated var_deprecated_interface = {
&CallDeprecated,
&Construct,
&IsInstanceOfDeprecated,
- &CreateObjectDeprecated
+ &CreateObjectDeprecated,
+ &CreateObjectWithModuleDeprecated,
};
const PPB_Var var_interface = {