fileSubWorker_worker.js 419 B

123456789101112131415161718
  1. /**
  2. * Expects a file. Returns an object containing the size, type, name and path
  3. * using another worker. Used to test posting of file from worker to worker.
  4. */
  5. onmessage = function(event) {
  6. var worker = new Worker("file_worker.js");
  7. worker.postMessage(event.data);
  8. worker.onmessage = function(event) {
  9. postMessage(event.data);
  10. }
  11. worker.onerror = function(event) {
  12. postMessage(undefined);
  13. }
  14. };