Title: [235909] trunk/Source/WebKit
Revision
235909
Author
[email protected]
Date
2018-09-11 12:26:47 -0700 (Tue, 11 Sep 2018)

Log Message

[WPE][GTK] API documentation is unclear about how to modify requests before sending them
https://bugs.webkit.org/show_bug.cgi?id=189505

Reviewed by Michael Catanzaro.

Add notes to the API documentation to make explicit where modification
of WebKitURIRequest instances affects the request data sent over the
network.

* UIProcess/API/glib/WebKitNavigationAction.cpp: Clarify that
modifications to the associated WebKitURIRequest do not affect the
actual request. Point to WebKitPage::send-request instead.
* UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Ditto.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_class_init): Ditto for the description of the
WebKitWebView::decide-policy signal. Also fix the syntax of example.
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkit_web_page_class_init): Indicate that modifications to the
WebKitURIRequest will change the actual network request data.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (235908 => 235909)


--- trunk/Source/WebKit/ChangeLog	2018-09-11 19:19:52 UTC (rev 235908)
+++ trunk/Source/WebKit/ChangeLog	2018-09-11 19:26:47 UTC (rev 235909)
@@ -1,3 +1,25 @@
+2018-09-11  Adrian Perez de Castro  <[email protected]>
+
+        [WPE][GTK] API documentation is unclear about how to modify requests before sending them
+        https://bugs.webkit.org/show_bug.cgi?id=189505
+
+        Reviewed by Michael Catanzaro.
+
+        Add notes to the API documentation to make explicit where modification
+        of WebKitURIRequest instances affects the request data sent over the
+        network.
+
+        * UIProcess/API/glib/WebKitNavigationAction.cpp: Clarify that
+        modifications to the associated WebKitURIRequest do not affect the
+        actual request. Point to WebKitPage::send-request instead.
+        * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Ditto.
+        * UIProcess/API/glib/WebKitWebView.cpp:
+        (webkit_web_view_class_init): Ditto for the description of the
+        WebKitWebView::decide-policy signal. Also fix the syntax of example.
+        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
+        (webkit_web_page_class_init): Indicate that modifications to the
+        WebKitURIRequest will change the actual network request data.
+
 2018-09-11  Michael Catanzaro  <[email protected]>
 
         Unreviewed, attempt to fix Apple builds after r235903

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitNavigationAction.cpp (235908 => 235909)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitNavigationAction.cpp	2018-09-11 19:19:52 UTC (rev 235908)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitNavigationAction.cpp	2018-09-11 19:26:47 UTC (rev 235909)
@@ -124,7 +124,12 @@
  * webkit_navigation_action_get_request:
  * @navigation: a #WebKitNavigationAction
  *
- * Return the navigation #WebKitURIRequest
+ * Return the #WebKitURIRequest associated with the navigation action.
+ * Modifications to the returned object are <emphasis>not</emphasis> taken
+ * into account when the request is sent over the network, and is intended
+ * only to aid in evaluating whether a navigation action should be taken or
+ * not. To modify requests before they are sent over the network the
+ * #WebKitPage::send-request signal can be used instead.
  *
  * Returns: (transfer none): a #WebKitURIRequest
  *

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitResponsePolicyDecision.cpp (235908 => 235909)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitResponsePolicyDecision.cpp	2018-09-11 19:19:52 UTC (rev 235908)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitResponsePolicyDecision.cpp	2018-09-11 19:26:47 UTC (rev 235909)
@@ -114,7 +114,12 @@
  * webkit_response_policy_decision_get_request:
  * @decision: a #WebKitResponsePolicyDecision
  *
- * Gets the value of the #WebKitResponsePolicyDecision:request property.
+ * Return the #WebKitURIRequest associated with the response decision.
+ * Modifications to the returned object are <emphasis>not</emphasis> taken
+ * into account when the request is sent over the network, and is intended
+ * only to aid in evaluating whether a response decision should be taken or
+ * not. To modify requests before they are sent over the network the
+ * #WebKitPage::send-request signal can be used instead.
  *
  * Returns: (transfer none): The URI request that is associated with this policy decision.
  */

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp (235908 => 235909)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp	2018-09-11 19:19:52 UTC (rev 235908)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp	2018-09-11 19:26:47 UTC (rev 235909)
@@ -1387,14 +1387,16 @@
      *                   WebKitPolicyDecisionType type)
      * {
      *     switch (type) {
-     *     case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION:
+     *     case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: {
      *         WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
      *         /<!-- -->* Make a policy decision here. *<!-- -->/
      *         break;
-     *     case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION:
+     *     }
+     *     case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: {
      *         WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
      *         /<!-- -->* Make a policy decision here. *<!-- -->/
      *         break;
+     *     }
      *     case WEBKIT_POLICY_DECISION_TYPE_RESPONSE:
      *         WebKitResponsePolicyDecision *response = WEBKIT_RESPONSE_POLICY_DECISION (decision);
      *         /<!-- -->* Make a policy decision here. *<!-- -->/

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp (235908 => 235909)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp	2018-09-11 19:19:52 UTC (rev 235908)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp	2018-09-11 19:26:47 UTC (rev 235909)
@@ -479,6 +479,10 @@
      * @redirected_response parameter containing the response
      * received by the server for the initial request.
      *
+     * Modifications to the #WebKitURIRequest and its associated
+     * #SoupMessageHeaders will be taken into account when the request
+     * is sent over the network.
+     *
      * Returns: %TRUE to stop other handlers from being invoked for the event.
      *    %FALSE to continue emission of the event.
      */
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to