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

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

Issue 1828203005: Expose SPDY pushes in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed tests Created 4 years, 8 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 /** 330 /**
331 * @param {!Element} cell 331 * @param {!Element} cell
332 */ 332 */
333 _renderInitiatorCell: function(cell) 333 _renderInitiatorCell: function(cell)
334 { 334 {
335 this._initiatorCell = cell; 335 this._initiatorCell = cell;
336 var request = this._request; 336 var request = this._request;
337 var initiator = request.initiatorInfo(); 337 var initiator = request.initiatorInfo();
338 338
339 if (request.timing && request.timing.pushStart)
340 cell.appendChild(createTextNode(WebInspector.UIString("Push / ")));
339 switch (initiator.type) { 341 switch (initiator.type) {
340 case WebInspector.NetworkRequest.InitiatorType.Parser: 342 case WebInspector.NetworkRequest.InitiatorType.Parser:
341 cell.title = initiator.url + ":" + initiator.lineNumber; 343 cell.title = initiator.url + ":" + initiator.lineNumber;
342 var uiSourceCode = WebInspector.networkMapping.uiSourceCodeForURLFor AnyTarget(initiator.url); 344 var uiSourceCode = WebInspector.networkMapping.uiSourceCodeForURLFor AnyTarget(initiator.url);
343 cell.appendChild(WebInspector.linkifyResourceAsNode(initiator.url, i nitiator.lineNumber - 1, initiator.columnNumber - 1, undefined, undefined, uiSou rceCode ? uiSourceCode.displayName() : undefined)); 345 cell.appendChild(WebInspector.linkifyResourceAsNode(initiator.url, i nitiator.lineNumber - 1, initiator.columnNumber - 1, undefined, undefined, uiSou rceCode ? uiSourceCode.displayName() : undefined));
344 this._appendSubtitle(cell, WebInspector.UIString("Parser")); 346 this._appendSubtitle(cell, WebInspector.UIString("Parser"));
345 break; 347 break;
346 348
347 case WebInspector.NetworkRequest.InitiatorType.Redirect: 349 case WebInspector.NetworkRequest.InitiatorType.Redirect:
348 cell.title = initiator.url; 350 cell.title = initiator.url;
349 console.assert(request.redirectSource); 351 console.assert(request.redirectSource);
350 var redirectSource = /** @type {!WebInspector.NetworkRequest} */ (re quest.redirectSource); 352 var redirectSource = /** @type {!WebInspector.NetworkRequest} */ (re quest.redirectSource);
351 cell.appendChild(WebInspector.linkifyRequestAsNode(redirectSource)); 353 cell.appendChild(WebInspector.linkifyRequestAsNode(redirectSource));
352 this._appendSubtitle(cell, WebInspector.UIString("Redirect")); 354 this._appendSubtitle(cell, WebInspector.UIString("Redirect"));
353 break; 355 break;
354 356
355 case WebInspector.NetworkRequest.InitiatorType.Script: 357 case WebInspector.NetworkRequest.InitiatorType.Script:
356 if (!this._linkifiedInitiatorAnchor) { 358 if (!this._linkifiedInitiatorAnchor) {
357 this._linkifiedInitiatorAnchor = this._parentView.linkifier.link ifyScriptLocation(request.target(), initiator.scriptId, initiator.url, initiator .lineNumber - 1, initiator.columnNumber - 1); 359 this._linkifiedInitiatorAnchor = this._parentView.linkifier.link ifyScriptLocation(request.target(), initiator.scriptId, initiator.url, initiator .lineNumber - 1, initiator.columnNumber - 1);
358 this._linkifiedInitiatorAnchor.title = ""; 360 this._linkifiedInitiatorAnchor.title = "";
359 } 361 }
360 cell.appendChild(this._linkifiedInitiatorAnchor); 362 cell.appendChild(this._linkifiedInitiatorAnchor);
361 this._appendSubtitle(cell, WebInspector.UIString("Script")); 363 this._appendSubtitle(cell, WebInspector.UIString("Script"));
362 cell.classList.add("network-script-initiated"); 364 cell.classList.add("network-script-initiated");
363 cell.request = request; 365 cell.request = request;
364 break; 366 break;
365 367
366 default: 368 default:
367 cell.title = ""; 369 cell.title = WebInspector.UIString("Other");
368 cell.classList.add("network-dim-cell"); 370 cell.classList.add("network-dim-cell");
369 cell.setTextAndTitle(WebInspector.UIString("Other")); 371 cell.appendChild(createTextNode(WebInspector.UIString("Other")));
370 } 372 }
371 }, 373 },
372 374
373 /** 375 /**
374 * @param {!Element} cell 376 * @param {!Element} cell
375 */ 377 */
376 _renderSizeCell: function(cell) 378 _renderSizeCell: function(cell)
377 { 379 {
378 if (this._request.fetchedViaServiceWorker) { 380 if (this._request.fetchedViaServiceWorker) {
379 cell.setTextAndTitle(WebInspector.UIString("(from ServiceWorker)")); 381 cell.setTextAndTitle(WebInspector.UIString("(from ServiceWorker)"));
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 if (!this._timelineCell) 422 if (!this._timelineCell)
421 return; 423 return;
422 this._staleGraph = true; 424 this._staleGraph = true;
423 if (this.attached()) 425 if (this.attached())
424 this.dataGrid.scheduleUpdate(); 426 this.dataGrid.scheduleUpdate();
425 }, 427 },
426 428
427 _updateTimingGraph: function() 429 _updateTimingGraph: function()
428 { 430 {
429 var calculator = this._parentView.calculator(); 431 var calculator = this._parentView.calculator();
430 var timeRanges = WebInspector.RequestTimingView.calculateRequestTimeRang es(this._request); 432 var timeRanges = WebInspector.RequestTimingView.calculateRequestTimeRang es(this._request, calculator.minimumBoundary());
431 var right = timeRanges[0].end; 433 var right = timeRanges[0].end;
432 434
433 var container = this._barAreaElement; 435 var container = this._barAreaElement;
434 var nextBar = container.firstChild; 436 var nextBar = container.firstChild;
435 for (var i = 0; i < timeRanges.length; ++i) { 437 for (var i = 0; i < timeRanges.length; ++i) {
436 var range = timeRanges[i]; 438 var range = timeRanges[i];
437 var start = calculator.computePercentageFromEventTime(range.start); 439 var start = calculator.computePercentageFromEventTime(range.start);
438 var end = (range.end !== Number.MAX_VALUE) ? calculator.computePerce ntageFromEventTime(range.end) : 100; 440 var end = (range.end !== Number.MAX_VALUE) ? calculator.computePerce ntageFromEventTime(range.end) : 100;
439 if (!nextBar) 441 if (!nextBar)
440 nextBar = container.createChild("div"); 442 nextBar = container.createChild("div");
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 WebInspector.NetworkDataGridNode.ResponseHeaderDateComparator = function(propert yName, a, b) 760 WebInspector.NetworkDataGridNode.ResponseHeaderDateComparator = function(propert yName, a, b)
759 { 761 {
760 var aHeader = a._request.responseHeaderValue(propertyName); 762 var aHeader = a._request.responseHeaderValue(propertyName);
761 var bHeader = b._request.responseHeaderValue(propertyName); 763 var bHeader = b._request.responseHeaderValue(propertyName);
762 var aValue = aHeader ? new Date(aHeader).getTime() : -Infinity; 764 var aValue = aHeader ? new Date(aHeader).getTime() : -Infinity;
763 var bValue = bHeader ? new Date(bHeader).getTime() : -Infinity; 765 var bValue = bHeader ? new Date(bHeader).getTime() : -Infinity;
764 if (aValue == bValue) 766 if (aValue == bValue)
765 return a._request.indentityCompare(b._request); 767 return a._request.indentityCompare(b._request);
766 return aValue > bValue ? 1 : -1; 768 return aValue > bValue ? 1 : -1;
767 } 769 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698