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

Side by Side Diff: Source/devtools/front_end/sdk/ServiceWorkerManager.js

Issue 1079013002: Add "emulate push event" button to ServiceWorkersView in DevTools [2/2 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: s/dispatchPushEvent/deliverPushMessage/ Created 5 years, 8 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
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 this._registrations.delete(registrationId); 130 this._registrations.delete(registrationId);
131 this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Even ts.RegistrationDeleted, registration); 131 this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Even ts.RegistrationDeleted, registration);
132 return; 132 return;
133 } 133 }
134 registration._deleting = true; 134 registration._deleting = true;
135 for (var version of registration.versions.values()) 135 for (var version of registration.versions.values())
136 this.stopWorker(version.id); 136 this.stopWorker(version.id);
137 this._unregister(registration.scopeURL); 137 this._unregister(registration.scopeURL);
138 }, 138 },
139 139
140 /**
141 * @param {string} registrationId
142 * @param {string} data
143 */
144 deliverPushMessage: function(registrationId, data)
145 {
146 var registration = this._registrations.get(registrationId);
147 if (!registration)
148 return;
149 var origin = WebInspector.ParsedURL.splitURLIntoPathComponents(registra tion.scopeURL)[0];
150 this._agent.deliverPushMessage(origin, registrationId, data);
151 },
152
140 /** 153 /**
141 * @param {string} scope 154 * @param {string} scope
142 */ 155 */
143 _unregister: function(scope) 156 _unregister: function(scope)
144 { 157 {
145 this._agent.unregister(scope); 158 this._agent.unregister(scope);
146 }, 159 },
147 160
148 /** 161 /**
149 * @param {string} scope 162 * @param {string} scope
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 }, 699 },
687 700
688 /** 701 /**
689 * @return {boolean} 702 * @return {boolean}
690 */ 703 */
691 _shouldBeRemoved: function() 704 _shouldBeRemoved: function()
692 { 705 {
693 return this._isRedundant() && (!this._hasErrorLog() || this._deleting); 706 return this._isRedundant() && (!this._hasErrorLog() || this._deleting);
694 } 707 }
695 } 708 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/resources/serviceWorkersView.css ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698