[webkit-reviews] review granted: [Bug 176725] [WPE][GTK] Deprecate and replace webkit_form_submission_request_get_text_fields : [Attachment 329052] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 18 00:52:58 PST 2017


Carlos Garcia Campos <cgarcia at igalia.com> has granted Michael Catanzaro
<mcatanzaro at igalia.com>'s request for review:
Bug 176725: [WPE][GTK] Deprecate and replace
webkit_form_submission_request_get_text_fields
https://bugs.webkit.org/show_bug.cgi?id=176725

Attachment 329052: Patch

https://bugs.webkit.org/attachment.cgi?id=329052&action=review




--- Comment #11 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 329052
  --> https://bugs.webkit.org/attachment.cgi?id=329052
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=329052&action=review

> Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:82
> +	       g_ptr_array_add(request->priv->textFieldNames.get(),
static_cast<gpointer>(g_strdup(values[i].first.utf8().data())));
> +	       g_ptr_array_add(request->priv->textFieldValues.get(),
static_cast<gpointer>(g_strdup(values[i].second.utf8().data())));

I don't think we need to cast here

> Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:98
> + * Returns: (allow-none) (transfer none): a #GHashTable with the form

Why did you add allow-none? We are always returning a valid GHashTable, no?

> Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:99
> + *	 text fields, or %NULL if the form doesn't contain text fields.

We don't return NULL anymore, this could be considered an API change. Don't we
have a unit tests for this particular case?

> Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:107
> +    if (!request->priv->values) {

To keep compatibility you should check here  &&
request->priv->textFieldNames->len

> Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:109
> +	   ASSERT(request->priv->textFieldNames->len ==
request->priv->textFieldValues->len);

I don't think this is needed, the arrays are created internally with the same
len value.

> Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:135
> + * Returns: %TRUE if the form contains text fields

, or %FALSE otherwise

> Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:148
> +    ASSERT(request->priv->textFieldNames->len ==
request->priv->textFieldValues->len);

I don't think this is needed, the arrays are created internally with the same
len value.


More information about the webkit-reviews mailing list