Chromium Code Reviews| Index: ios/web/webui/resources/console.js |
| diff --git a/ios/web/webui/resources/console.js b/ios/web/webui/resources/console.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1ac77eab751b7a755e2ad7fa2783eee2854175b1 |
| --- /dev/null |
| +++ b/ios/web/webui/resources/console.js |
| @@ -0,0 +1,25 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// Module "console" |
| +// |
| +// This module provides basic logging support. The reason to define this module |
| +// to forward calls to the |console| object exposed by the browser, instead of |
| +// using that object directly: mojo JS bindings are currently loaded using gin |
| +// and the |console| object is not always available. When we move away from |
|
Eugene But (OOO till 7-30)
2017/01/10 19:32:52
nit: go/avoidwe :)
yzshen1
2017/01/10 20:13:08
Done.
|
| +// gin, we will be able to get rid of this module. |
| + |
| +define("console", [], function() { |
| + /** |
| + * Logs a message to the console. |
| + * @param {string} message to log. |
| + */ |
| + function log(message) { |
| + console.log(message); |
| + } |
| + |
| + var exports = {}; |
| + exports.log = log; |
| + return exports; |
| +}); |