[epiphany] Add warning comments about policy decision handling



commit 04a12ca58fcaf2b752445e2127bf425b370b0143
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Fri Oct 14 11:04:41 2022 -0500

    Add warning comments about policy decision handling
    
    In the past, I was quite confused by our two decide-policy callbacks.
    Nowadays the situation is OK because they handle different types of
    policy decisions, but this would be easy to mess up in the future if we
    are not careful, so add comments to hopefully avoid this.

 embed/ephy-web-view.c | 1 +
 src/ephy-window.c     | 1 +
 2 files changed, 2 insertions(+)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 902ecec41..13c46052f 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -941,6 +941,7 @@ decide_policy_cb (WebKitWebView            *web_view,
   const char *request_uri;
   gboolean is_main_resource;
 
+  /* Non-response policy decisions are handled in EphyWindow instead. */
   if (decision_type != WEBKIT_POLICY_DECISION_TYPE_RESPONSE)
     return FALSE;
 
diff --git a/src/ephy-window.c b/src/ephy-window.c
index f557397f0..bc14c3b0d 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2319,6 +2319,7 @@ decide_policy_cb (WebKitWebView            *web_view,
   WebKitURIRequest *request;
   const char *request_uri;
 
+  /* Response policy decisions are handled in EphyWebView instead. */
   if (decision_type != WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION &&
       decision_type != WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION)
     return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]