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

Unified Diff: Source/modules/serviceworkers/polyfills/cachePolyfill.js

Issue 311343003: ServiceWorker polyfill Fetch implementation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: clean up and add FIXMEs Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
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);
});
};

Powered by Google App Engine
This is Rietveld 408576698