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

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

Issue 308173002: Fix race and remove unused features in cryptotoken extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix type annotation Created 6 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
« no previous file with comments | « no previous file | chrome/browser/resources/cryptotoken/enroller.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 /** 5 /**
6 * @fileoverview U2F gnubbyd background page 6 * @fileoverview U2F gnubbyd background page
7 */ 7 */
8 8
9 'use strict'; 9 'use strict';
10 10
(...skipping 13 matching lines...) Expand all
24 * @param {boolean} toleratesMultipleResponses Whether the web page can handle 24 * @param {boolean} toleratesMultipleResponses Whether the web page can handle
25 * multiple responses given to its sendResponse callback. 25 * multiple responses given to its sendResponse callback.
26 * @param {Object} request Request object 26 * @param {Object} request Request object
27 * @param {MessageSender} sender Sender frame 27 * @param {MessageSender} sender Sender frame
28 * @param {Function} sendResponse Response callback 28 * @param {Function} sendResponse Response callback
29 * @return {?Closeable} Optional handler object that should be closed when port 29 * @return {?Closeable} Optional handler object that should be closed when port
30 * closes 30 * closes
31 */ 31 */
32 function handleWebPageRequest(toleratesMultipleResponses, request, sender, 32 function handleWebPageRequest(toleratesMultipleResponses, request, sender,
33 sendResponse) { 33 sendResponse) {
34 var enforceAppIdValid = true;
35 switch (request.type) { 34 switch (request.type) {
36 case GnubbyMsgTypes.ENROLL_WEB_REQUEST: 35 case GnubbyMsgTypes.ENROLL_WEB_REQUEST:
37 return handleEnrollRequest(ENROLL_HELPER_FACTORY, sender, request, 36 return handleEnrollRequest(ENROLL_HELPER_FACTORY, sender, request,
38 enforceAppIdValid, sendResponse, toleratesMultipleResponses); 37 sendResponse, toleratesMultipleResponses);
39 38
40 case GnubbyMsgTypes.SIGN_WEB_REQUEST: 39 case GnubbyMsgTypes.SIGN_WEB_REQUEST:
41 return handleSignRequest(SIGN_HELPER_FACTORY, sender, request, 40 return handleSignRequest(SIGN_HELPER_FACTORY, sender, request,
42 enforceAppIdValid, sendResponse, toleratesMultipleResponses); 41 sendResponse, toleratesMultipleResponses);
43 42
44 default: 43 default:
45 var response = formatWebPageResponse( 44 var response = formatWebPageResponse(
46 GnubbyMsgTypes.ENROLL_WEB_REPLY, GnubbyCodeTypes.BAD_REQUEST); 45 GnubbyMsgTypes.ENROLL_WEB_REPLY, GnubbyCodeTypes.BAD_REQUEST);
47 sendResponse(response); 46 sendResponse(response);
48 return null; 47 return null;
49 } 48 }
50 } 49 }
51 50
52 // Message handler for requests coming from web pages. 51 // Message handler for requests coming from web pages.
(...skipping 24 matching lines...) Expand all
77 response['requestId'] = request['requestId']; 76 response['requestId'] = request['requestId'];
78 port.postMessage(response); 77 port.postMessage(response);
79 }); 78 });
80 }); 79 });
81 port.onDisconnect.addListener(function() { 80 port.onDisconnect.addListener(function() {
82 if (closeable) { 81 if (closeable) {
83 closeable.close(); 82 closeable.close();
84 } 83 }
85 }); 84 });
86 }); 85 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/cryptotoken/enroller.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698