| OLD | NEW |
| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 this._updateUI(); | 96 this._updateUI(); |
| 97 | 97 |
| 98 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel,
WebInspector.ResourceTreeModel.Events.WillReloadPage, this._willReloadPage, this
); | 98 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel,
WebInspector.ResourceTreeModel.Events.WillReloadPage, this._willReloadPage, this
); |
| 99 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel,
WebInspector.ResourceTreeModel.Events.Load, this._load, this); | 99 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel,
WebInspector.ResourceTreeModel.Events.Load, this._load, this); |
| 100 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Req
uestSelected, this._onRequestSelected, this); | 100 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Req
uestSelected, this._onRequestSelected, this); |
| 101 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Sea
rchCountUpdated, this._onSearchCountUpdated, this); | 101 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Sea
rchCountUpdated, this._onSearchCountUpdated, this); |
| 102 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Sea
rchIndexUpdated, this._onSearchIndexUpdated, this); | 102 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Sea
rchIndexUpdated, this._onSearchIndexUpdated, this); |
| 103 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Upd
ateRequest, this._onUpdateRequest, this); | 103 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Upd
ateRequest, this._onUpdateRequest, this); |
| 104 | 104 |
| 105 WebInspector.DataSaverInfobar.maybeShowInPanel(this); | 105 WebInspector.DataSaverInfobar.maybeShowInPanel(this); |
| 106 } | 106 }; |
| 107 | 107 |
| 108 WebInspector.NetworkPanel.displayScreenshotDelay = 1000; | 108 WebInspector.NetworkPanel.displayScreenshotDelay = 1000; |
| 109 | 109 |
| 110 WebInspector.NetworkPanel.prototype = { | 110 WebInspector.NetworkPanel.prototype = { |
| 111 /** | 111 /** |
| 112 * @param {!WebInspector.Event} event | 112 * @param {!WebInspector.Event} event |
| 113 */ | 113 */ |
| 114 _onWindowChanged: function(event) | 114 _onWindowChanged: function(event) |
| 115 { | 115 { |
| 116 var startTime = Math.max(this._calculator.minimumBoundary(), event.data.
startTime / 1000); | 116 var startTime = Math.max(this._calculator.minimumBoundary(), event.data.
startTime / 1000); |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 { | 582 { |
| 583 var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); | 583 var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); |
| 584 this._calculator.updateBoundaries(request); | 584 this._calculator.updateBoundaries(request); |
| 585 // FIXME: Unify all time units across the frontend! | 585 // FIXME: Unify all time units across the frontend! |
| 586 this._overviewPane.setBounds(this._calculator.minimumBoundary() * 1000,
this._calculator.maximumBoundary() * 1000); | 586 this._overviewPane.setBounds(this._calculator.minimumBoundary() * 1000,
this._calculator.maximumBoundary() * 1000); |
| 587 this._networkOverview.updateRequest(request); | 587 this._networkOverview.updateRequest(request); |
| 588 this._overviewPane.scheduleUpdate(); | 588 this._overviewPane.scheduleUpdate(); |
| 589 }, | 589 }, |
| 590 | 590 |
| 591 __proto__: WebInspector.Panel.prototype | 591 __proto__: WebInspector.Panel.prototype |
| 592 } | 592 }; |
| 593 | 593 |
| 594 /** | 594 /** |
| 595 * @constructor | 595 * @constructor |
| 596 * @implements {WebInspector.ContextMenu.Provider} | 596 * @implements {WebInspector.ContextMenu.Provider} |
| 597 */ | 597 */ |
| 598 WebInspector.NetworkPanel.ContextMenuProvider = function() | 598 WebInspector.NetworkPanel.ContextMenuProvider = function() |
| 599 { | 599 { |
| 600 } | 600 }; |
| 601 | 601 |
| 602 WebInspector.NetworkPanel.ContextMenuProvider.prototype = { | 602 WebInspector.NetworkPanel.ContextMenuProvider.prototype = { |
| 603 /** | 603 /** |
| 604 * @override | 604 * @override |
| 605 * @param {!Event} event | 605 * @param {!Event} event |
| 606 * @param {!WebInspector.ContextMenu} contextMenu | 606 * @param {!WebInspector.ContextMenu} contextMenu |
| 607 * @param {!Object} target | 607 * @param {!Object} target |
| 608 */ | 608 */ |
| 609 appendApplicableItems: function(event, contextMenu, target) | 609 appendApplicableItems: function(event, contextMenu, target) |
| 610 { | 610 { |
| 611 WebInspector.NetworkPanel._instance().appendApplicableItems(event, conte
xtMenu, target); | 611 WebInspector.NetworkPanel._instance().appendApplicableItems(event, conte
xtMenu, target); |
| 612 } | 612 } |
| 613 } | 613 }; |
| 614 | 614 |
| 615 /** | 615 /** |
| 616 * @constructor | 616 * @constructor |
| 617 * @implements {WebInspector.Revealer} | 617 * @implements {WebInspector.Revealer} |
| 618 */ | 618 */ |
| 619 WebInspector.NetworkPanel.RequestRevealer = function() | 619 WebInspector.NetworkPanel.RequestRevealer = function() |
| 620 { | 620 { |
| 621 } | 621 }; |
| 622 | 622 |
| 623 WebInspector.NetworkPanel.RequestRevealer.prototype = { | 623 WebInspector.NetworkPanel.RequestRevealer.prototype = { |
| 624 /** | 624 /** |
| 625 * @override | 625 * @override |
| 626 * @param {!Object} request | 626 * @param {!Object} request |
| 627 * @return {!Promise} | 627 * @return {!Promise} |
| 628 */ | 628 */ |
| 629 reveal: function(request) | 629 reveal: function(request) |
| 630 { | 630 { |
| 631 if (!(request instanceof WebInspector.NetworkRequest)) | 631 if (!(request instanceof WebInspector.NetworkRequest)) |
| 632 return Promise.reject(new Error("Internal error: not a network reque
st")); | 632 return Promise.reject(new Error("Internal error: not a network reque
st")); |
| 633 var panel = WebInspector.NetworkPanel._instance(); | 633 var panel = WebInspector.NetworkPanel._instance(); |
| 634 return WebInspector.viewManager.showView("network").then(panel.revealAnd
HighlightRequest.bind(panel, request)); | 634 return WebInspector.viewManager.showView("network").then(panel.revealAnd
HighlightRequest.bind(panel, request)); |
| 635 } | 635 } |
| 636 } | 636 }; |
| 637 | 637 |
| 638 /** | 638 /** |
| 639 * @param {!Array<{filterType: !WebInspector.NetworkLogView.FilterType, filterVa
lue: string}>} filters | 639 * @param {!Array<{filterType: !WebInspector.NetworkLogView.FilterType, filterVa
lue: string}>} filters |
| 640 */ | 640 */ |
| 641 WebInspector.NetworkPanel.revealAndFilter = function(filters) | 641 WebInspector.NetworkPanel.revealAndFilter = function(filters) |
| 642 { | 642 { |
| 643 var panel = WebInspector.NetworkPanel._instance(); | 643 var panel = WebInspector.NetworkPanel._instance(); |
| 644 var filterString = ""; | 644 var filterString = ""; |
| 645 for (var filter of filters) | 645 for (var filter of filters) |
| 646 filterString += `${filter.filterType}:${filter.filterValue} `; | 646 filterString += `${filter.filterType}:${filter.filterValue} `; |
| 647 panel._networkLogView.setTextFilterValue(filterString); | 647 panel._networkLogView.setTextFilterValue(filterString); |
| 648 WebInspector.viewManager.showView("network"); | 648 WebInspector.viewManager.showView("network"); |
| 649 } | 649 }; |
| 650 | 650 |
| 651 /** | 651 /** |
| 652 * @return {!WebInspector.NetworkPanel} | 652 * @return {!WebInspector.NetworkPanel} |
| 653 */ | 653 */ |
| 654 WebInspector.NetworkPanel._instance = function() | 654 WebInspector.NetworkPanel._instance = function() |
| 655 { | 655 { |
| 656 return /** @type {!WebInspector.NetworkPanel} */ (self.runtime.sharedInstanc
e(WebInspector.NetworkPanel)); | 656 return /** @type {!WebInspector.NetworkPanel} */ (self.runtime.sharedInstanc
e(WebInspector.NetworkPanel)); |
| 657 } | 657 }; |
| 658 | 658 |
| 659 /** | 659 /** |
| 660 * @constructor | 660 * @constructor |
| 661 * @implements {WebInspector.TracingManagerClient} | 661 * @implements {WebInspector.TracingManagerClient} |
| 662 * @param {!WebInspector.NetworkTimeCalculator} timeCalculator | 662 * @param {!WebInspector.NetworkTimeCalculator} timeCalculator |
| 663 * @param {!WebInspector.FilmStripView} filmStripView | 663 * @param {!WebInspector.FilmStripView} filmStripView |
| 664 */ | 664 */ |
| 665 WebInspector.NetworkPanel.FilmStripRecorder = function(timeCalculator, filmStrip
View) | 665 WebInspector.NetworkPanel.FilmStripRecorder = function(timeCalculator, filmStrip
View) |
| 666 { | 666 { |
| 667 this._timeCalculator = timeCalculator; | 667 this._timeCalculator = timeCalculator; |
| 668 this._filmStripView = filmStripView; | 668 this._filmStripView = filmStripView; |
| 669 } | 669 }; |
| 670 | 670 |
| 671 WebInspector.NetworkPanel.FilmStripRecorder.prototype = { | 671 WebInspector.NetworkPanel.FilmStripRecorder.prototype = { |
| 672 /** | 672 /** |
| 673 * @override | 673 * @override |
| 674 */ | 674 */ |
| 675 tracingStarted: function() | 675 tracingStarted: function() |
| 676 { | 676 { |
| 677 }, | 677 }, |
| 678 | 678 |
| 679 /** | 679 /** |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 stopRecording: function(callback) | 744 stopRecording: function(callback) |
| 745 { | 745 { |
| 746 if (!this._target) | 746 if (!this._target) |
| 747 return; | 747 return; |
| 748 | 748 |
| 749 this._target.tracingManager.stop(); | 749 this._target.tracingManager.stop(); |
| 750 WebInspector.targetManager.suspendReload(this._target); | 750 WebInspector.targetManager.suspendReload(this._target); |
| 751 this._callback = callback; | 751 this._callback = callback; |
| 752 this._filmStripView.setStatusText(WebInspector.UIString("Fetching frames
...")); | 752 this._filmStripView.setStatusText(WebInspector.UIString("Fetching frames
...")); |
| 753 } | 753 } |
| 754 } | 754 }; |
| 755 | 755 |
| 756 /** | 756 /** |
| 757 * @constructor | 757 * @constructor |
| 758 * @implements {WebInspector.ActionDelegate} | 758 * @implements {WebInspector.ActionDelegate} |
| 759 */ | 759 */ |
| 760 WebInspector.NetworkPanel.RecordActionDelegate = function() | 760 WebInspector.NetworkPanel.RecordActionDelegate = function() |
| 761 { | 761 { |
| 762 } | 762 }; |
| 763 WebInspector.NetworkPanel.RecordActionDelegate.prototype = { | 763 WebInspector.NetworkPanel.RecordActionDelegate.prototype = { |
| 764 /** | 764 /** |
| 765 * @override | 765 * @override |
| 766 * @param {!WebInspector.Context} context | 766 * @param {!WebInspector.Context} context |
| 767 * @param {string} actionId | 767 * @param {string} actionId |
| 768 * @return {boolean} | 768 * @return {boolean} |
| 769 */ | 769 */ |
| 770 handleAction: function(context, actionId) | 770 handleAction: function(context, actionId) |
| 771 { | 771 { |
| 772 var panel = WebInspector.context.flavor(WebInspector.NetworkPanel); | 772 var panel = WebInspector.context.flavor(WebInspector.NetworkPanel); |
| 773 console.assert(panel && panel instanceof WebInspector.NetworkPanel); | 773 console.assert(panel && panel instanceof WebInspector.NetworkPanel); |
| 774 panel._toggleRecording(); | 774 panel._toggleRecording(); |
| 775 return true; | 775 return true; |
| 776 } | 776 } |
| 777 } | 777 }; |
| OLD | NEW |