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

Side by Side Diff: Source/devtools/front_end/timeline/TracingModel.js

Issue 658363002: Fix null pointer exception when attempting to load an image without the target (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFrameModel.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The Chromium Authors. All rights reserved. 2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /** 7 /**
8 * @constructor 8 * @constructor
9 */ 9 */
10 WebInspector.TracingModel = function() 10 WebInspector.TracingModel = function()
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 { 314 {
315 this._tracingModel.tracingComplete(); 315 this._tracingModel.tracingComplete();
316 } 316 }
317 } 317 }
318 318
319 319
320 /** 320 /**
321 * @constructor 321 * @constructor
322 * @param {string} category 322 * @param {string} category
323 * @param {string} name 323 * @param {string} name
324 * @param {string} phase 324 * @param {!WebInspector.TracingModel.Phase} phase
325 * @param {number} startTime 325 * @param {number} startTime
326 * @param {?WebInspector.TracingModel.Thread} thread 326 * @param {!WebInspector.TracingModel.Thread} thread
327 */ 327 */
328 WebInspector.TracingModel.Event = function(category, name, phase, startTime, thr ead) 328 WebInspector.TracingModel.Event = function(category, name, phase, startTime, thr ead)
329 { 329 {
330 /** @type {string} */
330 this.category = category; 331 this.category = category;
332 /** @type {string} */
331 this.name = name; 333 this.name = name;
334 /** @type {!WebInspector.TracingModel.Phase} */
332 this.phase = phase; 335 this.phase = phase;
336 /** @type {number} */
333 this.startTime = startTime; 337 this.startTime = startTime;
338 /** @type {!WebInspector.TracingModel.Thread} */
334 this.thread = thread; 339 this.thread = thread;
335 this.args = {}; 340 this.args = {};
336 341
337 /** @type {?string} */ 342 /** @type {?string} */
338 this.warning = null; 343 this.warning = null;
339 /** @type {?WebInspector.TracingModel.Event} */ 344 /** @type {?WebInspector.TracingModel.Event} */
340 this.initiator = null; 345 this.initiator = null;
341 /** @type {?Array.<!ConsoleAgent.CallFrame>} */ 346 /** @type {?Array.<!ConsoleAgent.CallFrame>} */
342 this.stackTrace = null; 347 this.stackTrace = null;
343 /** @type {?Element} */ 348 /** @type {?Element} */
344 this.previewElement = null; 349 this.previewElement = null;
345 /** @type {?string} */ 350 /** @type {?string} */
346 this.imageURL = null; 351 this.imageURL = null;
347 /** @type {number} */ 352 /** @type {number} */
348 this.backendNodeId = 0; 353 this.backendNodeId = 0;
349 354
350 /** @type {number} */ 355 /** @type {number} */
351 this.selfTime = 0; 356 this.selfTime = 0;
352 } 357 }
353 358
354 /** 359 /**
355 * @param {!WebInspector.TracingManager.EventPayload} payload 360 * @param {!WebInspector.TracingManager.EventPayload} payload
356 * @param {?WebInspector.TracingModel.Thread} thread 361 * @param {!WebInspector.TracingModel.Thread} thread
357 * @return {!WebInspector.TracingModel.Event} 362 * @return {!WebInspector.TracingModel.Event}
358 */ 363 */
359 WebInspector.TracingModel.Event.fromPayload = function(payload, thread) 364 WebInspector.TracingModel.Event.fromPayload = function(payload, thread)
360 { 365 {
361 var event = new WebInspector.TracingModel.Event(payload.cat, payload.name, p ayload.ph, payload.ts / 1000, thread); 366 var event = new WebInspector.TracingModel.Event(payload.cat, payload.name, / ** @type {!WebInspector.TracingModel.Phase} */ (payload.ph), payload.ts / 1000, thread);
362 if (payload.args) 367 if (payload.args)
363 event.addArgs(payload.args); 368 event.addArgs(payload.args);
364 else 369 else
365 console.error("Missing mandatory event argument 'args' at " + payload.ts / 1000); 370 console.error("Missing mandatory event argument 'args' at " + payload.ts / 1000);
366 if (typeof payload.dur === "number") 371 if (typeof payload.dur === "number")
367 event.setEndTime((payload.ts + payload.dur) / 1000); 372 event.setEndTime((payload.ts + payload.dur) / 1000);
368 if (payload.id) 373 if (payload.id)
369 event.id = payload.id; 374 event.id = payload.id;
370 return event; 375 return event;
371 } 376 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 // startTime's are equal, so both events got placed into the result array. 446 // startTime's are equal, so both events got placed into the result array.
442 return a.startTime - b.startTime || -1; 447 return a.startTime - b.startTime || -1;
443 } 448 }
444 449
445 /** 450 /**
446 * @constructor 451 * @constructor
447 * @extends {WebInspector.TracingModel.Event} 452 * @extends {WebInspector.TracingModel.Event}
448 * @param {string} category 453 * @param {string} category
449 * @param {string} name 454 * @param {string} name
450 * @param {number} startTime 455 * @param {number} startTime
451 * @param {?WebInspector.TracingModel.Thread} thread 456 * @param {!WebInspector.TracingModel.Thread} thread
452 */ 457 */
453 WebInspector.TracingModel.ObjectSnapshot = function(category, name, startTime, t hread) 458 WebInspector.TracingModel.ObjectSnapshot = function(category, name, startTime, t hread)
454 { 459 {
455 WebInspector.TracingModel.Event.call(this, category, name, WebInspector.Trac ingModel.Phase.SnapshotObject, startTime, thread); 460 WebInspector.TracingModel.Event.call(this, category, name, WebInspector.Trac ingModel.Phase.SnapshotObject, startTime, thread);
456 } 461 }
457 462
458 /** 463 /**
459 * @param {!WebInspector.TracingManager.EventPayload} payload 464 * @param {!WebInspector.TracingManager.EventPayload} payload
460 * @param {?WebInspector.TracingModel.Thread} thread 465 * @param {!WebInspector.TracingModel.Thread} thread
461 * @return {!WebInspector.TracingModel.ObjectSnapshot} 466 * @return {!WebInspector.TracingModel.ObjectSnapshot}
462 */ 467 */
463 WebInspector.TracingModel.ObjectSnapshot.fromPayload = function(payload, thread) 468 WebInspector.TracingModel.ObjectSnapshot.fromPayload = function(payload, thread)
464 { 469 {
465 var snapshot = new WebInspector.TracingModel.ObjectSnapshot(payload.cat, pay load.name, payload.ts / 1000, thread); 470 var snapshot = new WebInspector.TracingModel.ObjectSnapshot(payload.cat, pay load.name, payload.ts / 1000, thread);
466 if (payload.id) 471 if (payload.id)
467 snapshot.id = payload.id; 472 snapshot.id = payload.id;
468 if (!payload.args || !payload.args["snapshot"]) { 473 if (!payload.args || !payload.args["snapshot"]) {
469 console.error("Missing mandatory 'snapshot' argument at " + payload.ts / 1000); 474 console.error("Missing mandatory 'snapshot' argument at " + payload.ts / 1000);
470 return snapshot; 475 return snapshot;
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 /** 874 /**
870 * @return {!Array.<!WebInspector.TracingModel.Event>} 875 * @return {!Array.<!WebInspector.TracingModel.Event>}
871 */ 876 */
872 asyncEvents: function() 877 asyncEvents: function()
873 { 878 {
874 return this._asyncEvents; 879 return this._asyncEvents;
875 }, 880 },
876 881
877 __proto__: WebInspector.TracingModel.NamedObject.prototype 882 __proto__: WebInspector.TracingModel.NamedObject.prototype
878 } 883 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFrameModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698