Don't send JS->ObjC messages while doing URL verification
commitcb414491d46a827936919f54155cf6eb4621f258
authorstuartmorgan <stuartmorgan@chromium.org>
Wed, 17 Jun 2015 20:12:44 +0000 (17 13:12 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 17 Jun 2015 20:13:09 +0000 (17 20:13 +0000)
tree63e916fa38f28ef2c01cf1c85b7fcb3819fa2634
parentc56a5d74778de74bea348e95154ae4bf757028ac
Don't send JS->ObjC messages while doing URL verification

Because message handling with UIWebView involves a URL check, there's a
potential for infinite loops if any page overrides XHR and in that
override does something that causes a message to be sent (since that
will in turn trigger a URL check, which involves XHR, which triggers a
message, etc.).

This case has always existed, but the recently-added console.log interception
makes it much more likely.

BUG=500547
TEST=Open page referenced in bug; it should not hang or crash

Review URL: https://codereview.chromium.org/1186013005

Cr-Commit-Position: refs/heads/master@{#334899}
ios/web/net/crw_url_verifying_protocol_handler.mm
ios/web/web_state/js/resources/message.js
ios/web/web_state/ui/crw_web_controller_unittest.mm