OLD | NEW |
---|---|
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 26 matching lines...) Expand all Loading... | |
37 { | 37 { |
38 WebInspector.SDKObject.call(this, target); | 38 WebInspector.SDKObject.call(this, target); |
39 target.registerServiceWorkerDispatcher(new WebInspector.ServiceWorkerDispatc her(this)); | 39 target.registerServiceWorkerDispatcher(new WebInspector.ServiceWorkerDispatc her(this)); |
40 this._lastAnonymousTargetId = 0; | 40 this._lastAnonymousTargetId = 0; |
41 /** @type {!Map.<string, !WebInspector.ServiceWorker>} */ | 41 /** @type {!Map.<string, !WebInspector.ServiceWorker>} */ |
42 this._workers = new Map(); | 42 this._workers = new Map(); |
43 /** @type {!Map.<string, !ServiceWorkerAgent.ServiceWorkerRegistration>} */ | 43 /** @type {!Map.<string, !ServiceWorkerAgent.ServiceWorkerRegistration>} */ |
44 this._registrations = new Map(); | 44 this._registrations = new Map(); |
45 /** @type {!Map.<string, !Map.<string, !ServiceWorkerAgent.ServiceWorkerVers ion>>} */ | 45 /** @type {!Map.<string, !Map.<string, !ServiceWorkerAgent.ServiceWorkerVers ion>>} */ |
46 this._versions = new Map(); | 46 this._versions = new Map(); |
47 this.enable(); | 47 this.enable(); |
pfeldman
2015/03/23 12:03:14
this._agent = target.serviceWorkerAgent(); and use
horo
2015/03/23 12:24:27
Done.
| |
48 } | 48 } |
49 | 49 |
50 WebInspector.ServiceWorkerManager.Events = { | 50 WebInspector.ServiceWorkerManager.Events = { |
51 WorkersUpdated: "WorkersUpdated", | 51 WorkersUpdated: "WorkersUpdated", |
52 RegistrationUpdated: "RegistrationUpdated", | 52 RegistrationUpdated: "RegistrationUpdated", |
53 RegistrationDeleted: "RegistrationDeleted", | 53 RegistrationDeleted: "RegistrationDeleted", |
54 VersionUpdated: "VersionUpdated", | 54 VersionUpdated: "VersionUpdated", |
55 VersionDeleted: "VersionDeleted" | 55 VersionDeleted: "VersionDeleted" |
56 } | 56 } |
57 | 57 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 | 107 |
108 /** | 108 /** |
109 * @return {!Map.<string, !Map.<string, !ServiceWorkerAgent.ServiceWorkerVer sion>>} | 109 * @return {!Map.<string, !Map.<string, !ServiceWorkerAgent.ServiceWorkerVer sion>>} |
110 */ | 110 */ |
111 versions: function() | 111 versions: function() |
112 { | 112 { |
113 return this._versions; | 113 return this._versions; |
114 }, | 114 }, |
115 | 115 |
116 /** | 116 /** |
117 * @param {string} scope | |
118 */ | |
119 unregister: function(scope) | |
120 { | |
121 this.target().serviceWorkerAgent().unregister(scope); | |
122 }, | |
123 | |
124 /** | |
125 * @param {string} scope | |
126 */ | |
127 startWorker: function(scope) | |
128 { | |
129 this.target().serviceWorkerAgent().startWorker(scope); | |
130 }, | |
131 | |
132 /** | |
133 * @param {string} versionId | |
134 */ | |
135 stopWorker: function(versionId) | |
136 { | |
137 this.target().serviceWorkerAgent().stopWorker(versionId); | |
138 }, | |
139 | |
140 /** | |
141 * @param {string} versionId | |
142 */ | |
143 inspectWorker: function(versionId) | |
144 { | |
145 this.target().serviceWorkerAgent().inspectWorker(versionId); | |
146 }, | |
147 | |
148 /** | |
117 * @param {string} workerId | 149 * @param {string} workerId |
118 * @param {string} url | 150 * @param {string} url |
119 */ | 151 */ |
120 _workerCreated: function(workerId, url) | 152 _workerCreated: function(workerId, url) |
121 { | 153 { |
122 new WebInspector.ServiceWorker(this, workerId, url); | 154 new WebInspector.ServiceWorker(this, workerId, url); |
123 }, | 155 }, |
124 | 156 |
125 /** | 157 /** |
126 * @param {string} workerId | 158 * @param {string} workerId |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 this._agent.sendMessage(this._workerId, JSON.stringify(messageObject)); | 396 this._agent.sendMessage(this._workerId, JSON.stringify(messageObject)); |
365 }, | 397 }, |
366 | 398 |
367 _close: function() | 399 _close: function() |
368 { | 400 { |
369 this.connectionClosed("worker_terminated"); | 401 this.connectionClosed("worker_terminated"); |
370 }, | 402 }, |
371 | 403 |
372 __proto__: InspectorBackendClass.Connection.prototype | 404 __proto__: InspectorBackendClass.Connection.prototype |
373 } | 405 } |
OLD | NEW |