| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 return true; | 502 return true; |
| 503 } | 503 } |
| 504 | 504 |
| 505 /** | 505 /** |
| 506 * @return {boolean} | 506 * @return {boolean} |
| 507 */ | 507 */ |
| 508 _shouldBeRemoved() { | 508 _shouldBeRemoved() { |
| 509 return this._isRedundant() && (!this.errors.length || this._deleting); | 509 return this._isRedundant() && (!this.errors.length || this._deleting); |
| 510 } | 510 } |
| 511 | 511 |
| 512 /** |
| 513 * @return {boolean} |
| 514 */ |
| 515 canBeRemoved() { |
| 516 return this.isDeleted || this._deleting; |
| 517 } |
| 518 |
| 519 |
| 512 clearErrors() { | 520 clearErrors() { |
| 513 this._fingerprint = Symbol('fingerprint'); | 521 this._fingerprint = Symbol('fingerprint'); |
| 514 this.errors = []; | 522 this.errors = []; |
| 515 } | 523 } |
| 516 }; | 524 }; |
| 517 | 525 |
| 518 /** | 526 /** |
| 519 * @unrestricted | 527 * @unrestricted |
| 520 */ | 528 */ |
| 521 SDK.ServiceWorkerContextNamer = class { | 529 SDK.ServiceWorkerContextNamer = class { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 */ | 604 */ |
| 597 _updateContextLabel(context, version) { | 605 _updateContextLabel(context, version) { |
| 598 var parsedUrl = context.origin.asParsedURL(); | 606 var parsedUrl = context.origin.asParsedURL(); |
| 599 var label = parsedUrl ? parsedUrl.lastPathComponentWithFragment() : context.
name; | 607 var label = parsedUrl ? parsedUrl.lastPathComponentWithFragment() : context.
name; |
| 600 if (version) | 608 if (version) |
| 601 context.setLabel(label + ' #' + version.id + ' (' + version.status + ')'); | 609 context.setLabel(label + ' #' + version.id + ' (' + version.status + ')'); |
| 602 else | 610 else |
| 603 context.setLabel(label); | 611 context.setLabel(label); |
| 604 } | 612 } |
| 605 }; | 613 }; |
| OLD | NEW |