Expose Console API to JSM

RESOLVED FIXED in Firefox 59

Status

()

Core
DOM
P3
normal
RESOLVED FIXED
a month ago
13 days ago

People

(Reporter: baku, Assigned: baku)

Tracking

58 Branch
mozilla59
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox59 fixed)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

a month ago
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.
(Assignee)

Comment 1

a month ago
Created attachment 8937056 [details] [diff] [review]
part 0 - Console in JSM
Attachment #8937056 - Flags: review?(bugs)
(Assignee)

Comment 2

a month ago
Created attachment 8937057 [details] [diff] [review]
part 1 - xpcshell test
Attachment #8937057 - Flags: review?(bugs)
Blocks: 1191571
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-
(Assignee)

Comment 4

29 days ago
Created attachment 8937663 [details] [diff] [review]
console0.patch
(Assignee)

Comment 5

29 days ago
Created attachment 8937665 [details] [diff] [review]
console0.patch

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+
Blocks: 1425574
Priority: -- → P3

Comment 7

28 days ago
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

Comment 8

28 days ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/df7c95d31077
https://hg.mozilla.org/mozilla-central/rev/f150d4c7c812
Status: NEW → RESOLVED
Last Resolved: 28 days ago
status-firefox59: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.