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

Unified Diff: extensions/renderer/resources/keep_alive.js

Issue 669303002: Add an extensions keep-alive client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@keep-alive-service
Patch Set: Created 6 years, 2 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
Index: extensions/renderer/resources/keep_alive.js
diff --git a/extensions/renderer/resources/keep_alive.js b/extensions/renderer/resources/keep_alive.js
new file mode 100644
index 0000000000000000000000000000000000000000..5421213b88f092e1de4d7290813c13f9bac21b19
--- /dev/null
+++ b/extensions/renderer/resources/keep_alive.js
@@ -0,0 +1,23 @@
+// Copyright 2014 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.
+
+define('keep_alive', [
+ 'content/public/renderer/service_provider',
+ 'extensions/common/mojo/keep_alive.mojom',
+ 'mojo/public/js/bindings/router',
+], function(serviceProvider, mojom, routerModule) {
+
+ function KeepAlive() {
Ken Rockot(use gerrit already) 2014/10/24 18:29:55 Documentation? It would be nice (IMO) to have our
Sam McNally 2014/10/27 05:07:24 Done. (Switched to holding the handle directly sin
+ this.router_ = new routerModule.Router(
+ serviceProvider.connectToService(mojom.KeepAlive.name));
+ }
+
+ KeepAlive.prototype.close = function() {
+ this.router_.close();
+ };
+
+ return {
+ createKeepAlive: function() { return new KeepAlive(); },
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698