summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-22 03:19:10 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-22 03:19:10 +0000
commit212a96285521d213cd7fe720f26a721cdae70d90 (patch)
treee52b150f7155fcfa589b25b11fe662fc314fc803 /webkit
parentf678c1005e3cd343169e5d8a0932ff191d4da740 (diff)
downloadchromium_src-212a96285521d213cd7fe720f26a721cdae70d90.zip
chromium_src-212a96285521d213cd7fe720f26a721cdae70d90.tar.gz
chromium_src-212a96285521d213cd7fe720f26a721cdae70d90.tar.bz2
Reland http://codereview.chromium.org/7484003/:
Remove backwards compatibility for PPP_Instance 0.5 and old input events. Note this can't land until the associated NaCl DEPS roll is landed: http://codereview.chromium.org/7478001/ BUG=none TEST=ppapi tests TBR=dmichael@chromium.org Review URL: http://codereview.chromium.org/7488003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/event_conversion.cc56
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc17
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc27
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.h8
-rw-r--r--webkit/plugins/ppapi/ppapi_unittest.cc5
5 files changed, 7 insertions, 106 deletions
diff --git a/webkit/plugins/ppapi/event_conversion.cc b/webkit/plugins/ppapi/event_conversion.cc
index bfd9ee1..eb051da 100644
--- a/webkit/plugins/ppapi/event_conversion.cc
+++ b/webkit/plugins/ppapi/event_conversion.cc
@@ -13,8 +13,6 @@
#include "base/utf_string_conversion_utils.h"
#include "ppapi/c/pp_input_event.h"
#include "ppapi/shared_impl/input_event_impl.h"
-// TODO(dmichael): Remove this include when PP_InputEvent is gone from m14.
-#include "ppapi/shared_impl/ppp_instance_combined.h"
#include "ppapi/shared_impl/time_conversion.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "webkit/plugins/ppapi/common.h"
@@ -98,7 +96,7 @@ void AppendCharEvent(const WebInputEvent& event,
key_event.text[utf16_char_count])
utf16_char_count++;
- // Make a separate PP_InputEvent for each Unicode character in the input.
+ // Make a separate InputEventData for each Unicode character in the input.
base::i18n::UTF16CharIterator iter(key_event.text, utf16_char_count);
while (!iter.end()) {
InputEventData result = GetEventWithCommonFieldsAndType(event);
@@ -244,60 +242,8 @@ WebMouseWheelEvent* BuildMouseWheelEvent(const InputEventData& event) {
return mouse_wheel_event;
}
-void InputEventDataToPPInputEvent(const InputEventData& data,
- PP_InputEvent* result) {
- memset(result, 0, sizeof(PP_InputEvent));
- result->type = data.event_type;
- result->time_stamp = data.event_time_stamp;
-
- switch (data.event_type) {
- case PP_INPUTEVENT_TYPE_MOUSEDOWN:
- case PP_INPUTEVENT_TYPE_MOUSEUP:
- case PP_INPUTEVENT_TYPE_MOUSEMOVE:
- case PP_INPUTEVENT_TYPE_MOUSEENTER:
- case PP_INPUTEVENT_TYPE_MOUSELEAVE:
- case PP_INPUTEVENT_TYPE_CONTEXTMENU:
- result->u.mouse.modifier = data.event_modifiers;
- result->u.mouse.button = data.mouse_button;
- result->u.mouse.x = static_cast<float>(data.mouse_position.x);
- result->u.mouse.y = static_cast<float>(data.mouse_position.y);
- result->u.mouse.click_count = data.mouse_click_count;
- break;
- case PP_INPUTEVENT_TYPE_WHEEL:
- result->u.wheel.modifier = data.event_modifiers;
- result->u.wheel.delta_x = data.wheel_delta.x;
- result->u.wheel.delta_y = data.wheel_delta.y;
- result->u.wheel.wheel_ticks_x = data.wheel_ticks.x;
- result->u.wheel.wheel_ticks_y = data.wheel_ticks.y;
- break;
- case PP_INPUTEVENT_TYPE_RAWKEYDOWN:
- case PP_INPUTEVENT_TYPE_KEYDOWN:
- case PP_INPUTEVENT_TYPE_KEYUP:
- result->u.key.modifier = data.event_modifiers;
- result->u.key.key_code = data.key_code;
- break;
- case PP_INPUTEVENT_TYPE_CHAR:
- result->u.character.modifier = data.event_modifiers;
- base::strlcpy(result->u.character.text, data.character_text.c_str(),
- arraysize(result->u.character.text));
- break;
- case PP_INPUTEVENT_TYPE_UNDEFINED:
- break;
- }
-}
-
} // namespace
-void CreatePPEvent(const WebInputEvent& event,
- std::vector<PP_InputEvent>* pp_events) {
- std::vector<InputEventData> data;
- CreateInputEventData(event, &data);
-
- pp_events->resize(data.size());
- for (size_t i = 0; i < data.size(); i++)
- InputEventDataToPPInputEvent(data[i], &(*pp_events)[i]);
-}
-
void CreateInputEventData(const WebInputEvent& event,
std::vector<InputEventData>* result) {
result->clear();
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 62d69cc..c665325 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -74,9 +74,6 @@
#include "ppapi/c/trusted/ppb_image_data_trusted.h"
#include "ppapi/c/trusted/ppb_url_loader_trusted.h"
#include "ppapi/shared_impl/input_event_impl.h"
-// TODO(dmichael): Delete this include after PPP_Instance_0_5 goes away in m14.
-// This is just to get the PPP_INSTANCE_0_5 definition.
-#include "ppapi/shared_impl/ppp_instance_combined.h"
#include "ppapi/shared_impl/time_conversion.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/thunk.h"
@@ -292,19 +289,19 @@ const void* GetInterface(const char* name) {
return ::ppapi::thunk::GetPPB_ImageData_Thunk();
if (strcmp(name, PPB_IMAGEDATA_TRUSTED_INTERFACE) == 0)
return ::ppapi::thunk::GetPPB_ImageDataTrusted_Thunk();
- if (strcmp(name, PPB_INPUT_EVENT_INTERFACE) == 0)
+ if (strcmp(name, PPB_INPUT_EVENT_INTERFACE_1_0) == 0)
return ::ppapi::thunk::GetPPB_InputEvent_Thunk();
if (strcmp(name, PPB_INSTANCE_INTERFACE_1_0) == 0)
return ::ppapi::thunk::GetPPB_Instance_1_0_Thunk();
if (strcmp(name, PPB_INSTANCE_PRIVATE_INTERFACE) == 0)
return ::ppapi::thunk::GetPPB_Instance_Private_Thunk();
- if (strcmp(name, PPB_KEYBOARD_INPUT_EVENT_INTERFACE) == 0)
+ if (strcmp(name, PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0) == 0)
return ::ppapi::thunk::GetPPB_KeyboardInputEvent_Thunk();
if (strcmp(name, PPB_MEMORY_DEV_INTERFACE) == 0)
return PPB_Memory_Impl::GetInterface();
if (strcmp(name, PPB_MESSAGING_INTERFACE_1_0) == 0)
return ::ppapi::thunk::GetPPB_Messaging_Thunk();
- if (strcmp(name, PPB_MOUSE_INPUT_EVENT_INTERFACE) == 0)
+ if (strcmp(name, PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0) == 0)
return ::ppapi::thunk::GetPPB_MouseInputEvent_Thunk();
if (strcmp(name, PPB_PROXY_PRIVATE_INTERFACE) == 0)
return PPB_Proxy_Impl::GetInterface();
@@ -332,7 +329,7 @@ const void* GetInterface(const char* name) {
return ::ppapi::thunk::GetPPB_VideoDecoder_Thunk();
if (strcmp(name, PPB_VIDEOLAYER_DEV_INTERFACE) == 0)
return ::ppapi::thunk::GetPPB_VideoLayer_Thunk();
- if (strcmp(name, PPB_WHEEL_INPUT_EVENT_INTERFACE) == 0)
+ if (strcmp(name, PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0) == 0)
return ::ppapi::thunk::GetPPB_WheelInputEvent_Thunk();
if (strcmp(name, PPB_WIDGET_DEV_INTERFACE) == 0)
return ::ppapi::thunk::GetPPB_Widget_Thunk();
@@ -509,11 +506,7 @@ PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) {
const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_0);
if (ppp_instance) {
instance = PluginInstance::Create1_0(delegate, this, ppp_instance);
- } else if ((ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_0_5))) {
- // TODO(dmichael): Remove support for 0.5 in m14.
- instance = PluginInstance::Create0_5(delegate, this, ppp_instance);
- }
- if (!instance) {
+ } if (!instance) {
LOG(WARNING) << "Plugin doesn't support instance interface, failing.";
return NULL;
}
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index ecc7125..56682d1 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -189,18 +189,6 @@ void RectToPPRect(const gfx::Rect& input, PP_Rect* output) {
} // namespace
// static
-PluginInstance* PluginInstance::Create0_5(PluginDelegate* delegate,
- PluginModule* module,
- const void* ppp_instance_if_0_5) {
- const PPP_Instance_0_5* interface =
- static_cast<const PPP_Instance_0_5*>(ppp_instance_if_0_5);
- return new PluginInstance(
- delegate,
- module,
- new ::ppapi::PPP_Instance_Combined(*interface));
-}
-
-// static
PluginInstance* PluginInstance::Create1_0(PluginDelegate* delegate,
PluginModule* module,
const void* ppp_instance_if_1_0) {
@@ -480,21 +468,6 @@ bool PluginInstance::HandleInputEvent(const WebKit::WebInputEvent& event,
}
}
- // For compatibility, also send all input events through the old interface,
- // if it exists.
- // TODO(brettw) remove this.
- if (instance_interface_->HandleInputEvent_0_5) {
- std::vector<PP_InputEvent> pp_events;
- CreatePPEvent(event, &pp_events);
-
- // Each input event may generate more than one PP_InputEvent.
- for (size_t i = 0; i < pp_events.size(); i++) {
- rv |= PP_ToBool(
- instance_interface_->HandleInputEvent_0_5(pp_instance(),
- &pp_events[i]));
- }
- }
-
if (cursor_.get())
*cursor_info = *cursor_;
return rv;
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h
index a69c54a..f3e71a2 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.h
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h
@@ -86,14 +86,8 @@ class PluginInstance : public base::RefCounted<PluginInstance>,
public ::ppapi::thunk::PPB_Instance_FunctionAPI,
public ::ppapi::InstanceImpl {
public:
- // TODO(dmichael): Delete this for m14.
// Create and return a PluginInstance object which supports the
- // PPP_Instance_0_5 interface.
- static PluginInstance* Create0_5(PluginDelegate* delegate,
- PluginModule* module,
- const void* ppp_instance_if_0_5);
- // Create and return a PluginInstance object which supports the
- // PPP_Instance_0_5 interface.
+ // PPP_Instance_1_0 interface.
static PluginInstance* Create1_0(PluginDelegate* delegate,
PluginModule* module,
const void* ppp_instance_if_1_0);
diff --git a/webkit/plugins/ppapi/ppapi_unittest.cc b/webkit/plugins/ppapi/ppapi_unittest.cc
index ef083998..64db949 100644
--- a/webkit/plugins/ppapi/ppapi_unittest.cc
+++ b/webkit/plugins/ppapi/ppapi_unittest.cc
@@ -46,11 +46,6 @@ void Instance_DidChangeView(PP_Instance pp_instance,
void Instance_DidChangeFocus(PP_Instance pp_instance, PP_Bool has_focus) {
}
-PP_Bool Instance_HandleInputEvent(PP_Instance pp_instance,
- const PP_InputEvent* event) {
- return PP_FALSE;
-}
-
PP_Bool Instance_HandleDocumentLoad(PP_Instance pp_instance,
PP_Resource pp_url_loader) {
return PP_FALSE;