Chromium Code Reviews| 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..89d2705541eb99f840b15d1d366e7340c6b1ce2b 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,14 @@ __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) { |
| + // If there is no document or body, the command will be silently dropped. |
|
Eugene But (OOO till 7-30)
2016/09/19 23:20:40
Should we still enqueue the message, even if we ar
Eugene But (OOO till 7-30)
2016/09/19 23:20:40
Could you please clarify what do you mean by |will
michaeldo
2016/09/20 18:26:17
It is dropped here by the early return.
This logi
|
| + if (!document || !document.body) |
| return; |
| - } |
| messageQueue_.queue.push(command); |
| sendQueue_(messageQueue_); |
| }; |
| @@ -94,8 +59,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_); |
| }; |