| 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 21 matching lines...) Expand all Loading... |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.Object} | 33 * @extends {WebInspector.Object} |
| 34 * @param {!WebInspector.Target} target | 34 * @param {!WebInspector.Target} target |
| 35 */ | 35 */ |
| 36 WebInspector.ResourceTreeModel = function(target) | 36 WebInspector.ResourceTreeModel = function(target) |
| 37 { | 37 { |
| 38 target.networkManager.addEventListener(WebInspector.NetworkManager.EventType
s.RequestFinished, this._onRequestFinished, this); | 38 target.networkManager.addEventListener(WebInspector.NetworkManager.EventType
s.RequestFinished, this._onRequestFinished, this); |
| 39 target.networkManager.addEventListener(WebInspector.NetworkManager.EventType
s.RequestUpdateDropped, this._onRequestUpdateDropped, this); | 39 target.networkManager.addEventListener(WebInspector.NetworkManager.EventType
s.RequestUpdateDropped, this._onRequestUpdateDropped, this); |
| 40 | 40 |
| 41 target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.Messag
eAdded, this._consoleMessageAdded, this); | 41 target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.Messag
eAdded, this._consoleMessageAdded, this); |
| 42 target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.Repeat
CountUpdated, this._consoleMessageAdded, this); | |
| 43 target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.Consol
eCleared, this._consoleCleared, this); | 42 target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.Consol
eCleared, this._consoleCleared, this); |
| 44 | 43 |
| 45 this._agent = target.pageAgent(); | 44 this._agent = target.pageAgent(); |
| 46 this._agent.enable(); | 45 this._agent.enable(); |
| 47 | 46 |
| 48 this._fetchResourceTree(); | 47 this._fetchResourceTree(); |
| 49 | 48 |
| 50 target.registerPageDispatcher(new WebInspector.PageDispatcher(this)); | 49 target.registerPageDispatcher(new WebInspector.PageDispatcher(this)); |
| 51 | 50 |
| 52 this._pendingConsoleMessages = {}; | 51 this._pendingConsoleMessages = {}; |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 }, | 389 }, |
| 391 | 390 |
| 392 /** | 391 /** |
| 393 * @param {!WebInspector.ConsoleMessage} msg | 392 * @param {!WebInspector.ConsoleMessage} msg |
| 394 * @param {!WebInspector.Resource} resource | 393 * @param {!WebInspector.Resource} resource |
| 395 */ | 394 */ |
| 396 _addConsoleMessageToResource: function(msg, resource) | 395 _addConsoleMessageToResource: function(msg, resource) |
| 397 { | 396 { |
| 398 switch (msg.level) { | 397 switch (msg.level) { |
| 399 case WebInspector.ConsoleMessage.MessageLevel.Warning: | 398 case WebInspector.ConsoleMessage.MessageLevel.Warning: |
| 400 resource.warnings += msg.repeatDelta; | 399 resource.warnings++; |
| 401 break; | 400 break; |
| 402 case WebInspector.ConsoleMessage.MessageLevel.Error: | 401 case WebInspector.ConsoleMessage.MessageLevel.Error: |
| 403 resource.errors += msg.repeatDelta; | 402 resource.errors++; |
| 404 break; | 403 break; |
| 405 } | 404 } |
| 406 resource.addMessage(msg); | 405 resource.addMessage(msg); |
| 407 }, | 406 }, |
| 408 | 407 |
| 409 _consoleCleared: function() | 408 _consoleCleared: function() |
| 410 { | 409 { |
| 411 function callback(resource) | 410 function callback(resource) |
| 412 { | 411 { |
| 413 resource.clearErrorsAndWarnings(); | 412 resource.clearErrorsAndWarnings(); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 screencastVisibilityChanged: function(visible) | 806 screencastVisibilityChanged: function(visible) |
| 808 { | 807 { |
| 809 this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTr
eeModel.EventTypes.ScreencastVisibilityChanged, {visible:visible}); | 808 this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTr
eeModel.EventTypes.ScreencastVisibilityChanged, {visible:visible}); |
| 810 } | 809 } |
| 811 } | 810 } |
| 812 | 811 |
| 813 /** | 812 /** |
| 814 * @type {!WebInspector.ResourceTreeModel} | 813 * @type {!WebInspector.ResourceTreeModel} |
| 815 */ | 814 */ |
| 816 WebInspector.resourceTreeModel; | 815 WebInspector.resourceTreeModel; |
| OLD | NEW |