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

Side by Side Diff: ios/web/webui/resources/sync_message_channel.js

Issue 2946383002: Support new-style Mojo JS core API on IOS. (Closed)
Patch Set: . Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « ios/web/webui/resources/support.js ('k') | ios/web/webui/resources/timer.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Module "ios/mojo/public/js/sync_message_channel"
6 //
7 // This module provides the synchronous communication channel between
8 // JavaScript and native code, which serves as mojo backend.
9
10 define("ios/mojo/public/js/sync_message_channel", [], function() {
11 var exports = {};
12
13 /**
14 * Synchronously sends a message to mojo backend.
15 * @param {!Object} message to send.
16 * @return {Object} Response from mojo backend.
17 */
18 exports.sendMessage = function(message) {
19 var response = window.prompt(__gCrWeb.common.JSONStringify(message));
20 return response ? JSON.parse(response) : undefined;
21 }
22
23 return exports;
24 });
OLDNEW
« no previous file with comments | « ios/web/webui/resources/support.js ('k') | ios/web/webui/resources/timer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698