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

Side by Side Diff: content/test/data/workers/worker_common.js

Issue 859213006: Cancel client auth requests when not promptable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client-auth-cancel-1
Patch Set: mmenke comments Created 5 years, 10 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 // Track the number of clients for this worker - tests can use this to ensure 1 // Track the number of clients for this worker - tests can use this to ensure
2 // that shared workers are actually shared, not distinct. 2 // that shared workers are actually shared, not distinct.
3 var num_clients = 0; 3 var num_clients = 0;
4 4
5 if (!self.postMessage) { 5 if (!self.postMessage) {
6 // This is a shared worker - mimic dedicated worker APIs 6 // This is a shared worker - mimic dedicated worker APIs
7 onconnect = function(event) { 7 onconnect = function(event) {
8 num_clients++; 8 num_clients++;
9 event.ports[0].onmessage = function(e) { 9 event.ports[0].onmessage = function(e) {
10 self.postMessage = function(msg) { 10 self.postMessage = function(msg) {
(...skipping 11 matching lines...) Expand all
22 else if (evt.data == "auth") 22 else if (evt.data == "auth")
23 importScripts("/auth-basic"); 23 importScripts("/auth-basic");
24 else if (evt.data == "close") 24 else if (evt.data == "close")
25 close(); 25 close();
26 else if (/eval.+/.test(evt.data)) { 26 else if (/eval.+/.test(evt.data)) {
27 try { 27 try {
28 postMessage(eval(evt.data.substr(5))); 28 postMessage(eval(evt.data.substr(5)));
29 } catch (ex) { 29 } catch (ex) {
30 postMessage(ex); 30 postMessage(ex);
31 } 31 }
32 } else if (/tls-client-auth.+/.test(evt.data)) {
33 try {
34 importScripts(evt.data.substr(16));
35 } catch (ex) {
36 }
37 postMessage("done");
32 } 38 }
33 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698