Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: Source/devtools/front_end/network/NetworkPanel.js

Issue 400633003: DevTools: introduce multitarget model listeners (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 this._createStatusbarButtons(); 75 this._createStatusbarButtons();
76 this._createStatusBarItems(); 76 this._createStatusBarItems();
77 this._linkifier = new WebInspector.Linkifier(); 77 this._linkifier = new WebInspector.Linkifier();
78 78
79 this._addFilters(); 79 this._addFilters();
80 this._resetSuggestionBuilder(); 80 this._resetSuggestionBuilder();
81 this._initializeView(); 81 this._initializeView();
82 this._recordButton.toggled = true; 82 this._recordButton.toggled = true;
83 83
84 WebInspector.targetManager.observeTargets(this); 84 WebInspector.targetManager.observeTargets(this);
85 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this );
86 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this );
87 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, thi s);
88
89 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.WillReloadPage, this._willReloadPage, this);
90 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNav igated, this);
91 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.Load, this._loadEventFired, this);
92 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.DOMContentLoaded, this._domContentLoad edEventFired, this);
85 } 93 }
86 94
87 WebInspector.NetworkLogView.HTTPSchemas = {"http": true, "https": true, "ws": tr ue, "wss": true}; 95 WebInspector.NetworkLogView.HTTPSchemas = {"http": true, "https": true, "ws": tr ue, "wss": true};
88 WebInspector.NetworkLogView._responseHeaderColumns = ["Cache-Control", "Connecti on", "Content-Encoding", "Content-Length", "ETag", "Keep-Alive", "Last-Modified" , "Server", "Vary"]; 96 WebInspector.NetworkLogView._responseHeaderColumns = ["Cache-Control", "Connecti on", "Content-Encoding", "Content-Length", "ETag", "Keep-Alive", "Last-Modified" , "Server", "Vary"];
89 WebInspector.NetworkLogView._defaultColumnsVisibility = { 97 WebInspector.NetworkLogView._defaultColumnsVisibility = {
90 method: true, status: true, scheme: false, domain: false, remoteAddress: fal se, type: true, initiator: true, cookies: false, setCookies: false, size: true, time: true, 98 method: true, status: true, scheme: false, domain: false, remoteAddress: fal se, type: true, initiator: true, cookies: false, setCookies: false, size: true, time: true,
91 "Cache-Control": false, "Connection": false, "Content-Encoding": false, "Con tent-Length": false, "ETag": false, "Keep-Alive": false, "Last-Modified": false, "Server": false, "Vary": false 99 "Cache-Control": false, "Connection": false, "Content-Encoding": false, "Con tent-Length": false, "ETag": false, "Keep-Alive": false, "Last-Modified": false, "Server": false, "Vary": false
92 }; 100 };
93 WebInspector.NetworkLogView._defaultRefreshDelay = 500; 101 WebInspector.NetworkLogView._defaultRefreshDelay = 500;
94 102
(...skipping 24 matching lines...) Expand all
119 "Server": WebInspector.UIString("Server"), 127 "Server": WebInspector.UIString("Server"),
120 "Vary": WebInspector.UIString("Vary") 128 "Vary": WebInspector.UIString("Vary")
121 }; 129 };
122 130
123 WebInspector.NetworkLogView.prototype = { 131 WebInspector.NetworkLogView.prototype = {
124 /** 132 /**
125 * @param {!WebInspector.Target} target 133 * @param {!WebInspector.Target} target
126 */ 134 */
127 targetAdded: function(target) 135 targetAdded: function(target)
128 { 136 {
129 target.networkManager.addEventListener(WebInspector.NetworkManager.Event Types.RequestStarted, this._onRequestStarted, this);
130 target.networkManager.addEventListener(WebInspector.NetworkManager.Event Types.RequestUpdated, this._onRequestUpdated, this);
131 target.networkManager.addEventListener(WebInspector.NetworkManager.Event Types.RequestFinished, this._onRequestUpdated, this);
132
133 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel .EventTypes.WillReloadPage, this._willReloadPage, this);
134 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel .EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
135 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel .EventTypes.Load, this._loadEventFired, this);
136 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel .EventTypes.DOMContentLoaded, this._domContentLoadedEventFired, this);
137
138 target.networkLog.requests.forEach(this._appendRequest.bind(this)); 137 target.networkLog.requests.forEach(this._appendRequest.bind(this));
139 }, 138 },
140 139
141 /** 140 /**
142 * @param {!WebInspector.Target} target 141 * @param {!WebInspector.Target} target
143 */ 142 */
144 targetRemoved: function(target) 143 targetRemoved: function(target)
145 { 144 {
146 target.networkManager.removeEventListener(WebInspector.NetworkManager.Ev entTypes.RequestStarted, this._onRequestStarted, this);
147 target.networkManager.removeEventListener(WebInspector.NetworkManager.Ev entTypes.RequestUpdated, this._onRequestUpdated, this);
148 target.networkManager.removeEventListener(WebInspector.NetworkManager.Ev entTypes.RequestFinished, this._onRequestUpdated, this);
149
150 target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeMo del.EventTypes.WillReloadPage, this._willReloadPage, this);
151 target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeMo del.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
152 target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeMo del.EventTypes.Load, this._loadEventFired, this);
153 target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeMo del.EventTypes.DOMContentLoaded, this._domContentLoadedEventFired, this);
154 }, 145 },
155 146
156 _addFilters: function() 147 _addFilters: function()
157 { 148 {
158 this._textFilterUI = new WebInspector.TextFilterUI(); 149 this._textFilterUI = new WebInspector.TextFilterUI();
159 this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterC hanged, this._filterChanged, this); 150 this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterC hanged, this._filterChanged, this);
160 this._filterBar.addFilter(this._textFilterUI); 151 this._filterBar.addFilter(this._textFilterUI);
161 152
162 var types = []; 153 var types = [];
163 for (var typeId in WebInspector.resourceTypes) { 154 for (var typeId in WebInspector.resourceTypes) {
(...skipping 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after
3026 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b) 3017 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b)
3027 { 3018 {
3028 var aValue = a._request[propertyName]; 3019 var aValue = a._request[propertyName];
3029 var bValue = b._request[propertyName]; 3020 var bValue = b._request[propertyName];
3030 if (aValue > bValue) 3021 if (aValue > bValue)
3031 return revert ? -1 : 1; 3022 return revert ? -1 : 1;
3032 if (bValue > aValue) 3023 if (bValue > aValue)
3033 return revert ? 1 : -1; 3024 return revert ? 1 : -1;
3034 return a._request.indentityCompare(b._request); 3025 return a._request.indentityCompare(b._request);
3035 } 3026 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/profiler/CPUProfileView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698