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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {!WebInspector.Target} target 7 * @param {!WebInspector.Target} target
8 * @param {!WebInspector.TimelineLifecycleDelegate} delegate 8 * @param {!WebInspector.TimelineLifecycleDelegate} delegate
9 * @param {!WebInspector.TracingModel} tracingModel 9 * @param {!WebInspector.TracingModel} tracingModel
10 * @implements {WebInspector.TargetManager.Observer} 10 * @implements {WebInspector.TargetManager.Observer}
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 */ 163 */
164 _startRecordingWithCategories: function(categories, enableJSSampling, callba ck) 164 _startRecordingWithCategories: function(categories, enableJSSampling, callba ck)
165 { 165 {
166 WebInspector.targetManager.suspendAllTargets(); 166 WebInspector.targetManager.suspendAllTargets();
167 var profilingStartedPromise = enableJSSampling && !Runtime.experiments.i sEnabled("timelineTracingJSProfile") ? 167 var profilingStartedPromise = enableJSSampling && !Runtime.experiments.i sEnabled("timelineTracingJSProfile") ?
168 this._startProfilingOnAllTargets() : Promise.resolve(); 168 this._startProfilingOnAllTargets() : Promise.resolve();
169 var samplingFrequencyHz = WebInspector.moduleSetting("highResolutionCpuP rofiling").get() ? 10000 : 1000; 169 var samplingFrequencyHz = WebInspector.moduleSetting("highResolutionCpuP rofiling").get() ? 10000 : 1000;
170 var options = "sampling-frequency=" + samplingFrequencyHz; 170 var options = "sampling-frequency=" + samplingFrequencyHz;
171 var target = this._target; 171 var target = this._target;
172 var tracingManager = target.tracingManager; 172 var tracingManager = target.tracingManager;
173 target.resourceTreeModel.suspendReload(); 173 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target );
174 if (resourceTreeModel)
175 resourceTreeModel.suspendReload();
174 profilingStartedPromise.then(tracingManager.start.bind(tracingManager, t his, categories, options, onTraceStarted)); 176 profilingStartedPromise.then(tracingManager.start.bind(tracingManager, t his, categories, options, onTraceStarted));
175 /** 177 /**
176 * @param {?string} error 178 * @param {?string} error
177 */ 179 */
178 function onTraceStarted(error) 180 function onTraceStarted(error)
179 { 181 {
180 target.resourceTreeModel.resumeReload(); 182 if (resourceTreeModel)
183 resourceTreeModel.resumeReload();
181 if (callback) 184 if (callback)
182 callback(error); 185 callback(error);
183 } 186 }
184 }, 187 },
185 188
186 /** 189 /**
187 * @override 190 * @override
188 */ 191 */
189 tracingStarted: function() 192 tracingStarted: function()
190 { 193 {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 279
277 /** 280 /**
278 * @param {number} progress 281 * @param {number} progress
279 * @override 282 * @override
280 */ 283 */
281 eventsRetrievalProgress: function(progress) 284 eventsRetrievalProgress: function(progress)
282 { 285 {
283 this._delegate.loadingProgress(progress); 286 this._delegate.loadingProgress(progress);
284 } 287 }
285 } 288 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698