Merge lp:~osomon/webbrowser-app/do-not-restore-all-tabs into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Bill Filler
Approved revision: 750
Merged at revision: 758
Proposed branch: lp:~osomon/webbrowser-app/do-not-restore-all-tabs
Merge into: lp:webbrowser-app
Diff against target: 34 lines (+9/-1)
1 file modified
src/app/webbrowser/Browser.qml (+9/-1)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/do-not-restore-all-tabs
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+237373@code.launchpad.net

Commit message

Restore only the n most recent tabs at startup, to limit the overhead of instantiating too many tab objects.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:750
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/1141/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/5585/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/3956
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-amd64-ci/340
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/340
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/340/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-i386-ci/340
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/5277/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/6837
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/6837/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/14254
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/3330
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/4283
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/4283/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/1141/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/Browser.qml'
2--- src/app/webbrowser/Browser.qml 2014-10-02 14:36:39 +0000
3+++ src/app/webbrowser/Browser.qml 2014-10-07 08:34:30 +0000
4@@ -41,6 +41,11 @@
5 // on the form factor and/or the available memory
6 readonly property int maxLiveWebviews: 2
7
8+ // Restore only the n most recent tabs at startup,
9+ // to limit the overhead of instantiating too many
10+ // tab objects (see http://pad.lv/1376433).
11+ readonly property int maxTabsToRestore: 10
12+
13 actions: [
14 Actions.GoTo {
15 onTriggered: currentWebview.url = value
16@@ -545,7 +550,7 @@
17 if (state) {
18 var tabs = state.tabs
19 if (tabs) {
20- for (var i = 0; i < tabs.length; ++i) {
21+ for (var i = 0; i < Math.min(tabs.length, browser.maxTabsToRestore); ++i) {
22 var tab = createTabFromState(tabs[i])
23 internal.addTab(tab, i == 0, false)
24 }
25@@ -590,6 +595,9 @@
26 if (browser.restoreSession) {
27 session.restore()
28 }
29+ // Sanity check
30+ console.assert(tabsModel.count <= browser.maxTabsToRestore,
31+ "WARNING: too many tabs were restored")
32 for (var i in browser.initialUrls) {
33 browser.openUrlInNewTab(browser.initialUrls[i], true, false)
34 }

Subscribers

People subscribed via source and target branches

to status/vote changes: