Merge lp:~abreu-alexandre/ubuntu-html5-theme/rtm-fix-webkit-launch into lp:ubuntu-html5-theme

Proposed by Alexandre Abreu
Status: Superseded
Proposed branch: lp:~abreu-alexandre/ubuntu-html5-theme/rtm-fix-webkit-launch
Merge into: lp:ubuntu-html5-theme
Diff against target: 262 lines (+143/-36) (has conflicts)
10 files modified
debian/ubuntu-html5-container.install (+0/-1)
src/CMakeLists.txt (+1/-1)
src/plugin/CMakeLists.txt (+0/-1)
src/plugin/Ubuntu/CMakeLists.txt (+0/-1)
src/plugin/Ubuntu/WebApps/CMakeLists.txt (+0/-25)
src/plugin/Ubuntu/WebApps/qmldir (+0/-2)
src/ubuntu-html5-app-launcher/CMakeLists.txt (+0/-1)
src/ubuntu-html5-app-launcher/UbuntuJavascriptBindings.qml (+59/-0)
src/ubuntu-html5-app-launcher/main.cpp (+7/-0)
src/ubuntu-html5-app-launcher/main.qml (+76/-4)
Conflict: can't delete src/plugin because it is not empty.  Not deleting.
Conflict because src/plugin is not versioned, but has versioned children.  Versioned directory.
Conflict: can't delete src/plugin/Ubuntu because it is not empty.  Not deleting.
Conflict because src/plugin/Ubuntu is not versioned, but has versioned children.  Versioned directory.
Conflict: can't delete src/plugin/Ubuntu/WebApps because it is not empty.  Not deleting.
Conflict because src/plugin/Ubuntu/WebApps is not versioned, but has versioned children.  Versioned directory.
Contents conflict in src/plugin/Ubuntu/WebApps/WebAppContainer.qml
Text conflict in src/ubuntu-html5-app-launcher/main.cpp
Text conflict in src/ubuntu-html5-app-launcher/main.qml
To merge this branch: bzr merge lp:~abreu-alexandre/ubuntu-html5-theme/rtm-fix-webkit-launch
Reviewer Review Type Date Requested Status
Ubuntu HTML5 Theme Developers Pending
Review via email: mp+249552@code.launchpad.net

Commit message

QtWebkit w/ Qt 5.3 seems to have a race when bundled w/ certain qml elements, something like e.g.:

MainView {

  Page { WebView {} }
}

makes the app (launched as a click) on the devices (w/ RTM or Vivid) spin at startup w/o ever actually showing something,

It does that usually on the first launch, subsequent launches usually work fine. Things do work fine when the Webview is replaced by a Window or even an Item. After some strace and investigation it seems that some bits are racy in QtWebkit in relation w/ its ~/.local/share content.

In the behavior described above, the app goes back into failing mode when one deletes the apps' ~/.local/share. Some cookie DB creation errors (that are not seen consistently though) seem to backup the hypothesis above,

Description of the change

QtWebkit w/ Qt 5.3 seems to have a race when bundled w/ certain qml elements, something like e.g.:

MainView {

  Page { WebView {} }
}

makes the app (launched as a click) on the devices (w/ RTM or Vivid) spin at startup w/o ever actually showing something,

It does that usually on the first launch, subsequent launches usually work fine. Things do work fine when the Webview is replaced by a Window or even an Item. After some strace and investigation it seems that some bits are racy in QtWebkit in relation w/ its ~/.local/share content.

In the behavior described above, the app goes back into failing mode when one deletes the apps' ~/.local/share. Some cookie DB creation errors (that are not seen consistently though) seem to backup the hypothesis above,

To post a comment you must log in.

Unmerged revisions

185. By Alexandre Abreu

fix new window

184. By Alexandre Abreu

fixes

183. By Alexandre Abreu

revert mistakenly commited bits

182. By Alexandre Abreu

fix content hub picker API environment (proper Item based parent)

181. By Alexandre Abreu

fix deps

180. By Alexandre Abreu

forgot files

179. By Alexandre Abreu

fix webkit inspector

178. By Alexandre Abreu

Fix oxide support

177. By Alexandre Abreu

Fix oxide support

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
=== modified file 'debian/ubuntu-html5-container.install'
--- debian/ubuntu-html5-container.install 2014-01-27 18:42:31 +0000
+++ debian/ubuntu-html5-container.install 2015-02-12 18:30:51 +0000
@@ -1,3 +1,2 @@
1usr/bin/ubuntu-html5-app-launcher1usr/bin/ubuntu-html5-app-launcher
2usr/lib/*/qt5/qml/Ubuntu/WebApps/*
3usr/share/ubuntu-html5-app-launcher/2usr/share/ubuntu-html5-app-launcher/
43
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2014-02-06 22:51:33 +0000
+++ src/CMakeLists.txt 2015-02-12 18:30:51 +0000
@@ -1,2 +1,2 @@
1add_subdirectory(ubuntu-html5-app-launcher)1add_subdirectory(ubuntu-html5-app-launcher)
2add_subdirectory(plugin)2
33
=== removed file 'src/plugin/CMakeLists.txt'
--- src/plugin/CMakeLists.txt 2013-11-27 16:33:23 +0000
+++ src/plugin/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1add_subdirectory(Ubuntu)
20
=== removed file 'src/plugin/Ubuntu/CMakeLists.txt'
--- src/plugin/Ubuntu/CMakeLists.txt 2013-11-27 16:33:23 +0000
+++ src/plugin/Ubuntu/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1add_subdirectory(WebApps)
20
=== removed file 'src/plugin/Ubuntu/WebApps/CMakeLists.txt'
--- src/plugin/Ubuntu/WebApps/CMakeLists.txt 2013-12-10 16:16:11 +0000
+++ src/plugin/Ubuntu/WebApps/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
1project(ubuntu-html5-container)
2
3# setup install location
4execute_process(
5 COMMAND qmake -query QT_INSTALL_QML
6 OUTPUT_VARIABLE QT_INSTALL_QML
7 OUTPUT_STRIP_TRAILING_WHITESPACE
8)
9set(HTML5_CONTAINER_IMPORTS_DIR "${QT_INSTALL_QML}/Ubuntu/WebApps")
10
11# setup install for local component files
12file(GLOB QML_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.qml qmldir)
13install(FILES ${QML_FILES} DESTINATION ${HTML5_CONTAINER_IMPORTS_DIR})
14
15# make sure that we have all the files in the right place if we test locally
16# & have a specific build dir
17if(NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
18 foreach(_qmlfile ${QML_FILES})
19 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_qmlfile}
20 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_qmlfile}
21 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${_qmlfile} ${CMAKE_CURRENT_BINARY_DIR}/${_qmlfile})
22 endforeach(_qmlfile)
23 add_custom_target(copy_to_build_dir DEPENDS ${QML_FILES})
24endif()
25
260
=== renamed file 'src/plugin/Ubuntu/WebApps/WebAppContainer.qml' => 'src/plugin/Ubuntu/WebApps/WebAppContainer.qml.THIS'
=== removed file 'src/plugin/Ubuntu/WebApps/qmldir'
--- src/plugin/Ubuntu/WebApps/qmldir 2013-11-27 16:33:23 +0000
+++ src/plugin/Ubuntu/WebApps/qmldir 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
1module Ubuntu.WebApps
2WebAppContainer 0.1 WebAppContainer.qml
30
=== modified file 'src/ubuntu-html5-app-launcher/CMakeLists.txt'
--- src/ubuntu-html5-app-launcher/CMakeLists.txt 2014-12-16 21:02:55 +0000
+++ src/ubuntu-html5-app-launcher/CMakeLists.txt 2015-02-12 18:30:51 +0000
@@ -27,7 +27,6 @@
27file(GLOB QML_FILES *.qml)27file(GLOB QML_FILES *.qml)
28install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/ubuntu-html5-app-launcher/qml)28install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/ubuntu-html5-app-launcher/qml)
2929
30
31# install bin files30# install bin files
32install(TARGETS ${HTML5_LAUNCHER}31install(TARGETS ${HTML5_LAUNCHER}
33 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})32 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
3433
=== added file 'src/ubuntu-html5-app-launcher/UbuntuJavascriptBindings.qml'
--- src/ubuntu-html5-app-launcher/UbuntuJavascriptBindings.qml 1970-01-01 00:00:00 +0000
+++ src/ubuntu-html5-app-launcher/UbuntuJavascriptBindings.qml 2015-02-12 18:30:51 +0000
@@ -0,0 +1,59 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This file is part of ubuntu-html5-container.
5 *
6 * ubuntu-html5-container is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * webbrowser-app is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.0
20import Ubuntu.UnityWebApps 0.1
21
22
23Item {
24 id: root
25
26 property var bindingMainWebview: null
27
28 /*!
29 \internal
30 */
31 function getUnityWebappsProxies() {
32 return UnityWebAppsUtils.makeProxiesForQtWebViewBindee(bindingMainWebview);
33 }
34
35 /*!
36 \internal
37 */
38 Loader {
39 id: webappBindingsLoader
40 visible: false
41 anchors.fill: parent
42 sourceComponent: bindingMainWebview ? webappBindingsComponent : undefined
43 }
44
45 /*!
46 \internal
47 */
48 Component {
49 id: webappBindingsComponent
50
51 UnityWebApps {
52 id: webapps
53 bindee: root
54 injectExtraUbuntuApis: true
55 requiresInit: false
56 }
57 }
58}
59
060
=== modified file 'src/ubuntu-html5-app-launcher/main.cpp'
--- src/ubuntu-html5-app-launcher/main.cpp 2014-12-16 21:02:55 +0000
+++ src/ubuntu-html5-app-launcher/main.cpp 2015-02-12 18:30:51 +0000
@@ -208,7 +208,9 @@
208 qt_gl_set_global_share_context(glcontext);208 qt_gl_set_global_share_context(glcontext);
209#endif209#endif
210210
211
211 QQuickView view;212 QQuickView view;
213<<<<<<< TREE
212 QQmlEngine* engine = view.engine();214 QQmlEngine* engine = view.engine();
213215
214 if (remoteInspectorEnabled) {216 if (remoteInspectorEnabled) {
@@ -223,6 +225,11 @@
223 qputenv("QTWEBKIT_INSPECTOR_SERVER", remoteInspectorPort.toUtf8());225 qputenv("QTWEBKIT_INSPECTOR_SERVER", remoteInspectorPort.toUtf8());
224 }226 }
225227
228=======
229 view.rootContext()->setContextProperty(
230 "HtmlIndexDirectory", wwwFolder.canonicalFilePath());
231
232>>>>>>> MERGE-SOURCE
226 view.setSource(QUrl::fromLocalFile(Webapp::Config::getContainerMainQmlPath()233 view.setSource(QUrl::fromLocalFile(Webapp::Config::getContainerMainQmlPath()
227 + "/main.qml"));234 + "/main.qml"));
228 if (view.status() != QQuickView::Ready)235 if (view.status() != QQuickView::Ready)
229236
=== modified file 'src/ubuntu-html5-app-launcher/main.qml'
--- src/ubuntu-html5-app-launcher/main.qml 2014-12-16 21:02:55 +0000
+++ src/ubuntu-html5-app-launcher/main.qml 2015-02-12 18:30:51 +0000
@@ -17,13 +17,85 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.0
21import Ubuntu.WebApps 0.121import Ubuntu.Components.Extras.Browser 0.1
2222import QtWebKit.experimental 1.0
23WebAppContainer {23
24MainView {
25 id: root
26
24 width: units.gu(100)27 width: units.gu(100)
25 height: units.gu(75)28 height: units.gu(75)
29<<<<<<< TREE
2630
27 remoteInspectorEnabled: inspector31 remoteInspectorEnabled: inspector
28 htmlIndexDirectory: wwwFolder32 htmlIndexDirectory: wwwFolder
33=======
34
35 anchorToKeyboard: true
36 automaticOrientation: true
37
38 Timer {
39 id: checkTimer
40 running: true
41 repeat: false
42 onTriggered: {
43 webviewComponentLoader.sourceComponent =
44 webviewComponent
45 checkTimer.stop()
46 }
47 interval: 100
48 }
49
50 Page {
51 anchors.fill: parent
52 Loader {
53 id: webviewComponentLoader
54 anchors.fill: parent
55 onLoaded: {
56 bindings.bindingMainWebview =
57 webviewComponentLoader.item;
58 }
59 }
60 }
61
62 Component {
63 id: webviewComponent
64
65 UbuntuWebView {
66 maximumFlickVelocity: height * 5
67
68 url: HtmlIndexDirectory !== "" ? ('file://' + HtmlIndexDirectory + '/index.html') : ""
69
70 experimental.preferences.localStorageEnabled: true
71 experimental.preferences.offlineWebApplicationCacheEnabled: true
72 experimental.preferences.universalAccessFromFileURLsAllowed: true
73 experimental.preferences.webGLEnabled: true
74
75 experimental.databaseQuotaDialog: Item {
76 Timer {
77 interval: 1
78 running: true
79 onTriggered: {
80 model.accept(model.expectedUsage)
81 }
82 }
83 }
84
85 // port in QTWEBKIT_INSPECTOR_SERVER enviroment variable
86 experimental.preferences.developerExtrasEnabled: true
87
88 onNewTabRequested: {
89 if (url.toString().indexOf("file://") !== 0) {
90 Qt.openUrlExternally(url.toString())
91 return
92 }
93 }
94 }
95 }
96
97 UbuntuJavascriptBindings {
98 id: bindings
99 }
100>>>>>>> MERGE-SOURCE
29}101}

Subscribers

People subscribed via source and target branches