Open
Bug 1323794
Opened 7 years ago
Updated 2 years ago
rename nsPresContext::Document() to nsPresContext::GetDocument() since it may return null
Categories
(Core :: Layout, defect, P3)
Tracking
()
NEW
People
(Reporter: smaug, Unassigned)
Details
Attachments
(3 files)
6.47 KB,
patch
|
smaug
:
review-
|
Details | Diff | Splinter Review |
1.13 KB,
patch
|
smaug
:
review-
|
Details | Diff | Splinter Review |
45.62 KB,
patch
|
smaug
:
review-
|
Details | Diff | Splinter Review |
In Gecko methods which may possibly return null have traditionally had Get* prefix. For some reason nsPresContext::Document() doesn't have.
Updated•7 years ago
|
Priority: -- → P3
Reporter | ||
Comment 2•6 years ago
|
||
Feel free to. I can review the patch.
Attachment #8941846 -
Flags: review?(bugs)
Comment 4•6 years ago
|
||
(In reply to dvabhinav31@gmail.com from comment #3) > Created attachment 8941846 [details] [diff] [review] > bug-1323794-v1.patch That only contains the changes to one file? I'm pretty sure there are many more callers. Given this can only return null during disconnect, which I think most of the code doesn't care about, I'd prefer a function that asserted when called instead, but not sure...
Comment 5•6 years ago
|
||
(Renaming to GetDocument() is fine I guess. I'm just saying that given it's ok for most of the code to not null-check it, feels weird). Anyway, not a huge deal.
Reporter | ||
Comment 6•6 years ago
|
||
IIRC, long ago we had some crashes because the method did in fact return null but callers didn't expect that (since the name hints that it doesn't return null).
Reporter | ||
Comment 7•6 years ago
|
||
Comment on attachment 8941846 [details] [diff] [review] bug-1323794-v1.patch Yeah, the method is called everywhere https://searchfox.org/mozilla-central/search?q=symbol:_ZNK13nsPresContext8DocumentEv&redirect=false Please compile the patch before uploading.
Attachment #8941846 -
Flags: review?(bugs) → review-
Attachment #8942423 -
Flags: review?(bugs)
Reporter | ||
Comment 9•6 years ago
|
||
Comment on attachment 8942423 [details] [diff] [review] bug-1323794-v2.patch You need to change all the callers in the tree too, and ensure the patch compiles.
Attachment #8942423 -
Flags: review?(bugs) → review-
Comment 10•6 years ago
|
||
I have searched for files and was able to find a few. Is there a way I can find all the files at once?
Comment 11•6 years ago
|
||
Attachment #8947437 -
Flags: review?(bugs)
Reporter | ||
Comment 12•6 years ago
|
||
Comment on attachment 8947437 [details] [diff] [review] bug-1323794.patch >@@ -2225,7 +2225,7 @@ nsStyleImageRequest::Resolve(nsPresConte > } > > if (mModeFlags & Mode::Track) { >- mImageTracker = aPresContext->Document()->ImageTracker(); >+ mImageTracker = aPresContext-GetDocument()->ImageTracker(); This for example doesn't compile. Please provide patches which do compile.
Attachment #8947437 -
Flags: review?(bugs) → review-
Comment 13•6 years ago
|
||
sorry. I will take care.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•