{
if (this._recording) {
this.stopRecordingProfile();
- WebInspector.networkManager.enableResourceTracking();
return false;
} else {
- WebInspector.networkManager.disableResourceTracking();
this.startRecordingProfile();
return true;
}
}
WebInspector.NetworkManager.EventTypes = {
- ResourceTrackingEnabled: "ResourceTrackingEnabled",
- ResourceTrackingDisabled: "ResourceTrackingDisabled",
RequestStarted: "RequestStarted",
RequestUpdated: "RequestUpdated",
RequestFinished: "RequestFinished",
}
WebInspector.NetworkManager.prototype = {
- enableResourceTracking: function()
- {
- function callback(error)
- {
- this.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceTrackingEnabled);
- }
- NetworkAgent.enable(callback.bind(this));
- },
-
- disableResourceTracking: function()
- {
- function callback(error)
- {
- this.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceTrackingDisabled);
- }
- NetworkAgent.disable(callback.bind(this));
- },
-
/**
* @param {string} url
* @return {WebInspector.NetworkRequest}
*/
WebInspector.ResourceTreeModel = function(networkManager)
{
- networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceTrackingEnabled, this._onResourceTrackingEnabled, this);
networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this);
networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, this);
networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestUpdateDropped, this._onRequestUpdateDropped, this);
}
WebInspector.ResourceTreeModel.prototype = {
- _onResourceTrackingEnabled: function()
- {
- this._fetchResourceTree();
- },
-
_fetchResourceTree: function()
{
this._frames = {};