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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2526833003: [ios] Handle gracefully WK messages sent by iframes. (Closed)
Patch Set: Addressed review comment Created 4 years, 1 month 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 | « no previous file | 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/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index ab0edf30873f5ba62ead08f8d0034afc15094cac..daba52a1871c7d98c800ef12efd9cc37c4478fbd 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -2685,7 +2685,11 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
}
- (BOOL)respondToWKScriptMessage:(WKScriptMessage*)scriptMessage {
- CHECK(scriptMessage.frameInfo.mainFrame);
+ if (!scriptMessage.frameInfo.mainFrame) {
+ // Messages from iframes are not currently supported.
+ return NO;
+ }
+
int errorCode = 0;
std::string errorMessage;
std::unique_ptr<base::Value> inputJSONData(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698