WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
173564
Cleanup FrameLoadRequest
https://bugs.webkit.org/show_bug.cgi?id=173564
Summary
Cleanup FrameLoadRequest
Daniel Bates
Reported
2017-06-19 14:28:00 PDT
FrameLoadRequest has too many constructors. FrameLoadRequest should hold a Ref<SecurityOrigin> instead of a RefPtr<SecurityOrigin> as it is never passed a non-null SecurityOrigin object. We should also pass a Frame& instead of Frame* to the FrameLoadRequest constructor that take a frame as it expects the specified frame is non-null to be able to retrieve the SecurityOrigin of the document in the specified frame.
Attachments
Patch
(62.72 KB, patch)
2017-06-19 15:27 PDT
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Patch
(64.75 KB, patch)
2017-06-19 16:08 PDT
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews101 for mac-elcapitan
(2.48 MB, application/zip)
2017-06-19 16:47 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews115 for mac-elcapitan
(2.52 MB, application/zip)
2017-06-19 17:00 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews106 for mac-elcapitan-wk2
(2.54 MB, application/zip)
2017-06-19 17:12 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews121 for ios-simulator-wk2
(71.76 MB, application/zip)
2017-06-19 18:08 PDT
,
Build Bot
no flags
Details
Patch
(45.31 KB, patch)
2017-06-20 15:36 PDT
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Patch
(45.44 KB, patch)
2017-06-20 15:52 PDT
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Patch
(46.54 KB, patch)
2017-06-21 11:33 PDT
,
Daniel Bates
bfulgham
: review+
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
Daniel Bates
Comment 1
2017-06-19 15:27:56 PDT
Created
attachment 313336
[details]
Patch
Build Bot
Comment 2
2017-06-19 15:29:37 PDT
Attachment 313336
[details]
did not pass style-queue: ERROR: Source/WebCore/loader/FrameLoadRequest.cpp:41: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 23 files If any of these errors are false positives, please file a bug against check-webkit-style.
Daniel Bates
Comment 3
2017-06-19 16:08:35 PDT
Created
attachment 313339
[details]
Patch
Build Bot
Comment 4
2017-06-19 16:12:50 PDT
Comment hidden (obsolete)
Attachment 313339
[details]
did not pass style-queue: ERROR: Source/WebCore/loader/FrameLoadRequest.cpp:41: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 25 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 5
2017-06-19 16:47:44 PDT
Comment hidden (obsolete)
Comment on
attachment 313339
[details]
Patch
Attachment 313339
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/3962830
Number of test failures exceeded the failure limit.
Build Bot
Comment 6
2017-06-19 16:47:46 PDT
Comment hidden (obsolete)
Created
attachment 313342
[details]
Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 7
2017-06-19 17:00:56 PDT
Comment hidden (obsolete)
Comment on
attachment 313339
[details]
Patch
Attachment 313339
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/3962842
Number of test failures exceeded the failure limit.
Build Bot
Comment 8
2017-06-19 17:00:58 PDT
Comment hidden (obsolete)
Created
attachment 313343
[details]
Archive of layout-test-results from ews115 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 9
2017-06-19 17:12:44 PDT
Comment hidden (obsolete)
Comment on
attachment 313339
[details]
Patch
Attachment 313339
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/3962846
Number of test failures exceeded the failure limit.
Build Bot
Comment 10
2017-06-19 17:12:46 PDT
Comment hidden (obsolete)
Created
attachment 313345
[details]
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 11
2017-06-19 18:08:04 PDT
Comment hidden (obsolete)
Comment on
attachment 313339
[details]
Patch
Attachment 313339
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
http://webkit-queues.webkit.org/results/3963025
Number of test failures exceeded the failure limit.
Build Bot
Comment 12
2017-06-19 18:08:08 PDT
Comment hidden (obsolete)
Created
attachment 313347
[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Brent Fulgham
Comment 13
2017-06-20 14:59:09 PDT
Comment on
attachment 313339
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=313339&action=review
> Source/WebCore/ChangeLog:4 > +
https://bugs.webkit.org/show_bug.cgi?id=173564
Please import to Radar so we can track this if any regressions are found.
> Source/WebCore/ChangeLog:15 > + the target frame name as we do not have one. Use C++11 brace initialization syntax. Rename
Do we have a new style guideline to use the brace syntax? Does it impart some benefit over the traditional parenthetical version?
Darin Adler
Comment 14
2017-06-20 15:15:29 PDT
Comment on
attachment 313339
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=313339&action=review
>> Source/WebCore/ChangeLog:15 >> + the target frame name as we do not have one. Use C++11 brace initialization syntax. Rename > > Do we have a new style guideline to use the brace syntax? Does it impart some benefit over the traditional parenthetical version?
We do not have a formal style guideline, but it’s definitely a trend in style, started by Anders Carlsson. The benefit I am aware of: The braces syntax is stricter. Some type conversions that are done silently in the parentheses syntax are treated as errors if the braces syntax is used.
Brent Fulgham
Comment 15
2017-06-20 15:17:29 PDT
Dan: This patch seems to be introducing regressions. Can you please review the errors to see why were are getting behavior changes?
Brent Fulgham
Comment 16
2017-06-20 15:20:57 PDT
Comment on
attachment 313339
[details]
Patch While I like the direction of this patch, the test failures make me concerned that you have introduced changes in behavior, perhaps by unexpected changes in how these objects are being initialized. I don't feel comfortable approving the change with these failing tests.
Daniel Bates
Comment 17
2017-06-20 15:36:28 PDT
Created
attachment 313444
[details]
Patch
Daniel Bates
Comment 18
2017-06-20 15:52:19 PDT
Created
attachment 313446
[details]
Patch
Daniel Bates
Comment 19
2017-06-21 11:33:23 PDT
Created
attachment 313535
[details]
Patch
Daniel Bates
Comment 20
2017-06-21 11:55:27 PDT
<
rdar://problem/32903570
>
Brent Fulgham
Comment 21
2017-06-21 13:01:40 PDT
Comment on
attachment 313535
[details]
Patch Very nice! r=me.
Darin Adler
Comment 22
2017-06-21 13:48:34 PDT
Comment on
attachment 313535
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=313535&action=review
> Source/WebCore/loader/FrameLoadRequest.h:69 > + FrameLoadRequest(const FrameLoadRequest& other) > + : m_requester { other.m_requester.copyRef() } > + , m_resourceRequest { other.m_resourceRequest } > + , m_frameName { other.m_frameName } > + , m_substituteData { other.m_substituteData } > + , m_shouldCheckNewWindowPolicy { other.m_shouldCheckNewWindowPolicy } > + , m_lockHistory { other.m_lockHistory } > + , m_lockBackForwardList { other.m_lockBackForwardList } > + , m_shouldSendReferrer { other.m_shouldSendReferrer } > + , m_allowNavigationToInvalidURL { other.m_allowNavigationToInvalidURL } > + , m_newFrameOpenerPolicy { other.m_newFrameOpenerPolicy } > + , m_shouldReplaceDocumentIfJavaScriptURL { other.m_shouldReplaceDocumentIfJavaScriptURL } > + , m_shouldOpenExternalURLsPolicy { other.m_shouldOpenExternalURLsPolicy } > + , m_downloadAttribute { other.m_downloadAttribute } > { > }
Irritating that we have to write this long function because Ref can’t be copied; it would be so easy to make the mistake of leaving one of these data members out and cause a bug that way. Also annoying that we ever have to copy a FrameLoadRequest. Maybe we can change at least some call sites so we move instead?
Daniel Bates
Comment 23
2017-06-21 14:10:30 PDT
(In reply to Darin Adler from
comment #22
)
> Comment on
attachment 313535
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=313535&action=review
> > > Source/WebCore/loader/FrameLoadRequest.h:69 > > + FrameLoadRequest(const FrameLoadRequest& other) > > + : m_requester { other.m_requester.copyRef() } > > + , m_resourceRequest { other.m_resourceRequest } > > + , m_frameName { other.m_frameName } > > + , m_substituteData { other.m_substituteData } > > + , m_shouldCheckNewWindowPolicy { other.m_shouldCheckNewWindowPolicy } > > + , m_lockHistory { other.m_lockHistory } > > + , m_lockBackForwardList { other.m_lockBackForwardList } > > + , m_shouldSendReferrer { other.m_shouldSendReferrer } > > + , m_allowNavigationToInvalidURL { other.m_allowNavigationToInvalidURL } > > + , m_newFrameOpenerPolicy { other.m_newFrameOpenerPolicy } > > + , m_shouldReplaceDocumentIfJavaScriptURL { other.m_shouldReplaceDocumentIfJavaScriptURL } > > + , m_shouldOpenExternalURLsPolicy { other.m_shouldOpenExternalURLsPolicy } > > + , m_downloadAttribute { other.m_downloadAttribute } > > { > > } > > Irritating that we have to write this long function because Ref can’t be > copied; it would be so easy to make the mistake of leaving one of these data > members out and cause a bug that way. Also annoying that we ever have to > copy a FrameLoadRequest. Maybe we can change at least some call sites so we > move instead?
When I was writing this patch I thought about making FrameLoadRequest a move-only type. I thought to do this in a separate bug/patch as this patch was already sufficiently large.
Daniel Bates
Comment 24
2017-06-21 14:19:16 PDT
Committed
r218649
: <
http://trac.webkit.org/changeset/218649
>
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