WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
38827
FrameLoader: refactor changeLocation() and urlSelected() to share more code
https://bugs.webkit.org/show_bug.cgi?id=38827
Summary
FrameLoader: refactor changeLocation() and urlSelected() to share more code
Chris Jerdonek
Reported
2010-05-09 18:00:34 PDT
The following call appears twice: m_frame->script()->executeIfJavaScriptURL() Also, when changeLocation() is called, the function unnecessarily gets called twice.
Attachments
Proposed patch
(3.64 KB, patch)
2010-05-13 01:01 PDT
,
Chris Jerdonek
abarth
: review-
Details
Formatted Diff
Diff
Proposed patch 2
(4.65 KB, patch)
2010-05-16 14:09 PDT
,
Chris Jerdonek
abarth
: review+
abarth
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Jerdonek
Comment 1
2010-05-13 01:01:35 PDT
Created
attachment 55954
[details]
Proposed patch
Adam Barth
Comment 2
2010-05-16 06:53:06 PDT
Comment on
attachment 55954
[details]
Proposed patch For parameters like shouldReplaceDocumentIfJavascriptURL, we like to use enums with two values so you can read at the call site what the parameter does (instead of just "true" or "false"). For example, we'd add ReplaceDocumentIfJavaScritptURL or DoNotReplaceDocumentIfJavaScritptURL as the argument.
Chris Jerdonek
Comment 3
2010-05-16 14:09:46 PDT
Created
attachment 56193
[details]
Proposed patch 2
Adam Barth
Comment 4
2010-05-16 17:41:55 PDT
Comment on
attachment 56193
[details]
Proposed patch 2 LGTM. Please consider these small tweaks below before landing. WebCore/loader/FrameLoader.cpp:340 + bool lockHistory, bool lockBackForwardList, bool userGesture, ReferrerPolicy referrerPolicy) We usually don't add line breaks for function declarations, even when they're ridiculously long like this one. WebCore/loader/FrameLoader.cpp:352 + if (m_frame->script()->executeIfJavaScriptURL(request.url(), userGesture, shouldReplaceDocumentIfJavaScriptURL == ReplaceDocumentIfJavaScriptURL)) You might consider propagating the enum down into executeIfJavaScriptURL so we don't have to convert here and other callers (if there are any) will look prettier.
Chris Jerdonek
Comment 5
2010-05-17 00:35:56 PDT
Committed
r59596
: <
http://trac.webkit.org/changeset/59596
>
Chris Jerdonek
Comment 6
2010-05-17 01:17:24 PDT
(In reply to
comment #4
)
> (From update of
attachment 56193
[details]
) > LGTM. Please consider these small tweaks below before landing. > > WebCore/loader/FrameLoader.cpp:340 > + bool lockHistory, bool lockBackForwardList, bool userGesture, ReferrerPolicy referrerPolicy) > We usually don't add line breaks for function declarations, even when they're ridiculously long like this one. > > WebCore/loader/FrameLoader.cpp:352 > + if (m_frame->script()->executeIfJavaScriptURL(request.url(), userGesture, shouldReplaceDocumentIfJavaScriptURL == ReplaceDocumentIfJavaScriptURL)) > You might consider propagating the enum down into executeIfJavaScriptURL so we don't have to convert here and other callers (if there are any) will look prettier.
FYI, I incorporated both of these suggestions in the final commit. Thanks for your review and helpful comments.
WebKit Review Bot
Comment 7
2010-05-17 03:26:49 PDT
http://trac.webkit.org/changeset/59596
might have broken GTK Linux 32-bit Debug
Chris Jerdonek
Comment 8
2010-05-17 05:52:29 PDT
(In reply to
comment #7
)
>
http://trac.webkit.org/changeset/59596
might have broken GTK Linux 32-bit Debug
The three test cases that failed here also failed in a previous revision (
r59591
), so it doesn't look like the revision for this report caused the breakage.
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