Index: chrome/browser/resources/cryptotoken/signhelper.js |
diff --git a/chrome/browser/resources/cryptotoken/signhelper.js b/chrome/browser/resources/cryptotoken/signhelper.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ecd7e76782f2ad4e2db043413b25478feac0f48f |
--- /dev/null |
+++ b/chrome/browser/resources/cryptotoken/signhelper.js |
@@ -0,0 +1,49 @@ |
+// Copyright (c) 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. |
+ |
+/** |
+ * @fileoverview Provides a "bottom half" helper to assist with raw sign |
+ * requests. |
+ * @author juanlang@google.com (Juan Lang) |
+ */ |
+'use strict'; |
+ |
+/** |
+ * A helper for sign requests. |
+ * @extends {Closeable} |
+ * @interface |
+ */ |
+function SignHelper() {} |
+ |
+/** |
+ * Attempts to sign the provided challenges. |
+ * @param {Array.<SignHelperChallenge>} challenges the new challenges to sign. |
+ * @return {boolean} whether the challenges were successfully added. |
+ */ |
+SignHelper.prototype.doSign = function(challenges) {}; |
+ |
+/** Closes this helper. */ |
+SignHelper.prototype.close = function() {}; |
+ |
+/** |
+ * A factory for creating sign helpers. |
+ * @interface |
+ */ |
+function SignHelperFactory() {} |
+ |
+/** |
+ * Creates a new sign helper. |
+ * @param {Countdown} timer Timer after whose expiration the caller is no longer |
+ * interested in the result of a sign request. |
+ * @param {function(number, boolean)} errorCb Called when a sign request fails |
+ * with an error code and whether any gnubbies were found. |
+ * @param {function(SignHelperChallenge, string)} successCb Called with the |
+ * signature produced by a successful sign request. |
+ * @param {(function(number, boolean)|undefined)} opt_progressCb Called with |
+ * progress updates to the sign request. |
+ * @param {string=} opt_logMsgUrl A URL to post log messages to. |
+ * @return {SignHelper} The newly created helper. |
+ */ |
+SignHelperFactory.prototype.createHelper = |
+ function(timer, errorCb, successCb, opt_progressCb, opt_logMsgUrl) {}; |