Closed Bug 1026713 Opened 6 years ago Closed 4 years ago

Report DOMEventTargetHelper subclasses more usefully in the CC logs

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: khuey, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

Attached patch PatchSplinter Review
No description provided.
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+
Attachment #8441627 - Flags: review?(continuation)
Blocks: 723783
I think bug 1271848 will give us a nice fix for this.
Assignee: khuey → continuation
Depends on: 1271848
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)
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+
Ah, that's a good point. This will at least improve things.
https://hg.mozilla.org/mozilla-central/rev/290bd460fc16
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.