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

Side by Side Diff: Source/devtools/front_end/sdk/CPUProfilerModel.js

Issue 1196193016: DevTools: [CSS] promisify CSS domain (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 5 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) 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.P rofileStarted); 116 this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.P rofileStarted);
117 WebInspector.userMetrics.ProfilesCPUProfileTaken.record(); 117 WebInspector.userMetrics.ProfilesCPUProfileTaken.record();
118 }, 118 },
119 119
120 /** 120 /**
121 * @return {!Promise.<?ProfilerAgent.CPUProfile>} 121 * @return {!Promise.<?ProfilerAgent.CPUProfile>}
122 */ 122 */
123 stopRecording: function() 123 stopRecording: function()
124 { 124 {
125 /** 125 /**
126 * @param {?{profile: !ProfilerAgent.CPUProfile}} value 126 * @param {?Protocol.Error} error
127 * @param {?ProfilerAgent.CPUProfile} profile
127 * @return {?ProfilerAgent.CPUProfile} 128 * @return {?ProfilerAgent.CPUProfile}
128 */ 129 */
129 function extractProfile(value) 130 function extractProfile(error, profile)
130 { 131 {
131 return value && value.profile; 132 return !error && profile ? profile : null;
132 } 133 }
133 this._isRecording = false; 134 this._isRecording = false;
134 this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.P rofileStopped); 135 this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.P rofileStopped);
135 return this.target().profilerAgent().stop().then(extractProfile); 136 return this.target().profilerAgent().stop(extractProfile);
136 }, 137 },
137 138
138 dispose: function() 139 dispose: function()
139 { 140 {
140 WebInspector.moduleSetting("highResolutionCpuProfiling").removeChangeLis tener(this._configureCpuProfilerSamplingInterval, this); 141 WebInspector.moduleSetting("highResolutionCpuProfiling").removeChangeLis tener(this._configureCpuProfilerSamplingInterval, this);
141 }, 142 },
142 143
143 144
144 __proto__: WebInspector.SDKModel.prototype 145 __proto__: WebInspector.SDKModel.prototype
145 } 146 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/platform/utilities.js ('k') | Source/devtools/front_end/sdk/CSSStyleModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698