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

Issue 2858049: Chromium plumbing for Device Orientation. (Closed)

Created:
10 years, 5 months ago by hans
Modified:
9 years, 5 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, darin-cc_chromium.org, ben+cc_chromium.org, andreip1, Paweł Hajdan Jr.
Visibility:
Public.

Description

Chromium plumbing for Device Orientation. Add the plumbing needed for communicating with the Device Orientation code in WebKit. RenderView provides an implementation of WebKit::WebDeviceOrientationClient: DeviceOrientationDispatcher. This communicates with the browser-side class device_orientation::DispatcherHost. device_orientation::Provider, responsible for providing the orientation data, is just an empty shell for now. BUG=44654 TEST=browser_tests --gtest_filter=DeviceOrientationBrowserTest.BasicTest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=55724

Patch Set 1 #

Total comments: 13

Patch Set 2 : Patch #

Total comments: 24

Patch Set 3 : Patch #

Total comments: 44

Patch Set 4 : Patch #

Patch Set 5 : Patch #

Total comments: 4

Patch Set 6 : Patch #

Total comments: 9

Patch Set 7 : Patch #

Total comments: 14

Patch Set 8 : Patch #

Patch Set 9 : Fixes after try bot runs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+568 lines, -4 lines) Patch
A chrome/browser/device_orientation/device_orientation_browsertest.cc View 2 3 4 5 6 7 8 1 chunk +70 lines, -0 lines 0 comments Download
A chrome/browser/device_orientation/dispatcher_host.h View 1 2 3 4 5 6 7 1 chunk +44 lines, -0 lines 0 comments Download
A chrome/browser/device_orientation/dispatcher_host.cc View 1 2 3 4 5 6 7 1 chunk +80 lines, -0 lines 0 comments Download
A chrome/browser/device_orientation/orientation.h View 3 4 5 6 7 8 1 chunk +47 lines, -0 lines 0 comments Download
A chrome/browser/device_orientation/provider.h View 2 3 4 5 6 7 1 chunk +55 lines, -0 lines 0 comments Download
A chrome/browser/device_orientation/provider.cc View 2 3 4 5 6 7 1 chunk +24 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.h View 1 2 3 4 5 6 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.cc View 1 2 3 4 5 6 4 chunks +6 lines, -4 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/chrome_renderer.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/render_messages.h View 2 3 4 5 6 7 2 chunks +48 lines, -0 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 4 5 6 7 2 chunks +15 lines, -0 lines 0 comments Download
A chrome/renderer/device_orientation_dispatcher.h View 1 7 8 1 chunk +39 lines, -0 lines 0 comments Download
A chrome/renderer/device_orientation_dispatcher.cc View 1 7 8 1 chunk +72 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 3 4 5 6 3 chunks +5 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 4 5 6 3 chunks +11 lines, -0 lines 0 comments Download
A chrome/test/data/device_orientation/device_orientation_test.html View 2 1 chunk +36 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
hans
This is the first in a series of patches to implement Device Orientation in Chrome. ...
10 years, 5 months ago (2010-07-06 15:59:54 UTC) #1
bulach
good stuff Hans! once the WebKit side is in, would it be possible to write ...
10 years, 5 months ago (2010-07-06 17:01:59 UTC) #2
hans
On 2010/07/06 17:01:59, bulach wrote: > good stuff Hans! Thanks for the review :) > ...
10 years, 5 months ago (2010-07-06 17:16:11 UTC) #3
bulach
On Tue, Jul 6, 2010 at 6:16 PM, <hans@chromium.org> wrote: > On 2010/07/06 17:01:59, bulach ...
10 years, 5 months ago (2010-07-06 17:48:50 UTC) #4
andreip3000
http://codereview.chromium.org/2858049/diff/1/2 File chrome/browser/device_orientation/arbitrator.h (right): http://codereview.chromium.org/2858049/diff/1/2#newcode12 chrome/browser/device_orientation/arbitrator.h:12: namespace device_orientation { does chrome code use namespaces? I ...
10 years, 5 months ago (2010-07-06 18:15:02 UTC) #5
hans
On 2010/07/06 17:48:50, bulach wrote: > > The name 'arbitrator' may be poorly chosen. It ...
10 years, 5 months ago (2010-07-07 09:20:01 UTC) #6
hans
On 2010/07/06 18:15:02, andreip3000 wrote: > http://codereview.chromium.org/2858049/diff/1/2 > File chrome/browser/device_orientation/arbitrator.h (right): > > http://codereview.chromium.org/2858049/diff/1/2#newcode12 > ...
10 years, 5 months ago (2010-07-07 09:39:29 UTC) #7
joth
On 7 July 2010 10:20, <hans@chromium.org> wrote: > On 2010/07/06 17:48:50, bulach wrote: > >> ...
10 years, 5 months ago (2010-07-07 11:19:51 UTC) #8
hans
Sorry for the long wait; here is the next revision of this patch. Thanks for ...
10 years, 5 months ago (2010-07-22 16:25:58 UTC) #9
bulach
LGTM nice stuff! a few nits and suggestions below, and overall looks fine! sorry about ...
10 years, 5 months ago (2010-07-26 18:41:57 UTC) #10
hans
Thanks for the review, Marcus. Will land this when the WebKit part is in. In ...
10 years, 5 months ago (2010-07-27 10:56:59 UTC) #11
andreip3000
Looks good, a couple of questions. http://codereview.chromium.org/2858049/diff/25001/26004 File chrome/browser/device_orientation/orientation.h (right): http://codereview.chromium.org/2858049/diff/25001/26004#newcode21 chrome/browser/device_orientation/orientation.h:21: Orientation() {} Should ...
10 years, 5 months ago (2010-07-27 11:55:31 UTC) #12
jorlow
Some comments from a while ago that I forgot to publish. http://codereview.chromium.org/2858049/diff/1/4 File chrome/browser/device_orientation/dispatcher_host.h (right): ...
10 years, 5 months ago (2010-07-27 13:00:54 UTC) #13
jorlow
and more comments http://codereview.chromium.org/2858049/diff/25001/26002 File chrome/browser/device_orientation/dispatcher_host.cc (right): http://codereview.chromium.org/2858049/diff/25001/26002#newcode32 chrome/browser/device_orientation/dispatcher_host.cc:32: if (!command_line.HasSwitch(switches::kEnableDeviceOrientation)) I guess I don't ...
10 years, 5 months ago (2010-07-27 13:22:32 UTC) #14
hans
Thanks for the input! http://codereview.chromium.org/2858049/diff/25001/26002 File chrome/browser/device_orientation/dispatcher_host.cc (right): http://codereview.chromium.org/2858049/diff/25001/26002#newcode32 chrome/browser/device_orientation/dispatcher_host.cc:32: if (!command_line.HasSwitch(switches::kEnableDeviceOrientation)) On 2010/07/27 13:22:32, ...
10 years, 5 months ago (2010-07-27 16:23:36 UTC) #15
jorlow
http://codereview.chromium.org/2858049/diff/25001/26002 File chrome/browser/device_orientation/dispatcher_host.cc (right): http://codereview.chromium.org/2858049/diff/25001/26002#newcode58 chrome/browser/device_orientation/dispatcher_host.cc:58: for (Iterator i = render_view_ids_.begin(), e = render_view_ids_.end(); On ...
10 years, 5 months ago (2010-07-27 16:29:57 UTC) #16
hans
On 2010/07/27 16:29:57, Jeremy Orlow wrote: > Oh, I see. So instance_ is essentially just ...
10 years, 5 months ago (2010-07-27 17:14:43 UTC) #17
jorlow
I think that addresses my concerns. Marcus/Andrei?
10 years, 4 months ago (2010-07-28 11:14:22 UTC) #18
andreip3000
LGTM
10 years, 4 months ago (2010-07-28 11:23:04 UTC) #19
bulach
LGTM ultra minor nits: http://codereview.chromium.org/2858049/diff/38001/14004 File chrome/browser/device_orientation/dispatcher_host.cc (right): http://codereview.chromium.org/2858049/diff/38001/14004#newcode47 chrome/browser/device_orientation/dispatcher_host.cc:47: void DispatcherHost::OnOrientationUpdate(const Orientation& o) { ...
10 years, 4 months ago (2010-07-28 11:35:32 UTC) #20
hans
Thanks for the comments; ultra nits fixed. http://codereview.chromium.org/2858049/diff/38001/14004 File chrome/browser/device_orientation/dispatcher_host.cc (right): http://codereview.chromium.org/2858049/diff/38001/14004#newcode47 chrome/browser/device_orientation/dispatcher_host.cc:47: void DispatcherHost::OnOrientationUpdate(const ...
10 years, 4 months ago (2010-07-28 13:08:41 UTC) #21
jorlow
http://codereview.chromium.org/2858049/diff/41001/42002 File chrome/browser/device_orientation/dispatcher_host.cc (right): http://codereview.chromium.org/2858049/diff/41001/42002#newcode26 chrome/browser/device_orientation/dispatcher_host.cc:26: provider_->RemoveObserver(this); maybe stupid question: would it be easy to ...
10 years, 4 months ago (2010-08-03 13:54:19 UTC) #22
hans
Uploaded new version of the patch to match the WebKit plumbing (landed in http://trac.webkit.org/changeset/65063). The ...
10 years, 4 months ago (2010-08-10 13:12:53 UTC) #23
jorlow
Did one last skim through. LGTM http://codereview.chromium.org/2858049/diff/41001/42002 File chrome/browser/device_orientation/dispatcher_host.cc (right): http://codereview.chromium.org/2858049/diff/41001/42002#newcode67 chrome/browser/device_orientation/dispatcher_host.cc:67: DCHECK(render_view_ids_.find(render_view_id) == render_view_ids_.end()); ...
10 years, 4 months ago (2010-08-10 13:39:15 UTC) #24
joth
LG late but minor comments...! http://codereview.chromium.org/2858049/diff/1/10 File chrome/renderer/device_orientation_dispatcher.cc (right): http://codereview.chromium.org/2858049/diff/1/10#newcode50 chrome/renderer/device_orientation_dispatcher.cc:50: typedef std::set<WebKit::WebDeviceOrientationServiceBridge*>::iterator It; On ...
10 years, 4 months ago (2010-08-10 14:25:05 UTC) #25
hans
10 years, 4 months ago (2010-08-11 08:37:38 UTC) #26
Thanks for the review guys.

Uploading new patch addressing the comments below. Will land this as after
taking it for a spin on the try bots.

http://codereview.chromium.org/2858049/diff/50001/51003
File chrome/browser/device_orientation/dispatcher_host.h (right):

http://codereview.chromium.org/2858049/diff/50001/51003#newcode22
chrome/browser/device_orientation/dispatcher_host.h:22: explicit
DispatcherHost(int resource_message_filter_process_id);
On 2010/08/10 13:39:15, Jeremy Orlow wrote:
> I don't see why you need resource_message_filter_ in this name.

Done. Renamed to just process_id.

http://codereview.chromium.org/2858049/diff/50001/51003#newcode26
chrome/browser/device_orientation/dispatcher_host.h:26: virtual void
OnOrientationUpdate(const Orientation& o);
On 2010/08/10 13:39:15, Jeremy Orlow wrote:
> o is a bad variable name

Done.

http://codereview.chromium.org/2858049/diff/50001/51004
File chrome/browser/device_orientation/orientation.h (right):

http://codereview.chromium.org/2858049/diff/50001/51004#newcode10
chrome/browser/device_orientation/orientation.h:10: struct Orientation {
On 2010/08/10 14:25:05, joth wrote:
> maybe document what this is, what alpha beta gamma refer to. (Or link to the
> class/place that docs it)

Done. Moved the comment from render_messages.h as suggested below.

http://codereview.chromium.org/2858049/diff/50001/51006
File chrome/browser/device_orientation/provider.h (right):

http://codereview.chromium.org/2858049/diff/50001/51006#newcode44
chrome/browser/device_orientation/provider.h:44: virtual void
RemoveObserver(Observer* observer) {}
On 2010/08/10 14:25:05, joth wrote:
> how can these be usefully overridden, given GetInstance() calls the base class
> constructor.
> Maybe add a TODO explaining what needs to happen (or at least hint that it's
not
> finished?)
> 

Done. Adding a TODO.

http://codereview.chromium.org/2858049/diff/50001/51006#newcode51
chrome/browser/device_orientation/provider.h:51: }
On 2010/08/10 14:25:05, joth wrote:
> as you have a .cc file, probably as well to move function bodies there.

Done.

http://codereview.chromium.org/2858049/diff/50001/51012
File chrome/common/render_messages.h (right):

http://codereview.chromium.org/2858049/diff/50001/51012#newcode821
chrome/common/render_messages.h:821: // variable.
On 2010/08/10 14:25:05, joth wrote:
> found it :-)
> 
> Maybe move this doc to the Orientation struct, and just link to that here?
> ("these fields have the same meaning as device_orientation::Orientation")
> 

Done.

http://codereview.chromium.org/2858049/diff/50001/51015
File chrome/renderer/device_orientation_dispatcher.h (right):

http://codereview.chromium.org/2858049/diff/50001/51015#newcode8
chrome/renderer/device_orientation_dispatcher.h:8: #include
"third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClient.h"
On 2010/08/10 13:39:15, Jeremy Orlow wrote:
> It's OK this is >80 cols.

ok.

Powered by Google App Engine
This is Rietveld 408576698