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

Side by Side Diff: chrome/browser/resources/cryptotoken/requesthelper.js

Issue 2939273002: DO NOT SUBMIT: what chrome/browser/resources/ could eventually look like with clang-format (Closed)
Patch Set: Created 3 years, 6 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
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 /** 5 /**
6 * @fileoverview Provides a "bottom half" helper to assist with raw requests. 6 * @fileoverview Provides a "bottom half" helper to assist with raw requests.
7 * This fills the same role as the Authenticator-Specific Module component of 7 * This fills the same role as the Authenticator-Specific Module component of
8 * U2F documents, although the API is different. 8 * U2F documents, although the API is different.
9 */ 9 */
10 'use strict'; 10 'use strict';
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 * present in the request. 66 * present in the request.
67 * @return {HelperReply} The helper error response. 67 * @return {HelperReply} The helper error response.
68 */ 68 */
69 function makeHelperErrorResponse(request, code, opt_defaultType) { 69 function makeHelperErrorResponse(request, code, opt_defaultType) {
70 var type; 70 var type;
71 if (request && request.type) { 71 if (request && request.type) {
72 type = request.type.replace(/_request$/, '_reply'); 72 type = request.type.replace(/_request$/, '_reply');
73 } else { 73 } else {
74 type = opt_defaultType || 'unknown_type_reply'; 74 type = opt_defaultType || 'unknown_type_reply';
75 } 75 }
76 var reply = { 76 var reply = {'type': type, 'code': /** @type {number} */ (code)};
77 'type': type,
78 'code': /** @type {number} */ (code)
79 };
80 return reply; 77 return reply;
81 } 78 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698