repo.or.cz
/
chromium-blink-merge.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Merge Chromium + Blink git repositories
[chromium-blink-merge.git]
/
third_party
/
WebKit
/
LayoutTests
/
inspector-protocol
/
debugger
/
resources
/
dedicated-worker-loop.js
blob
65f8d2b6ad442117ba8286f26b7f999ce527466e
1
var message_id = 1;
2
onmessage = function(event) {
3
message_id++;
4
postMessage("WorkerMessageReceived");
5
doWork();
6
};
7
8
function doWork() {
9
postMessage("Message #" + message_id++);
10
11
var ts = Date.now();
12
while (true) {
13
try {
14
if (Date.now() - ts > 1000) {
15
ts = Date.now();
16
postMessage("Message #" + message_id++);
17
}
18
} catch (e) {
19
postMessage("Exception " + e);
20
}
21
}
22
}
23