Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 DatabaseLoaded: "DatabaseLoaded" | 149 DatabaseLoaded: "DatabaseLoaded" |
| 150 } | 150 } |
| 151 | 151 |
| 152 WebInspector.IndexedDBModel.prototype = { | 152 WebInspector.IndexedDBModel.prototype = { |
| 153 enable: function() | 153 enable: function() |
| 154 { | 154 { |
| 155 if (this._enabled) | 155 if (this._enabled) |
| 156 return; | 156 return; |
| 157 | 157 |
| 158 this._agent.enable(); | 158 this._agent.enable(); |
| 159 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(this.t arget()); | |
| 159 | 160 |
| 160 this.target().resourceTreeModel.addEventListener(WebInspector.ResourceTr eeModel.EventTypes.SecurityOriginAdded, this._securityOriginAdded, this); | 161 if (resourceTreeModel) { |
|
dgozman
2016/07/14 16:29:28
ditto
eostroukhov-old
2016/07/20 23:46:15
Done.
| |
| 161 this.target().resourceTreeModel.addEventListener(WebInspector.ResourceTr eeModel.EventTypes.SecurityOriginRemoved, this._securityOriginRemoved, this); | 162 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Ev entTypes.SecurityOriginAdded, this._securityOriginAdded, this); |
| 163 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Ev entTypes.SecurityOriginRemoved, this._securityOriginRemoved, this); | |
| 162 | 164 |
| 163 var securityOrigins = this.target().resourceTreeModel.securityOrigins(); | 165 var securityOrigins = resourceTreeModel.securityOrigins(); |
| 164 for (var i = 0; i < securityOrigins.length; ++i) | 166 for (var i = 0; i < securityOrigins.length; ++i) |
| 165 this._addOrigin(securityOrigins[i]); | 167 this._addOrigin(securityOrigins[i]); |
| 168 } | |
| 166 | 169 |
| 167 this._enabled = true; | 170 this._enabled = true; |
| 168 }, | 171 }, |
| 169 | 172 |
| 170 /** | 173 /** |
| 171 * @param {string} origin | 174 * @param {string} origin |
| 172 */ | 175 */ |
| 173 clearForOrigin: function(origin) | 176 clearForOrigin: function(origin) |
| 174 { | 177 { |
| 175 if (!this._enabled) | 178 if (!this._enabled) |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 * @param {!WebInspector.Target} target | 536 * @param {!WebInspector.Target} target |
| 534 * @return {?WebInspector.IndexedDBModel} | 537 * @return {?WebInspector.IndexedDBModel} |
| 535 */ | 538 */ |
| 536 WebInspector.IndexedDBModel.fromTarget = function(target) | 539 WebInspector.IndexedDBModel.fromTarget = function(target) |
| 537 { | 540 { |
| 538 var model = /** @type {?WebInspector.IndexedDBModel} */ (target.model(WebIns pector.IndexedDBModel)); | 541 var model = /** @type {?WebInspector.IndexedDBModel} */ (target.model(WebIns pector.IndexedDBModel)); |
| 539 if (!model) | 542 if (!model) |
| 540 model = new WebInspector.IndexedDBModel(target); | 543 model = new WebInspector.IndexedDBModel(target); |
| 541 return model; | 544 return model; |
| 542 } | 545 } |
| OLD | NEW |