OLD | NEW |
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 } | 428 } |
429 | 429 |
430 this._profilesWereRequested = false; | 430 this._profilesWereRequested = false; |
431 this._reset(); | 431 this._reset(); |
432 | 432 |
433 this._createFileSelectorElement(); | 433 this._createFileSelectorElement(); |
434 this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bi
nd(this), true); | 434 this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bi
nd(this), true); |
435 this._registerShortcuts(); | 435 this._registerShortcuts(); |
436 | 436 |
437 WebInspector.ContextMenu.registerProvider(this); | 437 WebInspector.ContextMenu.registerProvider(this); |
438 | |
439 this._configureCpuProfilerSamplingInterval(); | |
440 WebInspector.settings.highResolutionCpuProfiling.addChangeListener(this._con
figureCpuProfilerSamplingInterval, this); | |
441 } | 438 } |
442 | 439 |
443 WebInspector.ProfilesPanel.prototype = { | 440 WebInspector.ProfilesPanel.prototype = { |
444 _createFileSelectorElement: function() | 441 _createFileSelectorElement: function() |
445 { | 442 { |
446 if (this._fileSelectorElement) | 443 if (this._fileSelectorElement) |
447 this.element.removeChild(this._fileSelectorElement); | 444 this.element.removeChild(this._fileSelectorElement); |
448 this._fileSelectorElement = WebInspector.createFileSelectorElement(this.
_loadFromFile.bind(this)); | 445 this._fileSelectorElement = WebInspector.createFileSelectorElement(this.
_loadFromFile.bind(this)); |
449 this.element.appendChild(this._fileSelectorElement); | 446 this.element.appendChild(this._fileSelectorElement); |
450 }, | 447 }, |
(...skipping 17 matching lines...) Expand all Loading... |
468 return type; | 465 return type; |
469 } | 466 } |
470 return null; | 467 return null; |
471 }, | 468 }, |
472 | 469 |
473 _registerShortcuts: function() | 470 _registerShortcuts: function() |
474 { | 471 { |
475 this.registerShortcuts(WebInspector.ProfilesPanelDescriptor.ShortcutKeys
.StartStopRecording, this.toggleRecordButton.bind(this)); | 472 this.registerShortcuts(WebInspector.ProfilesPanelDescriptor.ShortcutKeys
.StartStopRecording, this.toggleRecordButton.bind(this)); |
476 }, | 473 }, |
477 | 474 |
478 _configureCpuProfilerSamplingInterval: function() | |
479 { | |
480 var intervalUs = WebInspector.settings.highResolutionCpuProfiling.get()
? 100 : 1000; | |
481 ProfilerAgent.setSamplingInterval(intervalUs, didChangeInterval.bind(thi
s)); | |
482 function didChangeInterval(error) | |
483 { | |
484 if (error) | |
485 WebInspector.showErrorMessage(error) | |
486 } | |
487 }, | |
488 | |
489 /** | 475 /** |
490 * @param {!File} file | 476 * @param {!File} file |
491 */ | 477 */ |
492 _loadFromFile: function(file) | 478 _loadFromFile: function(file) |
493 { | 479 { |
494 this._createFileSelectorElement(); | 480 this._createFileSelectorElement(); |
495 | 481 |
496 var profileType = this._findProfileTypeByExtension(file.name); | 482 var profileType = this._findProfileTypeByExtension(file.name); |
497 if (!profileType) { | 483 if (!profileType) { |
498 var extensions = []; | 484 var extensions = []; |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 importScript("HeapSnapshotGridNodes.js"); | 1396 importScript("HeapSnapshotGridNodes.js"); |
1411 importScript("HeapSnapshotLoader.js"); | 1397 importScript("HeapSnapshotLoader.js"); |
1412 importScript("HeapSnapshotProxy.js"); | 1398 importScript("HeapSnapshotProxy.js"); |
1413 importScript("HeapSnapshotView.js"); | 1399 importScript("HeapSnapshotView.js"); |
1414 importScript("HeapSnapshotWorkerDispatcher.js"); | 1400 importScript("HeapSnapshotWorkerDispatcher.js"); |
1415 importScript("JSHeapSnapshot.js"); | 1401 importScript("JSHeapSnapshot.js"); |
1416 importScript("ProfileLauncherView.js"); | 1402 importScript("ProfileLauncherView.js"); |
1417 importScript("TopDownProfileDataGridTree.js"); | 1403 importScript("TopDownProfileDataGridTree.js"); |
1418 importScript("CanvasProfileView.js"); | 1404 importScript("CanvasProfileView.js"); |
1419 importScript("CanvasReplayStateView.js"); | 1405 importScript("CanvasReplayStateView.js"); |
OLD | NEW |