| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * | 10 * |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * @return {boolean} | 86 * @return {boolean} |
| 87 */ | 87 */ |
| 88 isRecordingProfile() { | 88 isRecordingProfile() { |
| 89 return this._isRecording; | 89 return this._isRecording; |
| 90 } | 90 } |
| 91 | 91 |
| 92 startRecording() { | 92 startRecording() { |
| 93 this._isRecording = true; | 93 this._isRecording = true; |
| 94 Host.userMetrics.actionTaken(Host.UserMetrics.Action.ProfilesCPUProfileTaken
); | |
| 95 var intervalUs = Common.moduleSetting('highResolutionCpuProfiling').get() ?
100 : 1000; | 94 var intervalUs = Common.moduleSetting('highResolutionCpuProfiling').get() ?
100 : 1000; |
| 96 this._profilerAgent.setSamplingInterval(intervalUs); | 95 this._profilerAgent.setSamplingInterval(intervalUs); |
| 97 this._profilerAgent.start(); | 96 this._profilerAgent.start(); |
| 98 } | 97 } |
| 99 | 98 |
| 100 /** | 99 /** |
| 101 * @return {!Promise.<?Protocol.Profiler.Profile>} | 100 * @return {!Promise.<?Protocol.Profiler.Profile>} |
| 102 */ | 101 */ |
| 103 stopRecording() { | 102 stopRecording() { |
| 104 /** | 103 /** |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 SDK.SDKModel.register(SDK.CPUProfilerModel, SDK.Target.Capability.JS); | 137 SDK.SDKModel.register(SDK.CPUProfilerModel, SDK.Target.Capability.JS); |
| 139 | 138 |
| 140 /** @enum {symbol} */ | 139 /** @enum {symbol} */ |
| 141 SDK.CPUProfilerModel.Events = { | 140 SDK.CPUProfilerModel.Events = { |
| 142 ConsoleProfileStarted: Symbol('ConsoleProfileStarted'), | 141 ConsoleProfileStarted: Symbol('ConsoleProfileStarted'), |
| 143 ConsoleProfileFinished: Symbol('ConsoleProfileFinished') | 142 ConsoleProfileFinished: Symbol('ConsoleProfileFinished') |
| 144 }; | 143 }; |
| 145 | 144 |
| 146 /** @typedef {!{id: string, scriptLocation: !SDK.DebuggerModel.Location, title:
(string|undefined), cpuProfile: (!Protocol.Profiler.Profile|undefined)}} */ | 145 /** @typedef {!{id: string, scriptLocation: !SDK.DebuggerModel.Location, title:
(string|undefined), cpuProfile: (!Protocol.Profiler.Profile|undefined)}} */ |
| 147 SDK.CPUProfilerModel.EventData; | 146 SDK.CPUProfilerModel.EventData; |
| OLD | NEW |