Closed Bug 1243536 Opened 8 years ago Closed 8 years ago

Remove hacky docshell static_cast from EventListenerManager::HandleEventInternal()

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

Bug 1202657 added some hacky docshell static_cast'ing to EventListenerManager::HandleEventInternal():

> 1162           nsDocShell* docShell;
[...]
> 1168             nsCOMPtr<nsIDocShell> docShellComPtr = GetDocShellForTarget();
> 1169             if (docShellComPtr) {
> 1170               docShell = static_cast<nsDocShell*>(docShellComPtr.get());
> 1171               if (timelines && timelines->HasConsumer(docShell)) {
[...]
> 1177                 timelines->AddMarkerForDocShell(docShell, Move(
> 1178                   MakeUnique<EventTimelineMarker>(
> 1179                     typeStr, phase, MarkerTracingType::START)));
> 1180               }

I'm not sure why (or if?) we needed this static_cast hack back when the bug landed; but in any case, we don't seem to need it now.

The HasConsumer() and AddMarkerForDocShell() functions each have versions that take a nsIDocShell.
Attached patch fix v1Splinter Review
Attachment #8712875 - Flags: review?(bugs)
Note that we do still need to declare |docShell| at a higher level from where it's assigned, because it has one conditional usage that's outside the scope of the code that assigns it -- at 1190 in this MXR link:

http://mxr.mozilla.org/mozilla-central/source/dom/events/EventListenerManager.cpp?rev=94904a47150f&mark=1162-1162,1168-1170,1190-1190#1162
(In reply to Daniel Holbert [:dholbert] from comment #0)
> Bug 1202657 added some hacky docshell static_cast'ing to
> EventListenerManager::HandleEventInternal()

(Er, my blame-assignment may be mis-attributed -- I didn't look too carefully at first, but it looks like this goes back further than that bug's changes. I was looking at http://hg.mozilla.org/mozilla-central/diff/f95c614295a0/dom/events/EventListenerManager.cpp#l1.12 which does still have a static_cast in the replaced code.)
There are other fixes coming to the relevant code, so let's deal that in other bug.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: