Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/resources/basic-plumbing-main-to-worker.js |
| diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/resources/basic-plumbing-main-to-worker.js b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/resources/basic-plumbing-main-to-worker.js |
| index e551f837ead12a789ae9eef0de8763c6b36d265e..995c75acc0498c4b47077f141e54bb0025ca57fb 100644 |
| --- a/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/resources/basic-plumbing-main-to-worker.js |
| +++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/resources/basic-plumbing-main-to-worker.js |
| @@ -1,5 +1,3 @@ |
| -self.importScripts('worker-common.js'); |
| - |
| self.onmessage = function(msg) { |
| if (msg.data.proxy) |
| self.proxy = msg.data.proxy; |
| @@ -14,3 +12,14 @@ self.onmessage = function(msg) { |
| postMessage(values); |
| }); |
| } |
| + |
| +function awaitProxyInit(proxy) { |
| + return new Promise((resolve, reject) => { |
| + function check() { |
| + if (proxy.initialized) |
| + resolve(proxy); |
| + requestAnimationFrame(check); |
|
jbroman
2016/07/06 15:14:00
ex-post-facto question: This looks like it will co
majidvp
2016/07/06 17:45:38
It definitely should!
|
| + } |
| + requestAnimationFrame(check); |
| + }); |
| +} |