summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-24 19:24:46 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-24 19:24:46 +0000
commit4d176de8584eba1276446ccddc9b5e9a7f3f2107 (patch)
treee06b171150fe1822de14cf4ef5856e79690823b2
parent88dc46191ae7a0c1ada763843d3465d735c6b271 (diff)
downloadchromium_src-4d176de8584eba1276446ccddc9b5e9a7f3f2107.zip
chromium_src-4d176de8584eba1276446ccddc9b5e9a7f3f2107.tar.gz
chromium_src-4d176de8584eba1276446ccddc9b5e9a7f3f2107.tar.bz2
retain NSEvent explicitly instead of adopt, fixes over-releasing. Check event type on correct variable.
Review URL: http://codereview.chromium.org/4069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2562 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webinputevent_mac.mm6
-rw-r--r--webkit/tools/test_shell/mac/webwidget_host.mm8
2 files changed, 10 insertions, 4 deletions
diff --git a/webkit/glue/webinputevent_mac.mm b/webkit/glue/webinputevent_mac.mm
index 08da30f..363c25f 100644
--- a/webkit/glue/webinputevent_mac.mm
+++ b/webkit/glue/webinputevent_mac.mm
@@ -90,7 +90,7 @@ WebMouseEvent::WebMouseEvent(NSEvent *event) {
layout_test_click_count = 0;
- mac_event.adoptNS(event);
+ mac_event = event; // retains |event|
}
// WebMouseWheelEvent ---------------------------------------------------------
@@ -131,7 +131,7 @@ WebMouseWheelEvent::WebMouseWheelEvent(NSEvent *event) {
if ([event modifierFlags] & NSAlternateKeyMask)
modifiers |= ALT_KEY;
- mac_event.adoptNS(event);
+ mac_event = event; // retains |event|
}
// WebKeyboardEvent -----------------------------------------------------------
@@ -162,5 +162,5 @@ WebKeyboardEvent::WebKeyboardEvent(NSEvent *event) {
key_code = [event keyCode];
key_data = [[event characters] characterAtIndex:0];
- mac_event.adoptNS(event);
+ mac_event = event; // retains |event|
}
diff --git a/webkit/tools/test_shell/mac/webwidget_host.mm b/webkit/tools/test_shell/mac/webwidget_host.mm
index d2671a4..cfd8ab8 100644
--- a/webkit/tools/test_shell/mac/webwidget_host.mm
+++ b/webkit/tools/test_shell/mac/webwidget_host.mm
@@ -214,7 +214,7 @@ void WebWidgetHost::Resize(const gfx::Rect& rect) {
void WebWidgetHost::MouseEvent(NSEvent *event) {
WebMouseEvent web_event(event);
- switch (event.type) {
+ switch (web_event.type) {
case WebInputEvent::MOUSE_MOVE:
TrackMouseLeave(true);
break;
@@ -225,6 +225,12 @@ void WebWidgetHost::MouseEvent(NSEvent *event) {
break;
case WebInputEvent::MOUSE_UP:
break;
+ case WebInputEvent::MOUSE_DOUBLE_CLICK:
+ case WebInputEvent::MOUSE_WHEEL:
+ case WebInputEvent::KEY_DOWN:
+ case WebInputEvent::KEY_UP:
+ case WebInputEvent::CHAR:
+ break;
}
webwidget_->HandleInputEvent(&web_event);
}