WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
211544
Add some missing null checks for DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=211544
Summary
Add some missing null checks for DocumentLoader
Darin Adler
Reported
2020-05-06 19:00:55 PDT
Add some missing null checks for DocumentLoader
Attachments
Patch
(5.58 KB, patch)
2020-05-06 19:02 PDT
,
Darin Adler
andersca
: review+
Details
Formatted Diff
Diff
Patch
(7.40 KB, patch)
2020-05-07 10:07 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
Patch
(7.39 KB, patch)
2020-05-07 10:10 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2020-05-06 19:02:14 PDT
Created
attachment 398696
[details]
Patch
Darin Adler
Comment 2
2020-05-06 19:03:04 PDT
rdar://62843516
Anders Carlsson
Comment 3
2020-05-07 07:33:15 PDT
Comment on
attachment 398696
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=398696&action=review
> Source/WebCore/loader/FrameLoader.cpp:2173 > + auto dl = m_documentLoader;
I would have renamed this to documentLoader.
> Source/WebCore/loader/FrameLoader.cpp:2226 > + m_documentLoader->writer().setMIMEType(dl->responseMIMEType());
Should this use dl instead of m_documentLoader? (Maybe there's a chance that m_documentLoader is replaced mid-function?)
> Source/WebCore/loader/HistoryController.cpp:417 > + const URL& historyURL = m_frame.loader().documentLoader() ? m_frame.loader().documentLoader()->urlForHistory() : URL { };
I'd change this to no longer hold a const reference, since urlForHistory() returns a const&, it will always be copied anyway AFAICT.
Darin Adler
Comment 4
2020-05-07 08:44:24 PDT
Comment on
attachment 398696
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=398696&action=review
>> Source/WebCore/loader/FrameLoader.cpp:2173 >> + auto dl = m_documentLoader; > > I would have renamed this to documentLoader.
OK, I’ll do that.
>> Source/WebCore/loader/FrameLoader.cpp:2226 >> + m_documentLoader->writer().setMIMEType(dl->responseMIMEType()); > > Should this use dl instead of m_documentLoader? (Maybe there's a chance that m_documentLoader is replaced mid-function?)
I thought the point was to set the MIME type on the new writer with the possibly-old loader’s MIME type. Not really sure.
>> Source/WebCore/loader/HistoryController.cpp:417 >> + const URL& historyURL = m_frame.loader().documentLoader() ? m_frame.loader().documentLoader()->urlForHistory() : URL { }; > > I'd change this to no longer hold a const reference, since urlForHistory() returns a const&, it will always be copied anyway AFAICT.
Will do.
Darin Adler
Comment 5
2020-05-07 10:07:24 PDT
Comment hidden (obsolete)
Created
attachment 398751
[details]
Patch
Darin Adler
Comment 6
2020-05-07 10:07:46 PDT
Comment hidden (obsolete)
Comment on
attachment 398751
[details]
Patch I plan to land this later with the commit queue.
Darin Adler
Comment 7
2020-05-07 10:10:29 PDT
Created
attachment 398752
[details]
Patch
EWS
Comment 8
2020-05-07 11:55:55 PDT
Committed
r261323
: <
https://trac.webkit.org/changeset/261323
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 398752
[details]
.
Radar WebKit Bug Importer
Comment 9
2020-05-07 11:56:15 PDT
<
rdar://problem/62986860
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug