Bug 490714 (placesFolders)

Asynchronous API for opening container query nodes

NEW
Unassigned

Status

()

Toolkit
Places
P3
normal
9 years ago
6 months ago

People

(Reporter: adw, Unassigned)

Tracking

(Depends on: 1 bug, Blocks: 5 bugs, {main-thread-io, perf})

Trunk
main-thread-io, perf
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Snappy:P3])

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
containerNode.openContainerAsync(function () alert("Container opened!"));

Like that.

By asynchronous I mean that the SQL query underneath the container is asynchronous, using the async storage API.  This won't make the entire batch of container children load any faster, but it does mean Firefox won't beachball while the SQL is blocking the UI and everything else.  There may be opportunities for the callback to be notified of chunks of children as they're loaded, but this is complicated where we're sorting children in C++ only after obtaining all SQL results.

The most obvious use case in the front end is the Places tree view, especially in the library.  (Searches in the library should benefit, too.)  I'm imagining an animated throbber on top of the whole tree as the children of its root container are loaded, and throbbers in individual container rows as their children are loaded.  UI feedback like this should pretty simple via CSS.

Fortunately there's an existing nsINavHistoryResultViewer interface that the tree view uses to observe container openings and closings, and so I think the tree view could be made to use the async API without quite as much trouble as one might first think.  Perhaps this interface could be used everywhere in lieu of a callback function.

Will attach a WIP patch that begins the API and the tree view's use of it after I clean it up a little.
(Reporter)

Updated

9 years ago
Depends on: 490867
(Reporter)

Comment 1

9 years ago
Created attachment 375299 [details] [diff] [review]
WIP v1

Very much a WIP.  Includes the patch to bug 490867, which blocks this bug and the test requires to pass.  Also includes a stab at updating the tree view.  (Of course this portion will be broken out into a different bug later on.  Currently the tree view busy waits on the new container node attribute containerOpening.)

Need to look at all the places where sync and async openings could intersect and screw each other up, but working on the tree view simultaneously has been a help so far, and this patch prevents some basic interactions between the two.
Keywords: perf
Priority: -- → P1
Whiteboard: [TSnappiness]
Blocks: 491746
(Reporter)

Updated

9 years ago
Depends on: 499985
Target Milestone: mozilla1.9.1 → ---

Comment 2

9 years ago
Please consider adding the ability to cancel asynchronous queries.  It would also be very useful in an extension which I have written, and probably useful also in the library and in other occasions.
(Reporter)

Updated

8 years ago
Depends on: 536893

Updated

8 years ago
Blocks: 556068

Updated

8 years ago
Blocks: 559266

Updated

7 years ago
Keywords: main-thread-io

Updated

7 years ago
Blocks: 365992

Updated

7 years ago
No longer blocks: 556068

Updated

6 years ago
Blocks: 699820
Alias: placesFolders

Updated

6 years ago
Depends on: 702639

Updated

6 years ago
Whiteboard: [TSnappiness] → [Snappy]

Updated

6 years ago
Whiteboard: [Snappy] → [Snappy:P3]
(Reporter)

Updated

4 years ago
Assignee: adw → nobody
Status: ASSIGNED → NEW

Updated

4 years ago
Duplicate of this bug: 622787

Updated

4 years ago
Blocks: 975979

Updated

4 years ago
No longer blocks: 699820

Updated

4 years ago
Blocks: 1047817

Updated

2 years ago
Priority: P1 → --

Updated

2 years ago
Priority: -- → P2

Updated

6 months ago
Priority: P2 → P3
Blocks: 1383758
You need to log in before you can comment on or make changes to this bug.