WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 45222
Add ability to send UserData to willSubmitForm
https://bugs.webkit.org/show_bug.cgi?id=45222
Summary
Add ability to send UserData to willSubmitForm
Sam Weinig
Reported
2010-09-03 18:37:01 PDT
Add ability to send UserData to willSubmitForm
Attachments
Patch
(19.90 KB, patch)
2010-09-03 19:39 PDT
,
Sam Weinig
mitz: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2010-09-03 19:39:10 PDT
Created
attachment 66581
[details]
Patch
WebKit Review Bot
Comment 2
2010-09-03 19:45:15 PDT
Attachment 66581
[details]
did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h:150: Extra space between WKBundlePageWillSubmitFormCallback and willSubmitForm [whitespace/declaration] [3] WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:35: Code inside a namespace should not be indented. [whitespace/indent] [4] WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:31: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 3 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
mitz
Comment 3
2010-09-03 19:48:02 PDT
Comment on
attachment 66581
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=66581&action=prettypatch
> WebKit2/UIProcess/WebPageProxy.h:205 > + void willSubmitForm(WebFrameProxy* frame, WebFrameProxy* frameSource, Vector<std::pair<WTF::String, WTF::String> >& textFieldValues, APIObject*, uint64_t listenerID);
I think it would be helpful to name the argument here.
> WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:45 > +class APIObject; > class WebFrame; > class WebPage; > +class ImmutableDictionary;
Please sort. r=me
Adam Barth
Comment 4
2010-09-03 19:49:06 PDT
Comment on
attachment 66581
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=66581&action=prettypatch
Mostly just curious what this code looked like. Very pretty. Some (trivial) comments below.
> WebKit2/UIProcess/WebPageProxy.cpp:581 > - willSubmitForm(process()->webFrame(frameID), process()->webFrame(sourceFrameID), textFieldValues, listenerID); > + willSubmitForm(process()->webFrame(frameID), process()->webFrame(sourceFrameID), textFieldValues, 0/*userData*/, listenerID);
Slightly more beautiful would be a noUserData constant that was just a null pointer.
> WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:513 > + RefPtr<FormState> formState = prpFormState;
I've never really like this pattern, but I don't see a way around it.
> WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:520 > + RefPtr<APIObject> userData; > + webPage->injectedBundleFormClient().willSubmitForm(webPage, form, m_frame, sourceFrame, values, userData);
I'm confused. Don't we need to actually allocate a userData object here? Does willSubmitForm take a RefPtr by reference as an out param?
Sam Weinig
Comment 5
2010-09-03 19:58:16 PDT
(In reply to
comment #4
)
> (From update of
attachment 66581
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=66581&action=prettypatch
> > Mostly just curious what this code looked like. Very pretty. Some (trivial) comments below. > > > WebKit2/UIProcess/WebPageProxy.cpp:581 > > - willSubmitForm(process()->webFrame(frameID), process()->webFrame(sourceFrameID), textFieldValues, listenerID); > > + willSubmitForm(process()->webFrame(frameID), process()->webFrame(sourceFrameID), textFieldValues, 0/*userData*/, listenerID); > Slightly more beautiful would be a noUserData constant that was just a null pointer.
Ok.
> > > WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:520 > > + RefPtr<APIObject> userData; > > + webPage->injectedBundleFormClient().willSubmitForm(webPage, form, m_frame, sourceFrame, values, userData); > I'm confused. Don't we need to actually allocate a userData object here? Does willSubmitForm take a RefPtr by reference as an out param?
Yes it does and very intentionally. Thanks for the review.
Eric Seidel (no email)
Comment 6
2010-10-13 12:27:14 PDT
Attachment 66581
[details]
was posted by a committer and has review+, assigning to Sam Weinig for commit.
Sam Weinig
Comment 7
2010-10-28 13:17:59 PDT
Fixed in
http://trac.webkit.org/changeset/66789
.
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