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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 | 483 |
484 this.refresh(); | 484 this.refresh(); |
485 }, | 485 }, |
486 | 486 |
487 __proto__: WebInspector.VBox.prototype | 487 __proto__: WebInspector.VBox.prototype |
488 } | 488 } |
489 | 489 |
490 /** | 490 /** |
491 * @constructor | 491 * @constructor |
492 * @extends {WebInspector.ProfileType} | 492 * @extends {WebInspector.ProfileType} |
493 * @implements {WebInspector.TargetManager.Observer} | |
494 */ | 493 */ |
495 WebInspector.CPUProfileType = function() | 494 WebInspector.CPUProfileType = function() |
496 { | 495 { |
497 WebInspector.ProfileType.call(this, WebInspector.CPUProfileType.TypeId, WebI
nspector.UIString("Collect JavaScript CPU Profile")); | 496 WebInspector.ProfileType.call(this, WebInspector.CPUProfileType.TypeId, WebI
nspector.UIString("Collect JavaScript CPU Profile")); |
498 this._recording = false; | 497 this._recording = false; |
499 | 498 |
500 this._nextAnonymousConsoleProfileNumber = 1; | 499 this._nextAnonymousConsoleProfileNumber = 1; |
501 this._anonymousConsoleProfileIdToTitle = {}; | 500 this._anonymousConsoleProfileIdToTitle = {}; |
502 | 501 |
503 WebInspector.CPUProfileType.instance = this; | 502 WebInspector.CPUProfileType.instance = this; |
504 WebInspector.targetManager.observeTargets(this); | 503 WebInspector.targetManager.addModelListener(WebInspector.CPUProfilerModel, W
ebInspector.CPUProfilerModel.EventTypes.ConsoleProfileStarted, this._consoleProf
ileStarted, this); |
| 504 WebInspector.targetManager.addModelListener(WebInspector.CPUProfilerModel, W
ebInspector.CPUProfilerModel.EventTypes.ConsoleProfileFinished, this._consolePro
fileFinished, this); |
505 } | 505 } |
506 | 506 |
507 WebInspector.CPUProfileType.TypeId = "CPU"; | 507 WebInspector.CPUProfileType.TypeId = "CPU"; |
508 | 508 |
509 WebInspector.CPUProfileType.prototype = { | 509 WebInspector.CPUProfileType.prototype = { |
510 /** | 510 /** |
511 * @param {!WebInspector.Target} target | |
512 */ | |
513 targetAdded: function(target) | |
514 { | |
515 target.cpuProfilerModel.addEventListener(WebInspector.CPUProfilerModel.E
ventTypes.ConsoleProfileStarted, this._consoleProfileStarted, this); | |
516 target.cpuProfilerModel.addEventListener(WebInspector.CPUProfilerModel.E
ventTypes.ConsoleProfileFinished, this._consoleProfileFinished, this); | |
517 }, | |
518 | |
519 /** | |
520 * @param {!WebInspector.Target} target | |
521 */ | |
522 targetRemoved: function(target) | |
523 { | |
524 target.cpuProfilerModel.removeEventListener(WebInspector.CPUProfilerMode
l.EventTypes.ConsoleProfileStarted, this._consoleProfileStarted, this); | |
525 target.cpuProfilerModel.removeEventListener(WebInspector.CPUProfilerMode
l.EventTypes.ConsoleProfileFinished, this._consoleProfileFinished, this); | |
526 }, | |
527 | |
528 /** | |
529 * @override | 511 * @override |
530 * @return {string} | 512 * @return {string} |
531 */ | 513 */ |
532 fileExtension: function() | 514 fileExtension: function() |
533 { | 515 { |
534 return ".cpuprofile"; | 516 return ".cpuprofile"; |
535 }, | 517 }, |
536 | 518 |
537 get buttonTooltip() | 519 get buttonTooltip() |
538 { | 520 { |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 _notifyTempFileReady: function() | 887 _notifyTempFileReady: function() |
906 { | 888 { |
907 if (this._onTempFileReady) { | 889 if (this._onTempFileReady) { |
908 this._onTempFileReady(); | 890 this._onTempFileReady(); |
909 this._onTempFileReady = null; | 891 this._onTempFileReady = null; |
910 } | 892 } |
911 }, | 893 }, |
912 | 894 |
913 __proto__: WebInspector.ProfileHeader.prototype | 895 __proto__: WebInspector.ProfileHeader.prototype |
914 } | 896 } |
OLD | NEW |