Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1225)

Issue 40065: RenderWidgetHost now stores both the WebKeyboardEvent and the native (Closed)

Created:
11 years, 9 months ago by Elliot Glaysher
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

RenderWidgetHost now only accepts a new NativeWebKeyboardEvent which owns a copy of the native os event. Only the WebKeyboardEvent is sent over the IPC barrier, but the full structure passed to the unhandled key event handler. BUG=4772

Patch Set 1 #

Patch Set 2 : Remove stray file. #

Total comments: 2

Patch Set 3 : Redid native event. #

Total comments: 7

Patch Set 4 : Fixes for avi #

Total comments: 9

Patch Set 5 : Redesign #

Total comments: 16
Unified diffs Side-by-side diffs Delta from patch set Stats (+250 lines, -51 lines) Patch
M chrome/browser/renderer_host/render_view_host.h View 1 2 3 4 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_view_host_delegate.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host.h View 1 2 3 4 5 chunks +7 lines, -5 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.cc View 1 2 3 4 3 chunks +13 lines, -10 lines 2 comments Download
M chrome/browser/renderer_host/render_widget_host_unittest.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_gtk.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/interstitial_page.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/tab_contents/web_contents_view_gtk.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/web_contents_view_gtk.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/web_contents_view_mac.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/web_contents_view_mac.mm View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/tab_contents/web_contents_view_win.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/web_contents_view_win.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/chrome.gyp View 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/common.scons View 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/common.vcproj View 3 4 1 chunk +8 lines, -0 lines 0 comments Download
A chrome/common/native_web_keyboard_event.h View 1 chunk +53 lines, -0 lines 8 comments Download
A chrome/common/native_web_keyboard_event_linux.cc View 1 chunk +53 lines, -0 lines 0 comments Download
A chrome/common/native_web_keyboard_event_mac.mm View 1 chunk +37 lines, -0 lines 2 comments Download
A chrome/common/native_web_keyboard_event_win.cc View 1 chunk +45 lines, -0 lines 4 comments Download
M webkit/glue/webinputevent.h View 1 2 3 4 1 chunk +1 line, -11 lines 0 comments Download
M webkit/glue/webinputevent_win.cc View 1 2 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Elliot Glaysher
- Will delete native_message* when the code review tool returns to normal - darin: Please ...
11 years, 9 months ago (2009-03-03 23:57:10 UTC) #1
Avi (use Gerrit)
LG. Good job; thanks for taking this on. http://codereview.chromium.org/40065/diff/1001/1005 File base/native_event.h (right): http://codereview.chromium.org/40065/diff/1001/1005#newcode36 Line 36: ...
11 years, 9 months ago (2009-03-04 15:00:38 UTC) #2
Elliot Glaysher
Darin, I've redid NativeEvent based on your feedback. Please take another look.
11 years, 9 months ago (2009-03-05 00:44:52 UTC) #3
Avi (use Gerrit)
It's a bit weird that you still have the |delete native_event| thing, but I suppose ...
11 years, 9 months ago (2009-03-05 02:28:16 UTC) #4
Elliot Glaysher
http://codereview.chromium.org/40065/diff/1029/56 File chrome/browser/renderer_host/render_view_host.cc (right): http://codereview.chromium.org/40065/diff/1029/56#newcode1221 Line 1221: */ On 2009/03/05 02:28:16, Avi wrote: > It's ...
11 years, 9 months ago (2009-03-05 18:18:58 UTC) #5
darin (slow to review)
here's some of the review comments i had written down before we chatted in person. ...
11 years, 9 months ago (2009-03-05 21:40:00 UTC) #6
Elliot Glaysher
Patch rewritten with a subclass of WebKeyboardEvent to hold native structures (which aren't sent over ...
11 years, 9 months ago (2009-03-06 01:30:03 UTC) #7
darin (slow to review)
looks much better, thanks. just some nit picks: http://codereview.chromium.org/40065/diff/1052/130 File chrome/browser/renderer_host/render_widget_host.cc (right): http://codereview.chromium.org/40065/diff/1052/130#newcode302 Line 302: ...
11 years, 9 months ago (2009-03-06 04:45:35 UTC) #8
Avi (use Gerrit)
lgtm http://codereview.chromium.org/40065/diff/1052/148 File chrome/common/native_web_keyboard_event_mac.mm (right): http://codereview.chromium.org/40065/diff/1052/148#newcode15 Line 15: event([event retain]) { Not that it matters, ...
11 years, 9 months ago (2009-03-06 18:01:34 UTC) #9
Elliot Glaysher
11 years, 9 months ago (2009-03-06 20:51:24 UTC) #10
http://codereview.chromium.org/40065/diff/1052/130
File chrome/browser/renderer_host/render_widget_host.cc (right):

http://codereview.chromium.org/40065/diff/1052/130#newcode302
Line 302: if (WebInputEvent::IsKeyboardEventType(key_event.type)) {
On 2009/03/06 04:45:35, darin wrote:
> previously, we would have only added to the queue if process_->channel() was
> non-null.  that may be worth preserving.

Done.

http://codereview.chromium.org/40065/diff/1052/146
File chrome/common/native_web_keyboard_event.h (right):

http://codereview.chromium.org/40065/diff/1052/146#newcode6
Line 6: #define BASE_GFX_NATIVE_EVENT_H_
On 2009/03/06 04:45:35, darin wrote:
> nit: include guard is out-of-date

Done.

http://codereview.chromium.org/40065/diff/1052/146#newcode8
Line 8: #include "build/build_config.h"
On 2009/03/06 04:45:35, darin wrote:
> nit: no need to include this since you are including basictypes.h (probably
can
> exclude that too since webinputevent.h includes it)

Done.

http://codereview.chromium.org/40065/diff/1052/146#newcode28
Line 28: public:
On 2009/03/06 04:45:35, darin wrote:
> nit: no need for public here since it is a struct

Done.

http://codereview.chromium.org/40065/diff/1052/146#newcode44
Line 44: #if defined(OS_WIN)
On 2009/03/06 04:45:35, darin wrote:
> nit: maybe all of these member variables could have the same name:  os_event
> perhaps?

Done.

http://codereview.chromium.org/40065/diff/1052/148
File chrome/common/native_web_keyboard_event_mac.mm (right):

http://codereview.chromium.org/40065/diff/1052/148#newcode15
Line 15: event([event retain]) {
On 2009/03/06 18:01:34, Avi wrote:
> Not that it matters, but the semantics for gtk and win are copying of the
event
> while here you have joint ownership.

Yeah. There's no refcounting on GdkEvents (since they don't derive from
GObject), otherwise I'd do this in linux, too.

http://codereview.chromium.org/40065/diff/1052/149
File chrome/common/native_web_keyboard_event_win.cc (right):

http://codereview.chromium.org/40065/diff/1052/149#newcode8
Line 8: actual_message.hwnd = NULL;
On 2009/03/06 04:45:35, darin wrote:
> memset(&actual_message, 0, sizeof(actual_message));
> 
> however, the base class default constructor does nothing, so perhaps this one
> should too.  in fact, i'd be surprised if this constructor is ever called.  is
> it?  i bet you could make it private forcing people to use the other
> constructor.

I can't make this private because I use the default constructor for unit
testing, but I can cut out the work.

http://codereview.chromium.org/40065/diff/1052/149#newcode23
Line 23: NativeWebKeyboardEvent::NativeWebKeyboardEvent(
On 2009/03/06 04:45:35, darin wrote:
> i don't think there is any reason to implement copy constructors or assignment
> operators for OS_WIN.  the defaults should work properly.

I feel this is the lesser of two evils compared to the ifdef statements
necessary in the header to supply declare copy constructors/operator=s for some
(but not all) platforms.

Powered by Google App Engine
This is Rietveld 408576698