| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 /** | 4 /** |
| 5 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 Security.SecurityModel = class extends SDK.SDKModel { | 7 Security.SecurityModel = class extends SDK.SDKModel { |
| 8 /** | 8 /** |
| 9 * @param {!SDK.Target} target | 9 * @param {!SDK.Target} target |
| 10 */ | 10 */ |
| 11 constructor(target) { | 11 constructor(target) { |
| 12 super(target); | 12 super(target); |
| 13 this._dispatcher = new Security.SecurityDispatcher(this); | 13 this._dispatcher = new Security.SecurityDispatcher(this); |
| 14 this._securityAgent = target.securityAgent(); | 14 this._securityAgent = target.securityAgent(); |
| 15 target.registerSecurityDispatcher(this._dispatcher); | 15 target.registerSecurityDispatcher(this._dispatcher); |
| 16 this._securityAgent.enable(); | 16 this._securityAgent.enable(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * @param {!SDK.Target} target | |
| 21 * @return {?Security.SecurityModel} | |
| 22 */ | |
| 23 static fromTarget(target) { | |
| 24 return target.model(Security.SecurityModel); | |
| 25 } | |
| 26 | |
| 27 /** | |
| 28 * @param {!Protocol.Security.SecurityState} a | 20 * @param {!Protocol.Security.SecurityState} a |
| 29 * @param {!Protocol.Security.SecurityState} b | 21 * @param {!Protocol.Security.SecurityState} b |
| 30 * @return {number} | 22 * @return {number} |
| 31 */ | 23 */ |
| 32 static SecurityStateComparator(a, b) { | 24 static SecurityStateComparator(a, b) { |
| 33 var securityStateMap; | 25 var securityStateMap; |
| 34 if (Security.SecurityModel._symbolicToNumericSecurityState) { | 26 if (Security.SecurityModel._symbolicToNumericSecurityState) { |
| 35 securityStateMap = Security.SecurityModel._symbolicToNumericSecurityState; | 27 securityStateMap = Security.SecurityModel._symbolicToNumericSecurityState; |
| 36 } else { | 28 } else { |
| 37 securityStateMap = new Map(); | 29 securityStateMap = new Map(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 104 |
| 113 /** | 105 /** |
| 114 * @override | 106 * @override |
| 115 * @param {number} eventId | 107 * @param {number} eventId |
| 116 * @param {string} errorType | 108 * @param {string} errorType |
| 117 * @param {string} requestURL | 109 * @param {string} requestURL |
| 118 */ | 110 */ |
| 119 certificateError(eventId, errorType, requestURL) { | 111 certificateError(eventId, errorType, requestURL) { |
| 120 } | 112 } |
| 121 }; | 113 }; |
| OLD | NEW |