RESOLVED FIXED Bug 64595
[Qt] Make DeviceMotion and DeviceOrientation work with WebKit2
https://bugs.webkit.org/show_bug.cgi?id=64595
Summary [Qt] Make DeviceMotion and DeviceOrientation work with WebKit2
Kenneth Rohde Christiansen
Reported 2011-07-15 06:08:08 PDT
SSIA
Attachments
Patch (34.15 KB, patch)
2011-07-15 06:39 PDT, Kenneth Rohde Christiansen
kenneth: review-
Patch (34.13 KB, patch)
2011-07-15 06:49 PDT, Kenneth Rohde Christiansen
webkit.review.bot: commit-queue-
Patch 3 (34.02 KB, patch)
2011-07-15 07:02 PDT, Kenneth Rohde Christiansen
webkit-ews: commit-queue-
Patch 4 (35.57 KB, patch)
2011-07-15 07:50 PDT, Kenneth Rohde Christiansen
webkit-ews: commit-queue-
Patch (35.60 KB, patch)
2011-07-15 09:15 PDT, Kenneth Rohde Christiansen
webkit-ews: commit-queue-
Patch (35.46 KB, patch)
2011-07-15 09:50 PDT, Kenneth Rohde Christiansen
webkit-ews: commit-queue-
Patch (35.38 KB, patch)
2011-07-15 10:01 PDT, Kenneth Rohde Christiansen
ossy: review-
webkit-ews: commit-queue-
patch (40.81 KB, patch)
2011-07-27 18:22 PDT, Luiz Agostini
no flags
Patch (46.12 KB, patch)
2012-05-01 05:43 PDT, Lars Knudsen
no flags
Patch (46.17 KB, patch)
2012-05-01 05:47 PDT, Lars Knudsen
no flags
Patch (45.99 KB, patch)
2012-05-01 07:06 PDT, Lars Knudsen
no flags
Patch (46.17 KB, patch)
2012-05-01 07:44 PDT, Lars Knudsen
no flags
Patch (46.63 KB, patch)
2012-05-01 15:56 PDT, Lars Knudsen
no flags
Patch (46.02 KB, patch)
2012-05-02 01:42 PDT, Lars Knudsen
no flags
Patch (45.96 KB, patch)
2012-05-02 04:00 PDT, Lars Knudsen
no flags
Patch (1.25 KB, patch)
2012-05-02 07:06 PDT, Csaba Osztrogonác
no flags
Kenneth Rohde Christiansen
Comment 1 2011-07-15 06:39:47 PDT
WebKit Review Bot
Comment 2 2011-07-15 06:42:40 PDT
Attachment 100967 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebKit2/WebProcess/WebPage/WebPage.cpp:97: Alphabetical sorting problem. [build/include_order] [4] Source/WebKit2/WebProcess/WebPage/WebPage.cpp:98: Alphabetical sorting problem. [build/include_order] [4] Source/WebKit2/WebProcess/WebPage/WebPage.cpp:160: Code inside a namespace should not be indented. [whitespace/indent] [4] Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h:27: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 4 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Kenneth Rohde Christiansen
Comment 3 2011-07-15 06:46:21 PDT
Comment on attachment 100967 [details] Patch something went wrong with my tools :-(
Kenneth Rohde Christiansen
Comment 4 2011-07-15 06:49:09 PDT
This needs to be enabled when compiling
Kenneth Rohde Christiansen
Comment 5 2011-07-15 06:49:43 PDT
WebKit Review Bot
Comment 6 2011-07-15 06:53:04 PDT
Attachment 100969 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebKit2/WebProcess/WebPage/WebPage.cpp:33: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Review Bot
Comment 7 2011-07-15 06:56:11 PDT
Kenneth Rohde Christiansen
Comment 8 2011-07-15 07:02:07 PDT
Early Warning System Bot
Comment 9 2011-07-15 07:16:22 PDT
Kenneth Rohde Christiansen
Comment 10 2011-07-15 07:50:09 PDT
Created attachment 100975 [details] Patch 4 Another try...
Early Warning System Bot
Comment 11 2011-07-15 07:59:08 PDT
Kenneth Rohde Christiansen
Comment 12 2011-07-15 09:15:47 PDT
Created attachment 100990 [details] Patch Trying to include PassOwnPtr
Early Warning System Bot
Comment 13 2011-07-15 09:24:11 PDT
Kenneth Rohde Christiansen
Comment 14 2011-07-15 09:50:01 PDT
Early Warning System Bot
Comment 15 2011-07-15 09:58:17 PDT
Kenneth Rohde Christiansen
Comment 16 2011-07-15 10:01:12 PDT
Early Warning System Bot
Comment 17 2011-07-15 10:11:11 PDT
Kenneth Rohde Christiansen
Comment 18 2011-07-15 10:26:36 PDT
I'm guess this is because of a non-clean build... it must be using the old file. Ossy can you verify this somehow?
Benjamin Poulain
Comment 19 2011-07-18 05:17:31 PDT
Comment on attachment 100999 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=100999&action=review Quick review. I don't understand why you make this a Qt specific subclass of DeviceMotionClient and DeviceOrientationClient while all they do is forward call to a provider. It looks like instead DeviceMotionClient should not be abstract, and DeviceMotionProvider should be a typedef per platform. Same for orientation. I am not familiar with this code, is there a reason for all those indirections? > Source/WebCore/platform/qt/DeviceMotionProviderQt.cpp:2 > + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 2011 :) > Source/WebCore/platform/qt/DeviceMotionProviderQt.h:2 > + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 2011 > Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp:24 > +#if ENABLE(DEVICE_ORIENTATION) You should not put this check, the file is simply not compiled if DEVICE_ORIENTATION is not set. > Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h:23 > +#if ENABLE(DEVICE_ORIENTATION) The file is not added if ENABLE_DEVICE_ORIENTATION is not defined. I think is it more explicit to have the check on the include side than on the header side. > Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h:30 > +#include <wtf/PassOwnPtr.h> I am unsure why you need PassOwnPtr in this header, looks like it should be only needed in the implementation for intializing the OwnPtr(?). > Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h:36 > + DeviceOrientationClientQt() { } Maybe just remove the constructor and let the compiler declare the empty constructor for you? :) > Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h:37 > virtual ~DeviceOrientationClientQt(); Look like this one is not needed anymore after this patch. > Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h:47 > + virtual void deviceOrientationControllerDestroyed(); > + > virtual void startUpdating(); > virtual void stopUpdating(); > + > virtual DeviceOrientation* lastOrientation() const; > - virtual void deviceOrientationControllerDestroyed(); > > -public Q_SLOTS: > - void changeDeviceOrientation(DeviceOrientation*); > + virtual void setController(DeviceOrientationController*); I would put them in the same order as DeviceOrientationClient but it does not matter much... > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:127 > +#include "DeviceMotionClientQt.h" > +#include "DeviceOrientationClientQt.h" If you follow my comment about checking the feature in the hader, you need #if ENABLE(DEVICE_ORIENTATION) here.
Csaba Osztrogonác
Comment 20 2011-07-25 04:52:26 PDT
(In reply to comment #18) > I'm guess this is because of a non-clean build... it must be using the old file. > > Ossy can you verify this somehow? No, it isn't a non-clean build problem. Now there are two header files: - WebCore/platform/qt/DeviceOrientationProviderQt.h - WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h And I guess that the cpp file includes the wrong one.
Csaba Osztrogonác
Comment 21 2011-07-25 04:52:52 PDT
Comment on attachment 100999 [details] Patch r- now, because it doesn't build
Luiz Agostini
Comment 22 2011-07-27 18:22:38 PDT
Luiz Agostini
Comment 23 2011-07-28 05:18:55 PDT
(In reply to comment #19) > (From update of attachment 100999 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=100999&action=review > > Quick review. > > I don't understand why you make this a Qt specific subclass of DeviceMotionClient and DeviceOrientationClient while all they do is forward call to a provider. > It looks like instead DeviceMotionClient should not be abstract, and DeviceMotionProvider should be a typedef per platform. Same for orientation. > > I am not familiar with this code, is there a reason for all those indirections? I think that what we could do to avoid all those indirections is to have no provider.
Alexis Menard (darktears)
Comment 24 2011-08-01 11:21:37 PDT
Comment on attachment 102211 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=102211&action=review > Source/WebCore/platform/qt/DeviceOrientationProviderQt.cpp:2 > + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 2011 > Source/WebCore/platform/qt/DeviceOrientationProviderQt.h:2 > + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) Still 2011
Kenneth Rohde Christiansen
Comment 25 2011-08-08 01:46:11 PDT
> > I am not familiar with this code, is there a reason for all those indirections? > > I think that what we could do to avoid all those indirections is to have no provider. There were possible a reason for this at some point, but not anymore. I wouldn't mind that being another patch though.
Kenneth Rohde Christiansen
Comment 26 2011-08-08 03:01:30 PDT
(In reply to comment #25) > > > I am not familiar with this code, is there a reason for all those indirections? > > > > I think that what we could do to avoid all those indirections is to have no provider. > > There were possible a reason for this at some point, but not anymore. I wouldn't mind that being another patch though. One of the reasons that there is a provider is that one is used by both DeviceMotion and DeviceOrientation.
Eric Seidel (no email)
Comment 27 2012-03-01 16:29:38 PST
This looks abandoned. Should this be r-'d? Closed?
Kenneth Rohde Christiansen
Comment 28 2012-03-02 02:28:27 PST
No, this will be done at some point. I can probably review the patch on monday.
Allan Sandfeld Jensen
Comment 29 2012-04-23 01:46:28 PDT
The patch is pretty old, maybe it needs to be rebased first?
Lars Knudsen
Comment 30 2012-04-25 11:16:18 PDT
(In reply to comment #29) > The patch is pretty old, maybe it needs to be rebased first? I'll take a shot at it now
Lars Knudsen
Comment 31 2012-05-01 05:43:12 PDT
WebKit Review Bot
Comment 32 2012-05-01 05:45:40 PDT
Attachment 139614 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'ChangeLog', u'Source/WebCore/ChangeLog', u..." exit_code: 1 Source/WebCore/ChangeLog:8: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] Total errors found: 1 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Lars Knudsen
Comment 33 2012-05-01 05:47:45 PDT
Kenneth Rohde Christiansen
Comment 34 2012-05-01 06:00:47 PDT
Comment on attachment 139616 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=139616&action=review > Source/WebCore/platform/qt/DeviceMotionClientQt.cpp:2 > + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) If you change any of these files, please update copyright date > Source/WebCore/platform/qt/DeviceMotionProviderQt.cpp:76 > + false, 0 /* The interval is treated internally by Qt mobility */); Nothing is called Qt Mobility in Qt5. QtSensors I believe
Early Warning System Bot
Comment 35 2012-05-01 06:22:48 PDT
Early Warning System Bot
Comment 36 2012-05-01 06:26:25 PDT
Lars Knudsen
Comment 37 2012-05-01 07:06:36 PDT
Early Warning System Bot
Comment 38 2012-05-01 07:15:29 PDT
Lars Knudsen
Comment 39 2012-05-01 07:44:35 PDT
Early Warning System Bot
Comment 40 2012-05-01 08:04:42 PDT
Lars Knudsen
Comment 41 2012-05-01 15:56:33 PDT
Simon Hausmann
Comment 42 2012-05-02 01:15:16 PDT
Comment on attachment 139696 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=139696&action=review > Source/WebCore/Target.pri:3439 > + haveQt(5) { > + QT += sensors > + } else { > + CONFIG *= mobility > + MOBILITY *= sensors > + } I don't think this block is needed given that it's also in WebCore.pri. > Source/WebKit2/Target.pri:794 > +contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) { > + haveQt(5): QT += sensors > +} Why is this needed? WebCore.pri has it and this Target.pri has WEBKIT += webcore, which should pull in WebCore.pri through Tools/qmake/mkspecs/modules/webcore.prf
Lars Knudsen
Comment 43 2012-05-02 01:42:53 PDT
Lars Knudsen
Comment 44 2012-05-02 01:43:46 PDT
(In reply to comment #42) > (From update of attachment 139696 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=139696&action=review > > > Source/WebCore/Target.pri:3439 > > + haveQt(5) { > > + QT += sensors > > + } else { > > + CONFIG *= mobility > > + MOBILITY *= sensors > > + } > > I don't think this block is needed given that it's also in WebCore.pri. > > > Source/WebKit2/Target.pri:794 > > +contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) { > > + haveQt(5): QT += sensors > > +} > > Why is this needed? WebCore.pri has it and this Target.pri has WEBKIT += webcore, which should pull in WebCore.pri through Tools/qmake/mkspecs/modules/webcore.prf True, done - thanks! :)
Kenneth Rohde Christiansen
Comment 45 2012-05-02 02:00:18 PDT
[10:38] <simon_> laknudse, kenneth: the pattern in if (!m_provider && controller) looks a bit dangerous to me :) [10:38] <simon_> if !m_provider and !controller, then setController crashes [10:39] * simon_ would remove the controller part of the if()
Lars Knudsen
Comment 46 2012-05-02 04:00:45 PDT
WebKit Review Bot
Comment 47 2012-05-02 04:50:50 PDT
Comment on attachment 139785 [details] Patch Clearing flags on attachment: 139785 Committed r115812: <http://trac.webkit.org/changeset/115812>
WebKit Review Bot
Comment 48 2012-05-02 04:50:59 PDT
All reviewed patches have been landed. Closing bug.
Csaba Osztrogonác
Comment 49 2012-05-02 06:51:41 PDT
Reopen, because it broke the builds with Qt Mobility: (Qt Windows, Qt MIPS, Qt SH4 bots) In file included from ../../../Source/WebCore/platform/qt/DeviceMotionClientQt.h:27:0, from ../../../Source/WebKit/qt/Api/qwebpage.cpp:48: ../../../Source/WebCore/platform/qt/DeviceMotionProviderQt.h:25:32: fatal error: QAccelerometerFilter: No such file or directory
Csaba Osztrogonác
Comment 50 2012-05-02 07:06:44 PDT
Csaba Osztrogonác
Comment 51 2012-05-02 07:18:05 PDT
Comment on attachment 139807 [details] Patch Clearing flags on attachment: 139807 Committed r115828: <http://trac.webkit.org/changeset/115828>
Csaba Osztrogonác
Comment 52 2012-05-02 07:18:25 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.