Closed
Bug 1196294
Opened 9 years ago
Closed 9 years ago
Remove the mCause from TimelineMarkers
Categories
(DevTools :: Performance Tools (Profiler/Timeline), defect)
DevTools
Performance Tools (Profiler/Timeline)
Tracking
(firefox43 fixed)
RESOLVED
FIXED
Firefox 43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: vporof, Assigned: vporof)
References
Details
Attachments
(1 file)
9.88 KB,
patch
|
tromey
:
review+
|
Details | Diff | Splinter Review |
This field is only used in a few subclasses, and having it on the base TimelineMarker class doesn't really help with any code duplication. In the interest of trimming down the base class as much as we can, let's separate concerns.
Assignee | ||
Comment 1•9 years ago
|
||
Comment 2•9 years ago
|
||
Comment on attachment 8649931 [details] [diff] [review] v1 Review of attachment 8649931 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. ::: docshell/base/timeline/ConsoleTimelineMarker.h @@ +33,5 @@ > } > + // Console markers must have matching causes as well. It is safe to perform > + // a static_cast here as the previous equality check ensures that this is > + // a console marker instance. > + return mCause == static_cast<const ConsoleTimelineMarker*>(&aOther)->mCause; This gives me mild pause, because the previous test is just based on the content of a string; so it opens the door to some error in theory. However I don't think anything better can be done without a relatively heavyweight solution.
Attachment #8649931 -
Flags: review?(ttromey) → review+
Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Tom Tromey :tromey from comment #2) > Comment on attachment 8649931 [details] [diff] [review] > v1 > > Review of attachment 8649931 [details] [diff] [review]: > ----------------------------------------------------------------- > > Looks good. > > ::: docshell/base/timeline/ConsoleTimelineMarker.h > @@ +33,5 @@ > > } > > + // Console markers must have matching causes as well. It is safe to perform > > + // a static_cast here as the previous equality check ensures that this is > > + // a console marker instance. > > + return mCause == static_cast<const ConsoleTimelineMarker*>(&aOther)->mCause; > > This gives me mild pause, because the previous test is just based on the > content of a string; so it opens the door to some error in theory. However > I don't think anything better can be done without a relatively heavyweight > solution. Indeed. I feel disgusted for having to write this. I was thinking of removing the "name" altogether in favor of an enum, or better yet just enforce subclassing whenever a new type of marker needs to be added. What do you think about that?
Flags: needinfo?(ttromey)
Comment 4•9 years ago
|
||
(In reply to Victor Porof [:vporof][:vp] from comment #3) > I was thinking of removing the "name" altogether in favor of an enum, or > better yet just enforce subclassing whenever a new type of marker needs to > be added. What do you think about that? Yeah, I think that would be an improvement. It still wouldn't be truly typesafe, but at least it would provide a spot to document the needed behavior.
Flags: needinfo?(ttromey)
Comment 6•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ce62db17d0ec
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•