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

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

Issue 10821016: Delete chrome/test/data/workers since it's not used anymore. It was copied in r148205 in preparatio… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/workers/worker_close.html ('k') | chrome/test/data/workers/worker_utils.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Track the number of clients for this worker - tests can use this to ensure
2 // that shared workers are actually shared, not distinct.
3 var num_clients = 0;
4
5 if (!self.postMessage) {
6 // This is a shared worker - mimic dedicated worker APIs
7 onconnect = function(event) {
8 num_clients++;
9 event.ports[0].onmessage = function(e) {
10 self.postMessage = function(msg) {
11 event.ports[0].postMessage(msg);
12 };
13 self.onmessage(e);
14 };
15 };
16 } else {
17 num_clients++;
18 }
19 onmessage = function(evt) {
20 if (evt.data == "ping")
21 postMessage("pong");
22 else if (evt.data == "auth")
23 importScripts("/auth-basic");
24 else if (evt.data == "close")
25 close();
26 else if (/eval.+/.test(evt.data)) {
27 try {
28 postMessage(eval(evt.data.substr(5)));
29 } catch (ex) {
30 postMessage(ex);
31 }
32 }
33 }
OLDNEW
« no previous file with comments | « chrome/test/data/workers/worker_close.html ('k') | chrome/test/data/workers/worker_utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698