Closed Bug 1439473 Opened 7 years ago Closed 7 years ago

Improve logging of HTMLMediaElement JS API calls

Categories

(Core :: Audio/Video: Playback, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: cpearce, Assigned: cpearce)

References

Details

Attachments

(1 file)

To make it easier to debug why sites aren't playing video when block autoplay is enabled, it would be useful to add more mozlogs to HTMLMediaElement to log when the JS exposed functions are called.
Priority: -- → P3
Comment on attachment 8952279 [details]
Bug 1439473 - Improve logging of HTMLMediaElement JS API calls.

https://reviewboard.mozilla.org/r/221526/#review228086

::: dom/html/HTMLMediaElement.cpp:1957
(Diff revision 1)
> +static nsCString
> +DocumentOrigin(nsIDocument* aDoc)
> +{
> +  nsCOMPtr<nsIPrincipal> principal;
> +  nsCString origin;
> +  if (!aDoc || !(principal = aDoc->NodePrincipal()) ||

Nit: Personally not a fan of assignment inside an if stmt.
Attachment #8952279 - Flags: review?(dglastonbury) → review+
Comment on attachment 8952279 [details]
Bug 1439473 - Improve logging of HTMLMediaElement JS API calls.

https://reviewboard.mozilla.org/r/221526/#review228108

::: dom/html/HTMLMediaElement.cpp:1957
(Diff revision 1)
> +static nsCString
> +DocumentOrigin(nsIDocument* aDoc)
> +{
> +  nsCOMPtr<nsIPrincipal> principal;
> +  nsCString origin;
> +  if (!aDoc || !(principal = aDoc->NodePrincipal()) ||

I expanded this function out to make it more explicit.
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2d7a7976ee3a
Improve logging of HTMLMediaElement JS API calls. r=kamidphish
backed out for bustage on HTMLMediaElement.cpp:4032

backout: https://hg.mozilla.org/integration/autoland/rev/1e76d991fe6ccf655bb75ddf75d8dd7e365a27b1

push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=2d7a7976ee3a5579845076a23c512729438a0581 

failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=163603511&repo=autoland&lineNumber=21300

[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -  In file included from /builds/worker/workspace/build/src/obj-firefox/dom/html/Unified_cpp_dom_html2.cpp:2:
[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -  /builds/worker/workspace/build/src/dom/html/HTMLMediaElement.cpp:4032:5: error: You must immediately return after calling this function
[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -      aRv.Throw(NS_ERROR_DOM_MEDIA_NOT_ALLOWED_ERR);
[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -      ^
[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -  /builds/worker/workspace/build/src/dom/html/HTMLMediaElement.cpp:4043:5: error: You must immediately return after calling this function
[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -      aRv.Throw(NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR);
[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -      ^
[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -  /builds/worker/workspace/build/src/dom/html/HTMLMediaElement.cpp:4096:9: error: You must immediately return after calling this function
[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -          aRv.Throw(rv);
[task 2018-02-22T02:26:40.626Z] 02:26:40     INFO -          ^
[task 2018-02-22T02:26:40.627Z] 02:26:40     INFO -  3 errors generated.
[task 2018-02-22T02:26:40.627Z] 02:26:40     INFO -  /builds/worker/workspace/build/src/config/rules.mk:1047: recipe for target 'Unified_cpp_dom_html2.o' failed
[task 2018-02-22T02:26:40.627Z] 02:26:40     INFO -  make[4]: *** [Unified_cpp_dom_html2.o] Error 1
[task 2018-02-22T02:26:40.627Z] 02:26:40     INFO -  make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/dom/html'
[task 2018-02-22T02:26:40.627Z] 02:26:40     INFO -  /builds/worker/workspace/build/src/config/recurse.mk:73: recipe for target 'dom/html/target' failed
[task 2018-02-22T02:26:40.627Z] 02:26:40     INFO -  make[3]: *** [dom/html/target] Error 2
[task 2018-02-22T02:26:40.627Z] 02:26:40     INFO -  make[3]: *** Waiting for unfinished jobs....
Flags: needinfo?(cpearce)
Flags: needinfo?(cpearce)
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d2a43ef3a3a6
Improve logging of HTMLMediaElement JS API calls. r=kamidphish
https://hg.mozilla.org/mozilla-central/rev/d2a43ef3a3a6
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: