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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js

Issue 2109813003: [DevTools] No NetworkManager and NetworkLog for v8only mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass NetworkManager as a ctor parameter, to ensure proper initialization order. Created 4 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
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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 * @override 204 * @override
205 * @param {!WebInspector.Target} target 205 * @param {!WebInspector.Target} target
206 */ 206 */
207 targetAdded: function(target) 207 targetAdded: function(target)
208 { 208 {
209 if (!target.parentTarget()) { 209 if (!target.parentTarget()) {
210 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeM odel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this); 210 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeM odel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
211 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeM odel.EventTypes.Load, this._loadEventFired, this); 211 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeM odel.EventTypes.Load, this._loadEventFired, this);
212 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeM odel.EventTypes.DOMContentLoaded, this._domContentLoadedEventFired, this); 212 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeM odel.EventTypes.DOMContentLoaded, this._domContentLoadedEventFired, this);
213 } 213 }
214 target.networkLog.requests().forEach(this._appendRequest.bind(this)); 214 WebInspector.NetworkLog.fromTarget(target).requests().forEach(this._appe ndRequest.bind(this));
dgozman 2016/06/29 18:37:57 What if there is no network log for this target?
eostroukhov-old 2016/06/29 22:54:20 My thinking was to let exception be thrown... I ch
215 }, 215 },
216 216
217 /** 217 /**
218 * @override 218 * @override
219 * @param {!WebInspector.Target} target 219 * @param {!WebInspector.Target} target
220 */ 220 */
221 targetRemoved: function(target) 221 targetRemoved: function(target)
222 { 222 {
223 if (!target.parentTarget()) { 223 if (!target.parentTarget()) {
224 target.resourceTreeModel.removeEventListener(WebInspector.ResourceTr eeModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this); 224 target.resourceTreeModel.removeEventListener(WebInspector.ResourceTr eeModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 _mainFrameNavigated: function(event) 1159 _mainFrameNavigated: function(event)
1160 { 1160 {
1161 if (!this._recording) 1161 if (!this._recording)
1162 return; 1162 return;
1163 1163
1164 var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data); 1164 var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data);
1165 var loaderId = frame.loaderId; 1165 var loaderId = frame.loaderId;
1166 1166
1167 // Pick provisional load requests. 1167 // Pick provisional load requests.
1168 var requestsToPick = []; 1168 var requestsToPick = [];
1169 var requests = frame.target().networkLog.requests(); 1169 var requests = WebInspector.NetworkLog.fromTarget(frame.target()).reques ts();
1170 for (var i = 0; i < requests.length; ++i) { 1170 for (var i = 0; i < requests.length; ++i) {
1171 var request = requests[i]; 1171 var request = requests[i];
1172 if (request.loaderId === loaderId) 1172 if (request.loaderId === loaderId)
1173 requestsToPick.push(request); 1173 requestsToPick.push(request);
1174 } 1174 }
1175 1175
1176 if (!this._preserveLog) { 1176 if (!this._preserveLog) {
1177 this.reset(); 1177 this.reset();
1178 for (var i = 0; i < requestsToPick.length; ++i) 1178 for (var i = 0; i < requestsToPick.length; ++i)
1179 this._appendRequest(requestsToPick[i]); 1179 this._appendRequest(requestsToPick[i]);
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
2190 return false; 2190 return false;
2191 return true; 2191 return true;
2192 } 2192 }
2193 2193
2194 WebInspector.NetworkLogView.EventTypes = { 2194 WebInspector.NetworkLogView.EventTypes = {
2195 RequestSelected: "RequestSelected", 2195 RequestSelected: "RequestSelected",
2196 SearchCountUpdated: "SearchCountUpdated", 2196 SearchCountUpdated: "SearchCountUpdated",
2197 SearchIndexUpdated: "SearchIndexUpdated", 2197 SearchIndexUpdated: "SearchIndexUpdated",
2198 UpdateRequest: "UpdateRequest" 2198 UpdateRequest: "UpdateRequest"
2199 }; 2199 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698