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

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

Issue 2392123002: [Devtools] Use requestAnimationFrame instead of timer in network (Closed)
Patch Set: [Devtools] Use requestAnimationFrame instead of timer in network Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.Events.RequestStarted, this._onRequestStarted, this); 92 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.Events.RequestStarted, this._onRequestStarted, this);
93 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.Events.RequestUpdated, this._onRequestUpdated, this); 93 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.Events.RequestUpdated, this._onRequestUpdated, this);
94 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.Events.RequestFinished, this._onRequestUpdated, this); 94 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.Events.RequestFinished, this._onRequestUpdated, this);
95 } 95 }
96 96
97 WebInspector.NetworkLogView._isFilteredOutSymbol = Symbol("isFilteredOut"); 97 WebInspector.NetworkLogView._isFilteredOutSymbol = Symbol("isFilteredOut");
98 WebInspector.NetworkLogView._isMatchingSearchQuerySymbol = Symbol("isMatchingSea rchQuery"); 98 WebInspector.NetworkLogView._isMatchingSearchQuerySymbol = Symbol("isMatchingSea rchQuery");
99 99
100 WebInspector.NetworkLogView.HTTPSchemas = {"http": true, "https": true, "ws": tr ue, "wss": true}; 100 WebInspector.NetworkLogView.HTTPSchemas = {"http": true, "https": true, "ws": tr ue, "wss": true};
101 101
102 WebInspector.NetworkLogView._defaultRefreshDelay = 200;
103
104 WebInspector.NetworkLogView._waterfallMinOvertime = 1; 102 WebInspector.NetworkLogView._waterfallMinOvertime = 1;
105 WebInspector.NetworkLogView._waterfallMaxOvertime = 3; 103 WebInspector.NetworkLogView._waterfallMaxOvertime = 3;
106 104
107 /** @enum {symbol} */ 105 /** @enum {symbol} */
108 WebInspector.NetworkLogView.Events = { 106 WebInspector.NetworkLogView.Events = {
109 RequestSelected: Symbol("RequestSelected"), 107 RequestSelected: Symbol("RequestSelected"),
110 SearchCountUpdated: Symbol("SearchCountUpdated"), 108 SearchCountUpdated: Symbol("SearchCountUpdated"),
111 SearchIndexUpdated: Symbol("SearchIndexUpdated"), 109 SearchIndexUpdated: Symbol("SearchIndexUpdated"),
112 UpdateRequest: Symbol("UpdateRequest") 110 UpdateRequest: Symbol("UpdateRequest")
113 } 111 }
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 summaryBar.title = text; 453 summaryBar.title = text;
456 }, 454 },
457 455
458 scheduleRefresh: function() 456 scheduleRefresh: function()
459 { 457 {
460 if (this._needsRefresh) 458 if (this._needsRefresh)
461 return; 459 return;
462 460
463 this._needsRefresh = true; 461 this._needsRefresh = true;
464 462
465 if (this.isShowing() && !this._refreshTimeout) 463 if (this.isShowing() && !this._refreshRequestId)
466 this._refreshTimeout = setTimeout(this.refresh.bind(this), WebInspec tor.NetworkLogView._defaultRefreshDelay); 464 this._refreshRequestId = this.element.window().requestAnimationFrame (this.refresh.bind(this));
467 }, 465 },
468 466
469 /** 467 /**
470 * @param {!Array<number>} times 468 * @param {!Array<number>} times
471 */ 469 */
472 addFilmStripFrames: function(times) 470 addFilmStripFrames: function(times)
473 { 471 {
474 this._columns.addEventDividers(times, "network-frame-divider"); 472 this._columns.addEventDividers(times, "network-frame-divider");
475 }, 473 },
476 474
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 }, 571 },
574 572
575 willHide: function() 573 willHide: function()
576 { 574 {
577 this._columns.willHide(); 575 this._columns.willHide();
578 }, 576 },
579 577
580 refresh: function() 578 refresh: function()
581 { 579 {
582 this._needsRefresh = false; 580 this._needsRefresh = false;
583 if (this._refreshTimeout) { 581
584 clearTimeout(this._refreshTimeout); 582 if (this._refreshRequestId) {
585 delete this._refreshTimeout; 583 this.element.window().cancelAnimationFrame(this._refreshRequestId);
584 delete this._refreshRequestId;
586 } 585 }
587 586
588 this.removeAllNodeHighlights(); 587 this.removeAllNodeHighlights();
589 588
590 var oldBoundary = this.calculator().boundary(); 589 var oldBoundary = this.calculator().boundary();
591 this._timeCalculator.updateBoundariesForEventTime(this._mainRequestLoadT ime); 590 this._timeCalculator.updateBoundariesForEventTime(this._mainRequestLoadT ime);
592 this._durationCalculator.updateBoundariesForEventTime(this._mainRequestL oadTime); 591 this._durationCalculator.updateBoundariesForEventTime(this._mainRequestL oadTime);
593 this._timeCalculator.updateBoundariesForEventTime(this._mainRequestDOMCo ntentLoadedTime); 592 this._timeCalculator.updateBoundariesForEventTime(this._mainRequestDOMCo ntentLoadedTime);
594 this._durationCalculator.updateBoundariesForEventTime(this._mainRequestD OMContentLoadedTime); 593 this._durationCalculator.updateBoundariesForEventTime(this._mainRequestD OMContentLoadedTime);
595 594
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 * @return {boolean} 1739 * @return {boolean}
1741 */ 1740 */
1742 WebInspector.NetworkLogView._requestTimeFilter = function(windowStart, windowEnd , request) 1741 WebInspector.NetworkLogView._requestTimeFilter = function(windowStart, windowEnd , request)
1743 { 1742 {
1744 if (request.issueTime() > windowEnd) 1743 if (request.issueTime() > windowEnd)
1745 return false; 1744 return false;
1746 if (request.endTime !== -1 && request.endTime < windowStart) 1745 if (request.endTime !== -1 && request.endTime < windowStart)
1747 return false; 1746 return false;
1748 return true; 1747 return true;
1749 } 1748 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698