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

Unified Diff: ios/web/web_state/js/resources/core.js

Issue 2351893003: Remove __gCrWeb.invokeOnHostImmediate. (Closed)
Patch Set: Move early return out of invokeOnHost. Created 4 years, 3 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 | « no previous file | ios/web/web_state/js/resources/message.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/js/resources/core.js
diff --git a/ios/web/web_state/js/resources/core.js b/ios/web/web_state/js/resources/core.js
index 3ceb27f234b277ee69979d42a8a05d05d0a7907d..42fd71be2e0c66a3c0e77a568625a26402108852 100644
--- a/ios/web/web_state/js/resources/core.js
+++ b/ios/web/web_state/js/resources/core.js
@@ -339,10 +339,6 @@ goog.require('__crWeb.message');
__gCrWeb.message.invokeOnHost(command);
};
- function invokeOnHostImmediate_(command) {
- __gCrWeb.message.invokeOnHostImmediate(command);
- };
-
/**
* Gets the referrer policy to use for navigations away from the current page.
* If a link element is passed, and it includes a rel=noreferrer tag, that
@@ -546,6 +542,10 @@ goog.require('__crWeb.message');
};
var setExternalRequest_ = function(href, target) {
+ // If there is no document or body, the request will be silently dropped
Eugene But (OOO till 7-30) 2016/09/20 22:05:14 Do you even need this comment? It simply repeats t
+ // here.
+ if (!document || !document.body)
+ return;
if (typeof(target) == 'undefined' || target == '_blank' || target == '') {
target = '' + Date.now() + '-' + Math.random();
}
@@ -553,15 +553,10 @@ goog.require('__crWeb.message');
// W3C recommended behavior.
href = 'about:blank';
}
- // ExternalRequest messages need to be handled before the expected
- // shouldStartLoadWithRequest, as such we cannot wait for the regular
- // message queue invoke which delays to avoid illegal recursion into
- // UIWebView. This immediate class of messages is handled ASAP by
- // CRWWebController.
- invokeOnHostImmediate_({'command': 'externalRequest',
- 'href': href,
- 'target': target,
- 'referrerPolicy': getReferrerPolicy_()});
+ invokeOnHost_({'command': 'externalRequest',
+ 'href': href,
+ 'target': target,
+ 'referrerPolicy': getReferrerPolicy_()});
};
var resetExternalRequest_ = function() {
« no previous file with comments | « no previous file | ios/web/web_state/js/resources/message.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698