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

Issue 10735052: Adds temporary function lastOrientationNew (Closed)

Created:
8 years, 5 months ago by aousterh
Modified:
7 years, 5 months ago
Reviewers:
jamesr, aousterh1
CC:
Steve Block, chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Adds temporary function lastOrientationNew This adds a temporary function lastOrientationNew to device_orientation_dispatcher. This function is identical to lastOrientation. This will allow us to modify WebKit to use the new function temporarily while lastOrientation is modified to return a WebDeviceOrientationData instead of a WebDeviceOrientation. This will allow for consistent naming across WebKit for DeviceOrientation and DeviceMotion. This change is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=88663, which made part of the change in WebKit. BUG=none TEST=none, no change in functionality

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -0 lines) Patch
M content/renderer/device_orientation_dispatcher.h View 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/device_orientation_dispatcher.cc View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
aousterh
8 years, 5 months ago (2012-07-11 11:03:18 UTC) #1
jamesr
I just got back from vacation and it looks like this review is still open ...
8 years, 5 months ago (2012-07-25 22:43:12 UTC) #2
aousterh1
Thanks for getting back to me! I do still need a review and I believe ...
8 years, 4 months ago (2012-07-31 11:03:56 UTC) #3
jamesr
I don't really get it - what's the reason for adding this function? It appears ...
8 years, 4 months ago (2012-08-01 00:40:52 UTC) #4
jamesr
I don't really get it - what's the reason for adding this function? It appears ...
8 years, 4 months ago (2012-08-01 00:40:52 UTC) #5
aousterh
On 2012/08/01 00:40:52, jamesr wrote: > I don't really get it - what's the reason ...
8 years, 4 months ago (2012-08-01 12:50:59 UTC) #6
jamesr
8 years, 4 months ago (2012-08-01 22:22:32 UTC) #7
On 2012/08/01 12:50:59, aousterh wrote:
> On 2012/08/01 00:40:52, jamesr wrote:
> > I don't really get it - what's the reason for adding this function?  It
> appears
> > to have the same type and the same name as an existing function, except for
> the
> > addition of "new" which doesn't seem to indicate much.
> 
> The goal is to rename WebDeviceOrientation to WebDeviceOrientationData in
WebKit
> (this will be more consistent with other code in WebKit). However,
> WebDeviceOrientation is returned by the function lastOrientation in the public
> Chromium API in WebKit. If I tried to make this change as one patch in
Chromium
> and one in WebKit, Chromium would break temporarily until the second patch
> landed. Therefore, this needs to be done in several steps:
> (1) add lastOrientationNew to Chromium (this function will return a
> WebDeviceOrientation) [this Chromium patch]
> (2) switch WebKit to call lastOrientationNew, temporarily remove
> lastOrientation, and add WebDeviceOrientationData [WebKit patch]
> (3) change lastOrientation in Chromium so that it returns a
> WebDeviceOrientationData [Chromium patch]
> (4) switch WebKit back to calling lastOrientation, remove lastOrientationNew
> [WebKit patch]
> (5) remove lastOrientationNew and all references to WebDeviceOrientation from
> Chromium [Chromium patch]
> (6) remove WebDeviceOrientation from WebKit [WebKit patch]
> 
> Does that make sense? Do you know of a simpler way of doing it?

This seems pretty excessive.  How about this:

1.) Add a version of lastOrientation with the signature you want in chromium
guarded by a #define (something like
LAST_ORIENTATION_RETURNS_WEBDEVICEORIENTATIONDATA) or something like that
alongside the current version [Chromium patch]
2.) Land a WebKit patch that switches to the new return type and sets the
#define in a public WebKit API header [WebKit patch]
3.) After (2) has rolled into Chromium, remove the #ifdef guard and old function
[Chromium patch]
4.) Delete #define from public WebKit API header [WebKit patch]

Far fewer patches and less ugly names.

Powered by Google App Engine
This is Rietveld 408576698