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

Side by Side Diff: LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/unregister-worker.js

Issue 900793002: ServiceWorker: Support SWRegistration.unregister() in SWGlobalScope [2/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: return nullptr instead of 0 Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 function matchQuery(query) {
2 return self.location.href.indexOf(query) != -1;
3 }
4
5 if (matchQuery('?evaluation'))
6 self.registration.unregister();
7
8 self.addEventListener('install', function(e) {
9 if (matchQuery('?install'))
10 self.registration.unregister();
11 });
12
13 self.addEventListener('activate', function(e) {
14 if (matchQuery('?activate'))
15 self.registration.unregister();
16 });
17
18 self.addEventListener('message', function(e) {
19 self.registration.unregister()
20 .then(function(result) {
21 e.data.port.postMessage({result: result});
22 });
23 });
24
25 self.addEventListener('fetch', function(e) {
26 if (e.request.url.indexOf('?request') != -1)
27 e.respondWith(new Response('Intercepted by service worker'));
28 });
falken 2015/02/05 12:07:57 I think we shouldn't need this fetch event handler
nhiroki 2015/02/06 03:49:29 Removed!
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698