Chromium Code Reviews| Index: Source/modules/serviceworkers/polyfills/cachePolyfill.js |
| diff --git a/Source/modules/serviceworkers/polyfills/cachePolyfill.js b/Source/modules/serviceworkers/polyfills/cachePolyfill.js |
| index 30c145279c4523c5724931a430c36a965a4fc9c7..7fb2dd596c07a11d8fe876785fd95502321adbdf 100644 |
| --- a/Source/modules/serviceworkers/polyfills/cachePolyfill.js |
| +++ b/Source/modules/serviceworkers/polyfills/cachePolyfill.js |
| @@ -82,9 +82,14 @@ var Cache = (function () { |
| }; |
| Cache.prototype.add = function(request) { |
| - // FIXME: Implement this. |
| + var scope = this; |
| + request = _castToRequest(request); |
|
jsbell
2014/06/05 17:48:02
_castToRequest isn't exposed, and you probably wan
jsbell
2014/06/05 17:50:50
Ah, sorry, I didn't see that there was a local cop
|
| return new Promise(function (resolve, reject) { |
| - reject("Cache.add not implemented."); |
| + Fetch(request).then( |
| + function(response) { |
| + scope.set(request, response).then(resolve); |
| + }, |
| + reject); |
| }); |
| }; |