Closed Bug 751813 Opened 12 years ago Closed 12 years ago

Stop spewing to the console about Places Maintenance

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: philor, Assigned: mak)

References

Details

Attachments

(1 file, 1 obsolete file)

According to bug 739354 comment 6, we want to promote the antipattern of polling the console and assuming that nothing but your test will be writing to it, so we need to stop putting anything in there about Places Maintenance, so that tests which do that can fail when other things get written in there instead.
Yeah, I'm fine with that, as I expressed in https://bugzilla.mozilla.org/show_bug.cgi?id=739354#c5, I actually forgot that bug was still open.
I suppose it'll take less time if I directly do that.
Assignee: nobody → mak77
Attached patch patch v1.0 (obsolete) — Splinter Review
Attachment #626813 - Flags: review?(paolo.mozmail)
Comment on attachment 626813 [details] [diff] [review]
patch v1.0

>+++ b/toolkit/components/places/PlacesCategoriesStarter.js
>@@ -79,17 +79,20 @@ PlacesCategoriesStarter.prototype = {
>-          PlacesDBUtils.maintenanceOnIdle();
>+          PlacesDBUtils.maintenanceOnIdle(function () {
>+            // Empty callback used to to eat the log and thus avoid sending it
>+            // to the console.
>+          });

It looks like this is the only place where maintenanceOnIdle is called, apart from test code:

http://mxr.mozilla.org/mozilla-central/search?string=maintenanceOnIdle

What do you think about removing the "else" part inside maintenanceOnIdle that writes to the console when the callback is null, and just using a callback that writes to the console (or do_log_info or something) in tests that really require it? I doubt that any add-on depends on the behavior of writing to the console when the callback is null.
Attachment #626813 - Flags: review?(paolo.mozmail)
(In reply to Paolo Amadini [:paolo] from comment #4)
> What do you think about removing the "else" part inside maintenanceOnIdle

I meant _executeTasks:

http://mxr.mozilla.org/comm-central/source/mozilla/toolkit/components/places/PlacesDBUtils.jsm#69

I cannot find any caller of checkAndFixDatabase, also.
(In reply to Paolo Amadini [:paolo] from comment #4)
> What do you think about removing the "else" part inside maintenanceOnIdle
> that writes to the console when the callback is null, and just using a
> callback that writes to the console

Hm yeah that may also be a possibility, will check add-ons on mxr.
Attached patch patch v1.1Splinter Review
ok, the change makes sense, no interesting results from add-ons mxr.
Attachment #626813 - Attachment is obsolete: true
Attachment #629788 - Flags: review?(paolo.mozmail)
Comment on attachment 629788 [details] [diff] [review]
patch v1.1

Looks good!
Attachment #629788 - Flags: review?(paolo.mozmail) → review+
looks like I never pushed this, will do.
https://hg.mozilla.org/integration/mozilla-inbound/rev/7530e96d9af6
Flags: in-testsuite-
Target Milestone: --- → mozilla18
https://hg.mozilla.org/mozilla-central/rev/7530e96d9af6
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: