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

Issue 8970016: refactoring mouse lock to support pepper and WebKit (Closed)

Created:
9 years ago by scheib
Modified:
8 years, 11 months ago
Reviewers:
yzshen1, piman
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, dpranke-watch+content_chromium.org
Visibility:
Public.

Description

Mouse Lock is currently supported in Pepper, but not yet supported from WebKit. Move the render thread logic for managing the mouse lock state out of the pepper_plugin_delegate_impl, and into a higher level dispatcher for render_view_impl. Handle mouse lock / pointer lock requests from both pepper and webkit (WebKit API not yet landed, small TODOs left in this code to enable once that lands). BUG=109957 TEST=Pepper examples/mouse_lock and NaCl mouse lock examples still work. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=119206 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=119406

Patch Set 1 #

Total comments: 5

Patch Set 2 : Refactor MouseLockDispatcher out of RenderViewImpl #

Total comments: 2

Patch Set 3 : Updated webkit API names. #

Total comments: 44

Patch Set 4 : Incorporated yzshen feedback #

Patch Set 5 : Remove WebKit API dependency #

Total comments: 6

Patch Set 6 : mock_plugin_delegate updated with interface changes #

Patch Set 7 : Comments and whitespace #

Total comments: 19

Patch Set 8 : Refactor LockTarget interface & Tests #

Total comments: 43

Patch Set 9 : Fixes & WebKit APIs are bound now. #

Total comments: 10

Patch Set 10 : yzshen issues addressed #

Patch Set 11 : OnLockTargetDestroyed typo #

Total comments: 1

Patch Set 12 : .empty() instead of size() #

Patch Set 13 : Merge TOT #

Patch Set 14 : CONTENT_EXPORT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+660 lines, -202 lines) Patch
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
A content/renderer/mouse_lock_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +87 lines, -0 lines 0 comments Download
A content/renderer/mouse_lock_dispatcher.cc View 1 2 3 4 5 6 7 8 1 chunk +117 lines, -0 lines 0 comments Download
A content/renderer/mouse_lock_dispatcher_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +232 lines, -0 lines 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.h View 1 2 3 4 5 6 7 6 chunks +11 lines, -28 lines 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +61 lines, -116 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 6 chunks +14 lines, -2 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +54 lines, -21 lines 0 comments Download
M ppapi/examples/mouse_lock/mouse_lock.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M ppapi/examples/mouse_lock/mouse_lock.html View 1 2 3 4 5 6 7 8 2 chunks +36 lines, -16 lines 0 comments Download
M webkit/plugins/ppapi/mock_plugin_delegate.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M webkit/plugins/ppapi/mock_plugin_delegate.cc View 1 2 3 4 5 1 chunk +6 lines, -2 lines 0 comments Download
M webkit/plugins/ppapi/plugin_delegate.h View 1 2 3 2 chunks +8 lines, -5 lines 0 comments Download
M webkit/plugins/ppapi/ppapi_plugin_instance.h View 1 2 3 4 5 6 2 chunks +6 lines, -1 line 0 comments Download
M webkit/plugins/ppapi/ppapi_plugin_instance.cc View 1 2 3 3 chunks +21 lines, -9 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
yzshen1
I apologize for late reply. The change mostly looks good. http://codereview.chromium.org/8970016/diff/1/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): http://codereview.chromium.org/8970016/diff/1/content/renderer/render_view_impl.cc#newcode4847 ...
8 years, 11 months ago (2012-01-04 00:50:00 UTC) #1
scheib
Thanks for previous review, I've addressed concerns and this should be in a state for ...
8 years, 11 months ago (2012-01-12 19:36:47 UTC) #2
yzshen1
The first part of comments. Thanks! http://codereview.chromium.org/8970016/diff/13001/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): http://codereview.chromium.org/8970016/diff/13001/content/renderer/render_view_impl.cc#newcode435 content/renderer/render_view_impl.cc:435: mouse_lock_dispatcher_ = new ...
8 years, 11 months ago (2012-01-12 19:49:25 UTC) #3
scheib
Added the missing files... sorry. http://codereview.chromium.org/8970016/diff/13001/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): http://codereview.chromium.org/8970016/diff/13001/content/renderer/render_view_impl.cc#newcode435 content/renderer/render_view_impl.cc:435: mouse_lock_dispatcher_ = new MouseLockDispatcher(this); ...
8 years, 11 months ago (2012-01-12 21:25:19 UTC) #4
yzshen1
http://codereview.chromium.org/8970016/diff/15001/content/renderer/mouse_lock_dispatcher.cc File content/renderer/mouse_lock_dispatcher.cc (right): http://codereview.chromium.org/8970016/diff/15001/content/renderer/mouse_lock_dispatcher.cc#newcode1 content/renderer/mouse_lock_dispatcher.cc:1: // Copyright (c) 2011 The Chromium Authors. All rights ...
8 years, 11 months ago (2012-01-16 07:50:34 UTC) #5
scheib
Thanks for review. Items addressed; 2 responses to questions: http://codereview.chromium.org/8970016/diff/15001/content/renderer/mouse_lock_dispatcher.cc File content/renderer/mouse_lock_dispatcher.cc (right): http://codereview.chromium.org/8970016/diff/15001/content/renderer/mouse_lock_dispatcher.cc#newcode1 content/renderer/mouse_lock_dispatcher.cc:1: ...
8 years, 11 months ago (2012-01-17 22:05:36 UTC) #6
scheib
Brett, could you OWNERS review? I've removed the WebKit API dependency to allow this to ...
8 years, 11 months ago (2012-01-17 23:14:48 UTC) #7
yzshen1
http://codereview.chromium.org/8970016/diff/15001/content/renderer/mouse_lock_dispatcher.h File content/renderer/mouse_lock_dispatcher.h (right): http://codereview.chromium.org/8970016/diff/15001/content/renderer/mouse_lock_dispatcher.h#newcode30 content/renderer/mouse_lock_dispatcher.h:30: bool LockMouse(WebKit::WebWidget* webwidget, On 2012/01/17 22:05:36, scheib wrote: > ...
8 years, 11 months ago (2012-01-17 23:39:25 UTC) #8
scheib
http://codereview.chromium.org/8970016/diff/15001/content/renderer/mouse_lock_dispatcher.h File content/renderer/mouse_lock_dispatcher.h (right): http://codereview.chromium.org/8970016/diff/15001/content/renderer/mouse_lock_dispatcher.h#newcode30 content/renderer/mouse_lock_dispatcher.h:30: bool LockMouse(WebKit::WebWidget* webwidget, On 2012/01/17 23:39:25, yzshen1 wrote: > ...
8 years, 11 months ago (2012-01-18 17:54:58 UTC) #9
yzshen1
lgtm
8 years, 11 months ago (2012-01-18 18:13:29 UTC) #10
scheib
piman, can you do Owner review. (brettw not available)
8 years, 11 months ago (2012-01-18 18:18:28 UTC) #11
piman
The ownership logic is a bit subtle, especially in the context of asynchronous messages. Could ...
8 years, 11 months ago (2012-01-18 19:00:59 UTC) #12
yzshen1
http://codereview.chromium.org/8970016/diff/37001/webkit/plugins/ppapi/ppapi_plugin_instance.cc File webkit/plugins/ppapi/ppapi_plugin_instance.cc (right): http://codereview.chromium.org/8970016/diff/37001/webkit/plugins/ppapi/ppapi_plugin_instance.cc#newcode1997 webkit/plugins/ppapi/ppapi_plugin_instance.cc:1997: return PP_ERROR_FAILED; On 2012/01/18 19:00:59, piman wrote: > This ...
8 years, 11 months ago (2012-01-18 19:21:42 UTC) #13
piman
http://codereview.chromium.org/8970016/diff/37001/webkit/plugins/ppapi/ppapi_plugin_instance.cc File webkit/plugins/ppapi/ppapi_plugin_instance.cc (right): http://codereview.chromium.org/8970016/diff/37001/webkit/plugins/ppapi/ppapi_plugin_instance.cc#newcode1997 webkit/plugins/ppapi/ppapi_plugin_instance.cc:1997: return PP_ERROR_FAILED; On 2012/01/18 19:21:42, yzshen1 wrote: > On ...
8 years, 11 months ago (2012-01-18 19:26:00 UTC) #14
scheib
I've introduced an interface LockTarget that eases testing and removed the dual pointers from MouseLockDispatcher. ...
8 years, 11 months ago (2012-01-24 01:51:42 UTC) #15
piman
Very nice test! I think there's a missing delete, the rest is nits. http://codereview.chromium.org/8970016/diff/15002/content/renderer/mouse_lock_dispatcher.cc File ...
8 years, 11 months ago (2012-01-24 02:27:37 UTC) #16
yzshen1
http://codereview.chromium.org/8970016/diff/15002/content/content_tests.gypi File content/content_tests.gypi (right): http://codereview.chromium.org/8970016/diff/15002/content/content_tests.gypi#newcode286 content/content_tests.gypi:286: 'renderer/mouse_lock_dispatcher_unittest.cc', Alphabetically, please. http://codereview.chromium.org/8970016/diff/15002/content/renderer/mouse_lock_dispatcher.cc File content/renderer/mouse_lock_dispatcher.cc (right): http://codereview.chromium.org/8970016/diff/15002/content/renderer/mouse_lock_dispatcher.cc#newcode24 content/renderer/mouse_lock_dispatcher.cc:24: ...
8 years, 11 months ago (2012-01-24 18:56:07 UTC) #17
scheib
Thanks again. Bonus: the WebKit API has landed and rolled in DEPs. I have removed ...
8 years, 11 months ago (2012-01-25 00:27:10 UTC) #18
yzshen1
http://codereview.chromium.org/8970016/diff/15002/content/renderer/mouse_lock_dispatcher.h File content/renderer/mouse_lock_dispatcher.h (right): http://codereview.chromium.org/8970016/diff/15002/content/renderer/mouse_lock_dispatcher.h#newcode45 content/renderer/mouse_lock_dispatcher.h:45: // Lock the mouse to the |target|. If true ...
8 years, 11 months ago (2012-01-25 18:10:00 UTC) #19
piman
http://codereview.chromium.org/8970016/diff/56001/content/renderer/mouse_lock_dispatcher.h File content/renderer/mouse_lock_dispatcher.h (right): http://codereview.chromium.org/8970016/diff/56001/content/renderer/mouse_lock_dispatcher.h#newcode80 content/renderer/mouse_lock_dispatcher.h:80: // owning reference here that must be cleared by ...
8 years, 11 months ago (2012-01-26 01:31:26 UTC) #20
scheib
http://codereview.chromium.org/8970016/diff/56001/content/renderer/mouse_lock_dispatcher.h File content/renderer/mouse_lock_dispatcher.h (right): http://codereview.chromium.org/8970016/diff/56001/content/renderer/mouse_lock_dispatcher.h#newcode80 content/renderer/mouse_lock_dispatcher.h:80: // owning reference here that must be cleared by ...
8 years, 11 months ago (2012-01-26 01:37:59 UTC) #21
piman
LGTM+nit http://codereview.chromium.org/8970016/diff/56004/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc (right): http://codereview.chromium.org/8970016/diff/56004/content/renderer/pepper_plugin_delegate_impl.cc#newcode880 content/renderer/pepper_plugin_delegate_impl.cc:880: DCHECK(!mouse_lock_instances_.size()); nit: DCHECK(mouse_lock_instances_.empty());
8 years, 11 months ago (2012-01-26 01:59:33 UTC) #22
yzshen1
lgtm
8 years, 11 months ago (2012-01-26 02:15:12 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/scheib@chromium.org/8970016/55027
8 years, 11 months ago (2012-01-26 03:38:33 UTC) #24
commit-bot: I haz the power
Change committed as 119206
8 years, 11 months ago (2012-01-26 07:13:22 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/scheib@chromium.org/8970016/60002
8 years, 11 months ago (2012-01-27 05:41:52 UTC) #26
commit-bot: I haz the power
8 years, 11 months ago (2012-01-27 07:33:13 UTC) #27
Change committed as 119406

Powered by Google App Engine
This is Rietveld 408576698