Report DOMEventTargetHelper subclasses more usefully in the CC logs

RESOLVED FIXED in Firefox 49

Status

()

Core
DOM
RESOLVED FIXED
4 years ago
2 years ago

People

(Reporter: khuey, Assigned: mccr8)

Tracking

(Blocks: 1 bug)

unspecified
mozilla49
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox49 fixed)

Details

Attachments

(2 attachments, 1 obsolete attachment)

Created attachment 8441627 [details] [diff] [review]
Patch
Attachment #8441627 - Flags: review?(continuation)
Attachment #8441627 - Flags: review?(bugs)
Comment on attachment 8441627 [details] [diff] [review]
Patch

>@@ -102,6 +101,12 @@ public:
>   virtual void DisconnectFromOwner() MOZ_OVERRIDE;
> 
> protected:
>+  virtual ~EventSource();
>+
>+  virtual char* PrettyName() MOZ_OVERRIDE {
{ goes to the next line.
Same also elsewhere.


>@@ -30,8 +30,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(DOMEventTargetHelper)
>     if (tmp->mOwnerWindow && tmp->mOwnerWindow->GetExtantDoc()) {
>       tmp->mOwnerWindow->GetExtantDoc()->GetDocumentURI(uri);
>     }
>-    PR_snprintf(name, sizeof(name), "DOMEventTargetHelper %s",
>-                NS_ConvertUTF16toUTF8(uri).get());
>+    char* className = tmp->PrettyName();
>+    if (!className) {
>+      className = "DOMEventTargetHelper";
>+    }
Just make DOMEventTargetHelper::PrettyName() to return "DOMEventTargetHelper"
and you don't need this if.

>+++ b/dom/workers/WorkerPrivate.h
>@@ -795,6 +795,10 @@ class WorkerPrivate : public WorkerPrivateParent<WorkerPrivate>
>   bool mOnLine;
> 
> protected:
>+  virtual char* PrettyName() MOZ_OVERRIDE {
>+    return "Worker";
>+  }
Do we have a bug for renaming WorkerPrivate to Worker?
If not, could you file.
Attachment #8441627 - Flags: review?(bugs) → review+
(Assignee)

Updated

4 years ago
Attachment #8441627 - Flags: review?(continuation)
(Assignee)

Updated

4 years ago
Blocks: 723783
(Assignee)

Comment 2

2 years ago
I think bug 1271848 will give us a nice fix for this.
Assignee: khuey → continuation
Depends on: 1271848
(Assignee)

Comment 3

2 years ago
Created attachment 8751031 [details] [diff] [review]
Give DOMEventTargetHelper classes proper names in the CC log.
(Assignee)

Comment 4

2 years ago
Created attachment 8751822 [details] [diff] [review]
Give DOMEventTargetHelper classes proper names in the CC log.

This makes use of ClassName() from bug 1271848. I think this QI doesn't AddRef. I just looked at what the CC does.

I tested it locally and it does give DETHs the proper name.

try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=64d214392179
Attachment #8751822 - Flags: review?(bugs)
(Assignee)

Updated

2 years ago
Attachment #8751031 - Attachment is obsolete: true
Comment on attachment 8751822 [details] [diff] [review]
Give DOMEventTargetHelper classes proper names in the CC log.

So this gives the name in case the class inhering DETH adds something to CC. I guess that is good enough in most cases.
Attachment #8751822 - Flags: review?(bugs) → review+
(Assignee)

Comment 6

2 years ago
Ah, that's a good point. This will at least improve things.

Comment 8

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/290bd460fc16
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox49: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.