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

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

Issue 2139543002: [DevTools] Report console API calls through Runtime. (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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 undefined, 405 undefined,
406 timestamp, 406 timestamp,
407 undefined, 407 undefined,
408 undefined); 408 undefined);
409 consoleMessage.setRevokedExceptionId(exceptionId); 409 consoleMessage.setRevokedExceptionId(exceptionId);
410 this._runtimeModel.target().consoleModel.addMessage(consoleMessage); 410 this._runtimeModel.target().consoleModel.addMessage(consoleMessage);
411 }, 411 },
412 412
413 /** 413 /**
414 * @override 414 * @override
415 * @param {string} type
416 * @param {!Array.<!RuntimeAgent.RemoteObject>} args
417 * @param {number} executionContextId
418 * @param {number} timestamp
419 * @param {!RuntimeAgent.StackTrace=} stackTrace
420 */
421 consoleAPICalled: function(type, args, executionContextId, timestamp, stackT race)
422 {
423 var level = WebInspector.ConsoleMessage.MessageLevel.Log;
424 if (type === WebInspector.ConsoleMessage.MessageType.Debug)
425 level = WebInspector.ConsoleMessage.MessageLevel.Debug;
426 if (type === WebInspector.ConsoleMessage.MessageType.Error || type === W ebInspector.ConsoleMessage.MessageType.Assert)
427 level = WebInspector.ConsoleMessage.MessageLevel.Error;
428 if (type === WebInspector.ConsoleMessage.MessageType.Warning)
429 level = WebInspector.ConsoleMessage.MessageLevel.Warning;
430 if (type === WebInspector.ConsoleMessage.MessageType.Info)
431 level = WebInspector.ConsoleMessage.MessageLevel.Info;
432 var message = "";
433 if (args.length && typeof args[0].value === "string")
434 message = args[0].value;
435 else if (args.length && args[0].description)
436 message = args[0].description;
437 var callFrame = stackTrace && stackTrace.callFrames.length ? stackTrace. callFrames[0] : null;
438 var consoleMessage = new WebInspector.ConsoleMessage(
439 this._runtimeModel.target(),
440 WebInspector.ConsoleMessage.MessageSource.ConsoleAPI,
441 level,
442 /** @type {string} */ (message),
443 type,
444 callFrame ? callFrame.url : undefined,
445 callFrame ? callFrame.lineNumber + 1 : undefined,
446 callFrame ? callFrame.columnNumber + 1 : undefined,
447 undefined,
448 args,
449 stackTrace,
450 timestamp,
451 executionContextId,
452 undefined);
453 this._runtimeModel.target().consoleModel.addMessage(consoleMessage);
454 },
455
456 /**
457 * @override
415 * @param {!RuntimeAgent.RemoteObject} payload 458 * @param {!RuntimeAgent.RemoteObject} payload
416 * @param {!Object=} hints 459 * @param {!Object=} hints
417 */ 460 */
418 inspectRequested: function(payload, hints) 461 inspectRequested: function(payload, hints)
419 { 462 {
420 this._runtimeModel._inspectRequested(payload, hints); 463 this._runtimeModel._inspectRequested(payload, hints);
421 } 464 }
422 } 465 }
423 466
424 /** 467 /**
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 /** 1008 /**
966 * @return {boolean} 1009 * @return {boolean}
967 */ 1010 */
968 isNormalListenerType: function() 1011 isNormalListenerType: function()
969 { 1012 {
970 return this._listenerType === "normal"; 1013 return this._listenerType === "normal";
971 }, 1014 },
972 1015
973 __proto__: WebInspector.SDKObject.prototype 1016 __proto__: WebInspector.SDKObject.prototype
974 } 1017 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698