Closed
Bug 700250
Opened 13 years ago
Closed 12 years ago
Deprecate synchronous methods to add a visit (addVisit, addPageWithDetails, addURI)
Categories
(Toolkit :: Places, defect)
Toolkit
Places
Tracking
()
RESOLVED
FIXED
People
(Reporter: Yoric, Unassigned)
References
Details
(Keywords: dev-doc-needed, main-thread-io, perf, Whiteboard: [snappy:P1])
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
mak
:
review+
|
Details | Diff | Splinter Review |
Quoting mak in bug 699850:
« A first dependent bug may be to deprecate addVisit and addPageWithDetails, that are used in a LOT of tests, to avoid rewriting all the tests we can likely write an addVisit wrapper that uses updatePlaces async API and spin the events loop till we get the callback. We should push people toward updatePlaces API. »
Let's do it.
Comment 1•13 years ago
|
||
http://mxr.mozilla.org/mozilla-central/search?string=addPageWithDetails
mostly tests for this api. other consumers are IE, Opera and Safari migrators.
Reporter | ||
Updated•13 years ago
|
Assignee: dteller → nobody
Comment 2•13 years ago
|
||
moved the tests stuff to bug 724475, so this tracks all the needed work.
Updated•13 years ago
|
Updated•13 years ago
|
Summary: Deprecate nsIBrowserHistory::addVisit, addPageWithDetails → Deprecate synchronous methods to add a visit (addVisit, addPageWithDetails)
Updated•13 years ago
|
Blocks: placesSessionID
Updated•13 years ago
|
Whiteboard: [snappy]
Updated•13 years ago
|
Whiteboard: [snappy] → [snappy:P1]
Reporter | ||
Comment 3•12 years ago
|
||
Seems that addPageWithDetails is covered. I will take a (new) look at addVisit.
Assignee: nobody → dteller
Reporter | ||
Comment 4•12 years ago
|
||
A quick search indicates that we use addVisit in a gazillion tests and exactly once in code, in Sync http://dxr.lanedo.com/mozilla-central/services/sync/tps/extensions/tps/modules/history.jsm.html#l106 . This occurrence looks easy to fix.
Reporter | ||
Comment 5•12 years ago
|
||
Attachment #639293 -
Flags: review?(mak77)
Reporter | ||
Comment 6•12 years ago
|
||
Attachment #639294 -
Flags: review?(mak77)
Reporter | ||
Comment 7•12 years ago
|
||
Comment on attachment 639293 [details] [diff] [review]
Marking addVisit as deprecated
Let's forget about this patch for the time being. I think I have improperly identified the implementation of addVisit.
Attachment #639293 -
Flags: review?(mak77)
Reporter | ||
Comment 8•12 years ago
|
||
Attachment #639293 -
Attachment is obsolete: true
Attachment #639297 -
Flags: review?(mak77)
Comment 9•12 years ago
|
||
Comment on attachment 639294 [details] [diff] [review]
Removing client of addVisit in the code
You should put this patch in a new bug in the proper component (Mozilla Services::Firefox Sync: Build, maybe?). AIUI this code is used for Sync's test harness (TPS), and :gps should probably look it over.
Reporter | ||
Comment 10•12 years ago
|
||
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #9)
> Comment on attachment 639294 [details] [diff] [review]
> Removing client of addVisit in the code
>
> You should put this patch in a new bug in the proper component (Mozilla
> Services::Firefox Sync: Build, maybe?). AIUI this code is used for Sync's
> test harness (TPS), and :gps should probably look it over.
Done, thanks for the suggestion.
Reporter | ||
Updated•12 years ago
|
Attachment #639294 -
Attachment is obsolete: true
Attachment #639294 -
Flags: review?(mak77)
Comment 11•12 years ago
|
||
David, Paolo started doing a bunch of rewrites to remove AddVisit from tests, that partially overloads what you were planning to do, so I think would be cool if you could sync up and coordinate to bring on the effort. I honestly don't mind to much about test changes being reviewed by an old Places peer, since it's simple xpcshell tests mostly, so I'd also be fine if you'd want to review each other and I can do later checks.
Comment 12•12 years ago
|
||
Comment on attachment 639297 [details] [diff] [review]
Marking addVisit as deprecated
Review of attachment 639297 [details] [diff] [review]:
-----------------------------------------------------------------
You need SR on the deprecation, I'm fine doing it asap, so there will be some time before we completely remove the method.
::: toolkit/components/places/nsNavHistory.cpp
@@ +1289,5 @@
> +
> + NS_WARNING("nsINavHistory::addVisit is deprecated. Please use rather mozIAsyncHistory::updatePlace");
> +#if defined(DEBUG)
> + DumpJSStack();
> +#endif // defined(DEBUG)
Unfortunately I really don't think any js consumer (like add-on devs) runs code in debug builds, they should ideally but let's stick to the reality. So personally I'd leave this additional output out and just do the deprecation marking in the idl.
Notifying Jorge to send an e-mail to all add-on authors using this method would be largely more productive.
Comment 13•12 years ago
|
||
Comment on attachment 639297 [details] [diff] [review]
Marking addVisit as deprecated
Review of attachment 639297 [details] [diff] [review]:
-----------------------------------------------------------------
ops, was meant to be a +, with removal of the debug warning
::: toolkit/components/places/nsNavHistory.cpp
@@ +1289,5 @@
> +
> + NS_WARNING("nsINavHistory::addVisit is deprecated. Please use rather mozIAsyncHistory::updatePlace");
> +#if defined(DEBUG)
> + DumpJSStack();
> +#endif // defined(DEBUG)
Unfortunately I really don't think any js consumer (like add-on devs) runs code in debug builds, they should ideally but let's stick to the reality. So personally I'd leave this additional output out and just do the deprecation marking in the idl.
Notifying Jorge to send an e-mail to all add-on authors using this method would be largely more productive.
Attachment #639297 -
Flags: review?(mak77) → review+
Comment 14•12 years ago
|
||
(In reply to Marco Bonardo [:mak] (Away 28 Jul - 12 Aug) from comment #11)
> David, Paolo started doing a bunch of rewrites to remove AddVisit from
> tests, that partially overloads what you were planning to do, so I think
> would be cool if you could sync up and coordinate to bring on the effort. I
> honestly don't mind to much about test changes being reviewed by an old
> Places peer, since it's simple xpcshell tests mostly, so I'd also be fine if
> you'd want to review each other and I can do later checks.
I've almost finished to convert all the addVisit calls by now, only a few tests
remain, which can be handled in a couple of hours.
David, I think you'll be a good reviewer for the changes I made, as you're very
familiar with the Promise module and should know the Task module. I'll redirect
feedback requests to you, let me know if you think you can handle them.
Reporter | ||
Comment 15•12 years ago
|
||
After too much time, I gave up on reimplementing AddVisit in C++ and I just wrote a short layer in JS. Mak, would a quick sed to use this function be sufficient for the needs of this bug?
Attachment #650889 -
Flags: feedback?(mak77)
Comment 16•12 years ago
|
||
All call to addVisits should have been already removed from Places tests as part
of the work on bug 775489, so, fortunately, we shouldn't need to spin the event
loop for that anymore.
Work in those bugs also fixed the rare test cases where the behavior of the
asynchronous API is actually different, because the order of notifications is
different or because errors are notified in a different moment.
Comment 17•12 years ago
|
||
I mean, calls to AddVisit have been replaced with the addVisits helper.
Reporter | ||
Comment 18•12 years ago
|
||
I suspected so, but I had this half-coded hack I wanted to finish, in case it could prove useful :)
Comment 19•12 years ago
|
||
Comment on attachment 650889 [details] [diff] [review]
Dirty implementation of addVisit in JS
clearing request until we figure if it's needed. provided Paolo's patches cover most/all uses we can probably skip this.
Attachment #650889 -
Flags: feedback?(mak77)
Reporter | ||
Comment 20•12 years ago
|
||
Sounds like a plan.
Comment 21•12 years ago
|
||
did this project hang? anything I can do to help it proceed? We definitely need to get rid of addvisit ASAP or we can't proceed with async history.
Comment 22•12 years ago
|
||
(In reply to Marco Bonardo [:mak] from comment #21)
> did this project hang? anything I can do to help it proceed? We definitely
> need to get rid of addvisit ASAP or we can't proceed with async history.
It did hang actually, but is restarting right now. Expect updated patches for
removing calls to addVisit from Places tests (dependencies of bug 775489) later
this week! The work that remains to be done there is mainly a clean up, I expect
that the currently attached patches will be similar to the updated version.
Reporter | ||
Comment 23•12 years ago
|
||
Since I'm not working on this, releasing the bug.
Assignee: dteller → nobody
Comment 24•12 years ago
|
||
Thanks for your effort David, looks like in the end we are not that far from the target!
Updated•12 years ago
|
Attachment #650889 -
Attachment is obsolete: true
Updated•12 years ago
|
Depends on: 752218
Summary: Deprecate synchronous methods to add a visit (addVisit, addPageWithDetails) → Deprecate synchronous methods to add a visit (addVisit, addPageWithDetails, addURI)
Comment 25•12 years ago
|
||
fixed by dependencies.
Notice this fixed all of the in-tree callers, but the APIs have not been removed yet, they will be removed apart in another dependency of bug 834457.
No longer blocks: placesSessionID, asyncHistory
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•