Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: ios/web/web_state/ui/web_view_js_utils.h

Issue 2761173002: Disallow JS execution on WebUI pages. (Closed)
Patch Set: Addressed review comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/web_view_js_utils.h
diff --git a/ios/web/web_state/ui/web_view_js_utils.h b/ios/web/web_state/ui/web_view_js_utils.h
index 39c5d8e6ad646a548dda39c55fc68f73250cc1dd..a165ccb22c64b630632c8b86f64faae3d4ba9a00 100644
--- a/ios/web/web_state/ui/web_view_js_utils.h
+++ b/ios/web/web_state/ui/web_view_js_utils.h
@@ -27,7 +27,9 @@ extern int const kMaximumParsingRecursionDepth;
// The type of errors that can occur while evaluating JS.
enum JSEvaluationErrorCode {
// No web view present to evaluate JS.
- JS_EVALUATION_ERROR_CODE_NO_WEB_VIEW = 1,
+ JS_EVALUATION_ERROR_CODE_NO_WEB_VIEW = -1000,
+ // JS evaluation is not allowed for security reasons.
+ JS_EVALUATION_ERROR_CODE_REJECTED = -1001,
};
// Converts result of WKWebView script evaluation to base::Value.
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698