Closed Bug 1425463 Opened 6 years ago Closed 6 years ago

Expose Console API to JSM

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

58 Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: baku, Assigned: baku)

References

Details

Attachments

(2 files, 2 obsolete files)

This is the first step to get rid of Console.jsm. Currently Console cannot be used by JSM code.
This is a good first step, but it's not enough to replace Console.jsm. What is still missing is:

1. a way to specify parameters such as prefix, max log level and so on.
2. introduce the stderr/stdout logging.
Attached patch part 0 - Console in JSM (obsolete) — Splinter Review
Attachment #8937056 - Flags: review?(bugs)
Attachment #8937057 - Flags: review?(bugs)
Attachment #8937057 - Flags: review?(bugs) → review+
Comment on attachment 8937056 [details] [diff] [review]
part 0 - Console in JSM

>+Console::MonotonicTimer(JSContext* aCx, MethodName aMethodName,
>+                        const Sequence<JS::Value>& aData,
>+                        DOMHighResTimeStamp* aTimeStamp)
...
>+  if (NS_IsMainThread()) {
>+    *aTimeStamp = 0;
>+    return true;
>+  }
this doesn't look good to me. Makes timestamps rather useless on JSM, no?
Attachment #8937056 - Flags: review?(bugs) → review-
Attached patch console0.patch (obsolete) — Splinter Review
Attached patch console0.patchSplinter Review
This would basically work as the current Console.jsm. I don't have any better monotonic time to use.
Attachment #8937056 - Attachment is obsolete: true
Attachment #8937663 - Attachment is obsolete: true
Attachment #8937665 - Flags: review?(bugs)
Comment on attachment 8937665 [details] [diff] [review]
console0.patch

Timing attacks in .jsm? But ok, I guess we can keep this for consistency with Window case. But please make Performance::RoundTime a public static method and use that here. With that, r+. (we don't want to spread this magical 0.005 to several places)

(Note, worker part of the code doesn't have similar ReduceTimePrecisionAsMSecs usage. Should it? I think for consistency it should have. File a followup?)
Attachment #8937665 - Flags: review?(bugs) → review+
Priority: -- → P3
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/df7c95d31077
Expose Console API to JSM, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/f150d4c7c812
Expose Console API to JSM - xpcshell test, r=smaug
https://hg.mozilla.org/mozilla-central/rev/df7c95d31077
https://hg.mozilla.org/mozilla-central/rev/f150d4c7c812
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: