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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 this._agent = manager.target().serviceWorkerAgent(); | 429 this._agent = manager.target().serviceWorkerAgent(); |
430 this._workerId = workerId; | 430 this._workerId = workerId; |
431 this._connection = new WebInspector.ServiceWorkerConnection(this._agent, wor
kerId); | 431 this._connection = new WebInspector.ServiceWorkerConnection(this._agent, wor
kerId); |
432 this._url = url; | 432 this._url = url; |
433 this._versionId = versionId; | 433 this._versionId = versionId; |
434 var parsedURL = url.asParsedURL(); | 434 var parsedURL = url.asParsedURL(); |
435 this._name = parsedURL ? parsedURL.lastPathComponentWithFragment() : "#" +
(++WebInspector.ServiceWorker._lastAnonymousTargetId); | 435 this._name = parsedURL ? parsedURL.lastPathComponentWithFragment() : "#" +
(++WebInspector.ServiceWorker._lastAnonymousTargetId); |
436 this._scope = parsedURL ? parsedURL.host + parsedURL.folderPathComponents :
""; | 436 this._scope = parsedURL ? parsedURL.host + parsedURL.folderPathComponents :
""; |
437 | 437 |
438 this._manager._workers.set(workerId, this); | 438 this._manager._workers.set(workerId, this); |
439 var capabilities = WebInspector.Target.Capability.Network | WebInspector.Tar
get.Capability.Worker; | 439 this._target = WebInspector.targetManager.createTarget(this._name, WebInspec
tor.Target.SERVICE_WORKER_CAPABILITIES, this._connection, manager.target()); |
440 this._target = WebInspector.targetManager.createTarget(this._name, capabilit
ies, this._connection, manager.target()); | |
441 this._target[WebInspector.ServiceWorker.Symbol] = this; | 440 this._target[WebInspector.ServiceWorker.Symbol] = this; |
442 this._manager.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Eve
nts.WorkersUpdated); | 441 this._manager.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Eve
nts.WorkersUpdated); |
443 this._target.runtimeAgent().runIfWaitingForDebugger(); | 442 this._target.runtimeAgent().runIfWaitingForDebugger(); |
444 } | 443 } |
445 | 444 |
446 WebInspector.ServiceWorker.Symbol = Symbol("serviceWorker"); | 445 WebInspector.ServiceWorker.Symbol = Symbol("serviceWorker"); |
447 | 446 |
448 WebInspector.ServiceWorker._lastAnonymousTargetId = 0; | 447 WebInspector.ServiceWorker._lastAnonymousTargetId = 0; |
449 | 448 |
450 WebInspector.ServiceWorker.prototype = { | 449 WebInspector.ServiceWorker.prototype = { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 { | 886 { |
888 return this._isRedundant() && (!this.errors.length || this._deleting); | 887 return this._isRedundant() && (!this.errors.length || this._deleting); |
889 }, | 888 }, |
890 | 889 |
891 clearErrors: function() | 890 clearErrors: function() |
892 { | 891 { |
893 this._fingerprint = Symbol("fingerprint"); | 892 this._fingerprint = Symbol("fingerprint"); |
894 this.errors = []; | 893 this.errors = []; |
895 } | 894 } |
896 } | 895 } |
OLD | NEW |