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

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

Issue 2351893003: Remove __gCrWeb.invokeOnHostImmediate. (Closed)
Patch Set: Remove early return. 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 | « ios/web/web_state/js/resources/core.js ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/js/resources/message.js
diff --git a/ios/web/web_state/js/resources/message.js b/ios/web/web_state/js/resources/message.js
index 1525e7d224605b8c5445ab71c4f42f90bd8139c1..f9a41e92204b3988d0e66201247fe9e9a32f528f 100644
--- a/ios/web/web_state/js/resources/message.js
+++ b/ios/web/web_state/js/resources/message.js
@@ -17,23 +17,6 @@ __gCrWeb.message = {};
(function() {
/**
* Object to manage queue of messages waiting to be sent to the main
- * application for immediate processing.
- * @type {Object}
- * @private
- */
- var immediateMessageQueue_ = {
- scheme: 'crwebinvokeimmediate',
- reset: function() {
- immediateMessageQueue_.queue = [];
- // Since the array will be JSON serialized, protect against non-standard
- // custom versions of Array.prototype.toJSON.
- immediateMessageQueue_.queue.toJSON = null;
- }
- };
- immediateMessageQueue_.reset();
-
- /**
- * Object to manage queue of messages waiting to be sent to the main
* application for asynchronous processing.
* @type {Object}
* @private
@@ -50,32 +33,11 @@ __gCrWeb.message = {};
messageQueue_.reset();
/**
- * Invokes a command immediately on the Objective-C side.
- * An immediate command is a special class of command that must be handled at
- * the earliest opportunity. See the notes in CRWWebController for
- * restrictions and precautions.
- * @param {Object} command The command in a JavaScript object.
- * @private
- */
- __gCrWeb.message.invokeOnHostImmediate = function(command) {
- // If there is no document or body, the command will be silently dropped.
- if (!document || !document.body)
- return;
- immediateMessageQueue_.queue.push(command);
- sendQueue_(immediateMessageQueue_);
- };
-
- /**
* Invokes a command on the Objective-C side.
* @param {Object} command The command in a JavaScript object.
* @private
*/
__gCrWeb.message.invokeOnHost = function(command) {
- // Avoid infinite loops in sites that send messages as a side effect
- // of URL verification (e.g., due to logging in an XHR override).
- if (window.__gCrWeb_Verifying) {
- return;
- }
messageQueue_.queue.push(command);
sendQueue_(messageQueue_);
};
@@ -94,8 +56,6 @@ __gCrWeb.message = {};
* Sends both queues if they contain messages.
*/
__gCrWeb.message.invokeQueues = function() {
- if (immediateMessageQueue_.queue.length > 0)
- sendQueue_(immediateMessageQueue_);
if (messageQueue_.queue.length > 0)
sendQueue_(messageQueue_);
};
« no previous file with comments | « ios/web/web_state/js/resources/core.js ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698