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 26 matching lines...) Expand all Loading... | |
| 37 */ | 37 */ |
| 38 WebInspector.StylesSourceMapping = function(cssModel, workspace, networkMapping) | 38 WebInspector.StylesSourceMapping = function(cssModel, workspace, networkMapping) |
| 39 { | 39 { |
| 40 this._cssModel = cssModel; | 40 this._cssModel = cssModel; |
| 41 this._workspace = workspace; | 41 this._workspace = workspace; |
| 42 this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemove d, this._projectRemoved, this); | 42 this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemove d, this._projectRemoved, this); |
| 43 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeA dded, this._uiSourceCodeAddedToWorkspace, this); | 43 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeA dded, this._uiSourceCodeAddedToWorkspace, this); |
| 44 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeR emoved, this._uiSourceCodeRemoved, this); | 44 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeR emoved, this._uiSourceCodeRemoved, this); |
| 45 this._networkMapping = networkMapping; | 45 this._networkMapping = networkMapping; |
| 46 | 46 |
| 47 cssModel.target().resourceTreeModel.addEventListener(WebInspector.ResourceTr eeModel.EventTypes.MainFrameNavigated, this._unbindAllUISourceCodes, this); | 47 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(cssModel.t arget()); |
| 48 if (resourceTreeModel) | |
|
pfeldman
2016/07/07 17:44:14
We always have resourceTreeModel when we have CSS.
eostroukhov-old
2016/07/13 23:30:58
I added an accessor to get it through the cssModel
| |
| 49 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventT ypes.MainFrameNavigated, this._unbindAllUISourceCodes, this); | |
| 48 | 50 |
| 49 this._cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetChang ed, this._styleSheetChanged, this); | 51 this._cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetChang ed, this._styleSheetChanged, this); |
| 50 /** @type {!Map<string, !Map<string, !Map<string, !WebInspector.CSSStyleShee tHeader>>>} */ | 52 /** @type {!Map<string, !Map<string, !Map<string, !WebInspector.CSSStyleShee tHeader>>>} */ |
| 51 this._urlToHeadersByFrameId = new Map(); | 53 this._urlToHeadersByFrameId = new Map(); |
| 52 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.StyleFile>} */ | 54 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.StyleFile>} */ |
| 53 this._styleFiles = new Map(); | 55 this._styleFiles = new Map(); |
| 54 } | 56 } |
| 55 | 57 |
| 56 WebInspector.StylesSourceMapping.ChangeUpdateTimeoutMs = 200; | 58 WebInspector.StylesSourceMapping.ChangeUpdateTimeoutMs = 200; |
| 57 | 59 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 }, | 398 }, |
| 397 | 399 |
| 398 dispose: function() | 400 dispose: function() |
| 399 { | 401 { |
| 400 if (this._terminated) | 402 if (this._terminated) |
| 401 return; | 403 return; |
| 402 this._terminated = true; | 404 this._terminated = true; |
| 403 WebInspector.EventTarget.removeEventListeners(this._eventListeners); | 405 WebInspector.EventTarget.removeEventListeners(this._eventListeners); |
| 404 } | 406 } |
| 405 } | 407 } |
| OLD | NEW |