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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js

Issue 2249743006: [DevTools] Fill ExceptionDetails with more details, unify usage across protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: browser test Created 4 years, 4 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 * @param {!WebInspector.ConsoleMessage} a 491 * @param {!WebInspector.ConsoleMessage} a
492 * @param {!WebInspector.ConsoleMessage} b 492 * @param {!WebInspector.ConsoleMessage} b
493 * @return {number} 493 * @return {number}
494 */ 494 */
495 WebInspector.ConsoleMessage.timestampComparator = function(a, b) 495 WebInspector.ConsoleMessage.timestampComparator = function(a, b)
496 { 496 {
497 return a.timestamp - b.timestamp; 497 return a.timestamp - b.timestamp;
498 } 498 }
499 499
500 /** 500 /**
501 * @param {!RuntimeAgent.ExceptionDetails} exceptionDetails
502 * @return {string}
503 */
504 WebInspector.ConsoleMessage.simpleTextFromException = function(exceptionDetails)
505 {
506 var text = exceptionDetails.text;
507 if (exceptionDetails.exception && exceptionDetails.exception.description) {
508 var description = exceptionDetails.exception.description;
509 if (description.indexOf("\n") !== -1)
510 description = description.substring(0, description.indexOf("\n"));
511 text += " " + description;
512 }
513 return text;
514 }
515
516 /**
517 * @param {!WebInspector.Target} target
518 * @param {!RuntimeAgent.ExceptionDetails} exceptionDetails
519 * @param {string=} messageType
520 * @param {number=} timestamp
521 * @param {string=} forceUrl
522 * @return {!WebInspector.ConsoleMessage}
523 */
524 WebInspector.ConsoleMessage.fromException = function(target, exceptionDetails, m essageType, timestamp, forceUrl)
525 {
526 return new WebInspector.ConsoleMessage(
527 target,
528 WebInspector.ConsoleMessage.MessageSource.JS,
529 WebInspector.ConsoleMessage.MessageLevel.Error,
530 WebInspector.ConsoleMessage.simpleTextFromException(exceptionDetails),
531 messageType,
532 forceUrl || exceptionDetails.url,
533 exceptionDetails.lineNumber,
534 exceptionDetails.columnNumber,
535 undefined,
536 exceptionDetails.exception ? [WebInspector.RemoteObject.fromLocalObject( exceptionDetails.text), exceptionDetails.exception] : undefined,
537 exceptionDetails.stackTrace,
538 timestamp,
539 exceptionDetails.executionContextId,
540 exceptionDetails.scriptId);
541 }
542
543 /**
501 * @constructor 544 * @constructor
502 * @implements {LogAgent.Dispatcher} 545 * @implements {LogAgent.Dispatcher}
503 * @param {!WebInspector.ConsoleModel} console 546 * @param {!WebInspector.ConsoleModel} console
504 */ 547 */
505 WebInspector.LogDispatcher = function(console) 548 WebInspector.LogDispatcher = function(console)
506 { 549 {
507 this._console = console; 550 this._console = console;
508 } 551 }
509 552
510 WebInspector.LogDispatcher.prototype = { 553 WebInspector.LogDispatcher.prototype = {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, event.data); 656 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, event.data);
614 }, 657 },
615 658
616 __proto__: WebInspector.Object.prototype 659 __proto__: WebInspector.Object.prototype
617 } 660 }
618 661
619 /** 662 /**
620 * @type {!WebInspector.MultitargetConsoleModel} 663 * @type {!WebInspector.MultitargetConsoleModel}
621 */ 664 */
622 WebInspector.multitargetConsoleModel; 665 WebInspector.multitargetConsoleModel;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698