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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js

Issue 2560353002: DevTools: move the GC button into the memory panel. (Closed)
Patch Set: Created 4 years 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 | « third_party/WebKit/Source/devtools/front_end/profiler/module.json ('k') | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 } else { 377 } else {
378 this._panelToolbar.appendToolbarItem(screenshotCheckbox); 378 this._panelToolbar.appendToolbarItem(screenshotCheckbox);
379 } 379 }
380 380
381 if (Runtime.experiments.isEnabled('timelineRuleUsageRecording')) { 381 if (Runtime.experiments.isEnabled('timelineRuleUsageRecording')) {
382 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( 382 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox(
383 Common.UIString('CSS coverage'), this._markUnusedCSS, Common.UIString( 'Mark unused CSS in souces.'))); 383 Common.UIString('CSS coverage'), this._markUnusedCSS, Common.UIString( 'Mark unused CSS in souces.')));
384 } 384 }
385 385
386 this._panelToolbar.appendSeparator(); 386 this._panelToolbar.appendSeparator();
387 var garbageCollectButton = new UI.ToolbarButton(Common.UIString('Collect gar bage'), 'largeicon-trash-bin');
388 garbageCollectButton.addEventListener('click', this._garbageCollectButtonCli cked, this);
389 this._panelToolbar.appendToolbarItem(garbageCollectButton);
390
391 this._panelToolbar.appendSeparator();
392 this._cpuThrottlingCombobox = new UI.ToolbarComboBox(this._onCPUThrottlingCh anged.bind(this)); 387 this._cpuThrottlingCombobox = new UI.ToolbarComboBox(this._onCPUThrottlingCh anged.bind(this));
393 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); 388 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect());
394 this._panelToolbar.appendToolbarItem(this._cpuThrottlingCombobox); 389 this._panelToolbar.appendToolbarItem(this._cpuThrottlingCombobox);
395 this._populateCPUThrottingCombobox(); 390 this._populateCPUThrottingCombobox();
396 this._updateTimelineControls(); 391 this._updateTimelineControls();
397 } 392 }
398 393
399 /** 394 /**
400 * @return {!UI.ToolbarComboBox} 395 * @return {!UI.ToolbarComboBox}
401 */ 396 */
(...skipping 15 matching lines...) Expand all
417 */ 412 */
418 function addGroupingOption(name, value) { 413 function addGroupingOption(name, value) {
419 var option = cpuThrottlingCombobox.createOption(name, '', String(value)); 414 var option = cpuThrottlingCombobox.createOption(name, '', String(value));
420 cpuThrottlingCombobox.addOption(option); 415 cpuThrottlingCombobox.addOption(option);
421 if (hasSelection || (value && value !== currentRate)) 416 if (hasSelection || (value && value !== currentRate))
422 return; 417 return;
423 cpuThrottlingCombobox.select(option); 418 cpuThrottlingCombobox.select(option);
424 hasSelection = true; 419 hasSelection = true;
425 } 420 }
426 var predefinedRates = new Map([ 421 var predefinedRates = new Map([
427 [1, Common.UIString('No CPU throttling')], 422 [1, Common.UIString('No CPU throttling')], [2, Common.UIString('2\xD7 slow down')],
428 [2, Common.UIString('2\xD7 slowdown')], 423 [5, Common.UIString('5\xD7 slowdown')], [10, Common.UIString('10\xD7 slowd own')],
429 [5, Common.UIString('5\xD7 slowdown')],
430 [10, Common.UIString('10\xD7 slowdown')],
431 [20, Common.UIString('20\xD7 slowdown')] 424 [20, Common.UIString('20\xD7 slowdown')]
432 ]); 425 ]);
433 for (var rate of predefinedRates) 426 for (var rate of predefinedRates)
434 addGroupingOption(rate[1], rate[0]); 427 addGroupingOption(rate[1], rate[0]);
435 } 428 }
436 429
437 _prepareToLoadTimeline() { 430 _prepareToLoadTimeline() {
438 console.assert(this._state === Timeline.TimelinePanel.State.Idle); 431 console.assert(this._state === Timeline.TimelinePanel.State.Idle);
439 this._setState(Timeline.TimelinePanel.State.Loading); 432 this._setState(Timeline.TimelinePanel.State.Loading);
440 } 433 }
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 this._dropTarget.setEnabled(this._state === state.Idle); 625 this._dropTarget.setEnabled(this._state === state.Idle);
633 } 626 }
634 627
635 _toggleRecording() { 628 _toggleRecording() {
636 if (this._state === Timeline.TimelinePanel.State.Idle) 629 if (this._state === Timeline.TimelinePanel.State.Idle)
637 this._startRecording(true); 630 this._startRecording(true);
638 else if (this._state === Timeline.TimelinePanel.State.Recording) 631 else if (this._state === Timeline.TimelinePanel.State.Recording)
639 this._stopRecording(); 632 this._stopRecording();
640 } 633 }
641 634
642 _garbageCollectButtonClicked() {
643 var targets = SDK.targetManager.targets();
644 for (var i = 0; i < targets.length; ++i)
645 targets[i].heapProfilerAgent().collectGarbage();
646 }
647
648 _clear() { 635 _clear() {
649 if (Runtime.experiments.isEnabled('timelineRuleUsageRecording') && this._mar kUnusedCSS.get()) 636 if (Runtime.experiments.isEnabled('timelineRuleUsageRecording') && this._mar kUnusedCSS.get())
650 Components.CoverageProfile.instance().reset(); 637 Components.CoverageProfile.instance().reset();
651 638
652 Components.LineLevelProfile.instance().reset(); 639 Components.LineLevelProfile.instance().reset();
653 this._tracingModel.reset(); 640 this._tracingModel.reset();
654 this._model.reset(); 641 this._model.reset();
655 this._showRecordingHelpMessage(); 642 this._showRecordingHelpMessage();
656 643
657 this.requestWindowTimes(0, Infinity); 644 this.requestWindowTimes(0, Infinity);
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1957 } 1944 }
1958 1945
1959 /** 1946 /**
1960 * @override 1947 * @override
1961 * @param {!SDK.Target} target 1948 * @param {!SDK.Target} target
1962 */ 1949 */
1963 targetRemoved(target) { 1950 targetRemoved(target) {
1964 this._targets.remove(target, true); 1951 this._targets.remove(target, true);
1965 } 1952 }
1966 }; 1953 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/profiler/module.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698