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

Side by Side Diff: extensions/renderer/resources/keep_alive.js

Issue 2405093003: [WIP] Mojo native bindings interface.
Patch Set: fixes webui tests Created 3 years, 9 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 | « extensions/renderer/api_test_base.cc ('k') | extensions/test/data/api_test_base_unittest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 define('keep_alive', [ 5 define('keep_alive', [
6 'content/public/renderer/frame_interfaces', 6 'content/public/renderer/frame_interfaces',
7 'extensions/common/mojo/keep_alive.mojom', 7 'extensions/common/mojo/keep_alive.mojom'
8 'mojo/public/js/core', 8 ], function(frameInterfaces, mojom) {
9 ], function(frameInterfaces, mojom, core) {
10 9
11 /** 10 /**
12 * An object that keeps the background page alive until closed. 11 * An object that keeps the background page alive until closed.
13 * @constructor 12 * @constructor
14 * @alias module:keep_alive~KeepAlive 13 * @alias module:keep_alive~KeepAlive
15 */ 14 */
16 function KeepAlive() { 15 function KeepAlive() {
17 /** 16 /**
18 * The handle to the keep-alive object in the browser. 17 * The handle to the keep-alive object in the browser.
19 * @type {!MojoHandle} 18 * @type {!MojoHandle}
20 * @private 19 * @private
21 */ 20 */
22 this.handle_ = frameInterfaces.getInterface(mojom.KeepAlive.name); 21 this.handle_ = frameInterfaces.getInterface(mojom.KeepAlive.name);
23 } 22 }
24 23
25 /** 24 /**
26 * Removes this keep-alive. 25 * Removes this keep-alive.
27 */ 26 */
28 KeepAlive.prototype.close = function() { 27 KeepAlive.prototype.close = function() {
29 core.close(this.handle_); 28 this.handle_.close();
30 }; 29 };
31 30
32 var exports = {}; 31 var exports = {};
33 32
34 return { 33 return {
35 /** 34 /**
36 * Creates a keep-alive. 35 * Creates a keep-alive.
37 * @return {!module:keep_alive~KeepAlive} A new keep-alive. 36 * @return {!module:keep_alive~KeepAlive} A new keep-alive.
38 */ 37 */
39 createKeepAlive: function() { return new KeepAlive(); } 38 createKeepAlive: function() { return new KeepAlive(); }
40 }; 39 };
41 }); 40 });
OLDNEW
« no previous file with comments | « extensions/renderer/api_test_base.cc ('k') | extensions/test/data/api_test_base_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698