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

Side by Side Diff: Source/devtools/front_end/profiler/ProfilesPanel.js

Issue 298333003: DevTools: Implement console message logging through an extension (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove duplicate logging Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 this.registerShortcuts(WebInspector.ShortcutsScreen.ProfilesPanelShortcu ts.StartStopRecording, this.toggleRecordButton.bind(this)); 559 this.registerShortcuts(WebInspector.ShortcutsScreen.ProfilesPanelShortcu ts.StartStopRecording, this.toggleRecordButton.bind(this));
560 }, 560 },
561 561
562 _configureCpuProfilerSamplingInterval: function() 562 _configureCpuProfilerSamplingInterval: function()
563 { 563 {
564 var intervalUs = WebInspector.settings.highResolutionCpuProfiling.get() ? 100 : 1000; 564 var intervalUs = WebInspector.settings.highResolutionCpuProfiling.get() ? 100 : 1000;
565 ProfilerAgent.setSamplingInterval(intervalUs, didChangeInterval); 565 ProfilerAgent.setSamplingInterval(intervalUs, didChangeInterval);
566 function didChangeInterval(error) 566 function didChangeInterval(error)
567 { 567 {
568 if (error) 568 if (error)
569 WebInspector.console.showErrorMessage(error); 569 WebInspector.messageSink.addErrorMessage(error, true);
570 } 570 }
571 }, 571 },
572 572
573 /** 573 /**
574 * @param {!File} file 574 * @param {!File} file
575 */ 575 */
576 _loadFromFile: function(file) 576 _loadFromFile: function(file)
577 { 577 {
578 this._createFileSelectorElement(); 578 this._createFileSelectorElement();
579 579
580 var profileType = this._findProfileTypeByExtension(file.name); 580 var profileType = this._findProfileTypeByExtension(file.name);
581 if (!profileType) { 581 if (!profileType) {
582 var extensions = []; 582 var extensions = [];
583 var types = WebInspector.ProfileTypeRegistry.instance.profileTypes() ; 583 var types = WebInspector.ProfileTypeRegistry.instance.profileTypes() ;
584 for (var i = 0; i < types.length; i++) { 584 for (var i = 0; i < types.length; i++) {
585 var extension = types[i].fileExtension(); 585 var extension = types[i].fileExtension();
586 if (!extension || extensions.indexOf(extension) !== -1) 586 if (!extension || extensions.indexOf(extension) !== -1)
587 continue; 587 continue;
588 extensions.push(extension); 588 extensions.push(extension);
589 } 589 }
590 WebInspector.console.log(WebInspector.UIString("Can't load file. Onl y files with extensions '%s' can be loaded.", extensions.join("', '"))); 590 WebInspector.messageSink.addMessage(WebInspector.UIString("Can't loa d file. Only files with extensions '%s' can be loaded.", extensions.join("', '") ));
591 return; 591 return;
592 } 592 }
593 593
594 if (!!profileType.profileBeingRecorded()) { 594 if (!!profileType.profileBeingRecorded()) {
595 WebInspector.console.log(WebInspector.UIString("Can't load profile w hen other profile is recording.")); 595 WebInspector.messageSink.addMessage(WebInspector.UIString("Can't loa d profile while another profile is recording."));
596 return; 596 return;
597 } 597 }
598 598
599 profileType.loadFromFile(file); 599 profileType.loadFromFile(file);
600 }, 600 },
601 601
602 /** 602 /**
603 * @return {boolean} 603 * @return {boolean}
604 */ 604 */
605 toggleRecordButton: function() 605 toggleRecordButton: function()
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 importScript("HeapSnapshotCommon.js"); 1338 importScript("HeapSnapshotCommon.js");
1339 importScript("HeapSnapshotProxy.js"); 1339 importScript("HeapSnapshotProxy.js");
1340 importScript("HeapSnapshotDataGrids.js"); 1340 importScript("HeapSnapshotDataGrids.js");
1341 importScript("HeapSnapshotGridNodes.js"); 1341 importScript("HeapSnapshotGridNodes.js");
1342 importScript("HeapSnapshotView.js"); 1342 importScript("HeapSnapshotView.js");
1343 importScript("ProfileLauncherView.js"); 1343 importScript("ProfileLauncherView.js");
1344 importScript("CanvasProfileView.js"); 1344 importScript("CanvasProfileView.js");
1345 importScript("CanvasReplayStateView.js"); 1345 importScript("CanvasReplayStateView.js");
1346 1346
1347 WebInspector.ProfileTypeRegistry.instance = new WebInspector.ProfileTypeRegistry (); 1347 WebInspector.ProfileTypeRegistry.instance = new WebInspector.ProfileTypeRegistry ();
OLDNEW
« no previous file with comments | « Source/devtools/front_end/profiler/HeapSnapshotView.js ('k') | Source/devtools/front_end/sdk/CSSStyleModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698