| 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); |
| 438 } | 441 } |
| 439 | 442 |
| 440 WebInspector.ProfilesPanel.prototype = { | 443 WebInspector.ProfilesPanel.prototype = { |
| 441 _createFileSelectorElement: function() | 444 _createFileSelectorElement: function() |
| 442 { | 445 { |
| 443 if (this._fileSelectorElement) | 446 if (this._fileSelectorElement) |
| 444 this.element.removeChild(this._fileSelectorElement); | 447 this.element.removeChild(this._fileSelectorElement); |
| 445 this._fileSelectorElement = WebInspector.createFileSelectorElement(this.
_loadFromFile.bind(this)); | 448 this._fileSelectorElement = WebInspector.createFileSelectorElement(this.
_loadFromFile.bind(this)); |
| 446 this.element.appendChild(this._fileSelectorElement); | 449 this.element.appendChild(this._fileSelectorElement); |
| 447 }, | 450 }, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 465 return type; | 468 return type; |
| 466 } | 469 } |
| 467 return null; | 470 return null; |
| 468 }, | 471 }, |
| 469 | 472 |
| 470 _registerShortcuts: function() | 473 _registerShortcuts: function() |
| 471 { | 474 { |
| 472 this.registerShortcuts(WebInspector.ProfilesPanelDescriptor.ShortcutKeys
.StartStopRecording, this.toggleRecordButton.bind(this)); | 475 this.registerShortcuts(WebInspector.ProfilesPanelDescriptor.ShortcutKeys
.StartStopRecording, this.toggleRecordButton.bind(this)); |
| 473 }, | 476 }, |
| 474 | 477 |
| 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 |
| 475 /** | 489 /** |
| 476 * @param {!File} file | 490 * @param {!File} file |
| 477 */ | 491 */ |
| 478 _loadFromFile: function(file) | 492 _loadFromFile: function(file) |
| 479 { | 493 { |
| 480 this._createFileSelectorElement(); | 494 this._createFileSelectorElement(); |
| 481 | 495 |
| 482 var profileType = this._findProfileTypeByExtension(file.name); | 496 var profileType = this._findProfileTypeByExtension(file.name); |
| 483 if (!profileType) { | 497 if (!profileType) { |
| 484 var extensions = []; | 498 var extensions = []; |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 importScript("HeapSnapshotGridNodes.js"); | 1410 importScript("HeapSnapshotGridNodes.js"); |
| 1397 importScript("HeapSnapshotLoader.js"); | 1411 importScript("HeapSnapshotLoader.js"); |
| 1398 importScript("HeapSnapshotProxy.js"); | 1412 importScript("HeapSnapshotProxy.js"); |
| 1399 importScript("HeapSnapshotView.js"); | 1413 importScript("HeapSnapshotView.js"); |
| 1400 importScript("HeapSnapshotWorkerDispatcher.js"); | 1414 importScript("HeapSnapshotWorkerDispatcher.js"); |
| 1401 importScript("JSHeapSnapshot.js"); | 1415 importScript("JSHeapSnapshot.js"); |
| 1402 importScript("ProfileLauncherView.js"); | 1416 importScript("ProfileLauncherView.js"); |
| 1403 importScript("TopDownProfileDataGridTree.js"); | 1417 importScript("TopDownProfileDataGridTree.js"); |
| 1404 importScript("CanvasProfileView.js"); | 1418 importScript("CanvasProfileView.js"); |
| 1405 importScript("CanvasReplayStateView.js"); | 1419 importScript("CanvasReplayStateView.js"); |
| OLD | NEW |