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

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: tests pass 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 undefined, 388 undefined,
389 timestamp, 389 timestamp,
390 undefined, 390 undefined,
391 undefined); 391 undefined);
392 consoleMessage.setRevokedExceptionId(exceptionId); 392 consoleMessage.setRevokedExceptionId(exceptionId);
393 this._runtimeModel.target().consoleModel.addMessage(consoleMessage); 393 this._runtimeModel.target().consoleModel.addMessage(consoleMessage);
394 }, 394 },
395 395
396 /** 396 /**
397 * @override 397 * @override
398 * @param {number} timestamp
399 * @param {string} type
400 * @param {!Array.<!RuntimeAgent.RemoteObject>} callArguments
401 * @param {number} executionContextId
402 * @param {!RuntimeAgent.StackTrace=} stackTrace
403 */
404 consoleAPICall: function(timestamp, type, callArguments, executionContextId, stackTrace)
405 {
406 var level = WebInspector.ConsoleMessage.MessageLevel.Log;
407 if (type === WebInspector.ConsoleMessage.MessageType.Debug)
408 level = WebInspector.ConsoleMessage.MessageLevel.Debug;
409 if (type === WebInspector.ConsoleMessage.MessageType.Error || type === W ebInspector.ConsoleMessage.MessageType.Assert)
410 level = WebInspector.ConsoleMessage.MessageLevel.Error;
411 if (type === WebInspector.ConsoleMessage.MessageType.Warning)
412 level = WebInspector.ConsoleMessage.MessageLevel.Warning;
413 if (type === WebInspector.ConsoleMessage.MessageType.Info)
414 level = WebInspector.ConsoleMessage.MessageLevel.Info;
415 var message = "";
416 if (callArguments.length && typeof callArguments[0].value === "string")
417 message = callArguments[0].value;
418 else if (callArguments.length && callArguments[0].description)
419 message = callArguments[0].description;
420 var callFrame = stackTrace && stackTrace.callFrames.length ? stackTrace. callFrames[0] : null;
421 var consoleMessage = new WebInspector.ConsoleMessage(
422 this._runtimeModel.target(),
423 WebInspector.ConsoleMessage.MessageSource.ConsoleAPI,
424 level,
425 /** @type {string} */ (message),
426 type,
427 callFrame ? callFrame.url : undefined,
428 callFrame ? callFrame.lineNumber : undefined,
429 callFrame ? callFrame.columnNumber : undefined,
430 undefined,
431 callArguments,
432 stackTrace,
433 timestamp,
434 executionContextId,
435 undefined);
436 this._runtimeModel.target().consoleModel.addMessage(consoleMessage);
437 },
438
439 /**
440 * @override
398 * @param {!RuntimeAgent.RemoteObject} payload 441 * @param {!RuntimeAgent.RemoteObject} payload
399 * @param {!Object=} hints 442 * @param {!Object=} hints
400 */ 443 */
401 inspectRequested: function(payload, hints) 444 inspectRequested: function(payload, hints)
402 { 445 {
403 this._runtimeModel._inspectRequested(payload, hints); 446 this._runtimeModel._inspectRequested(payload, hints);
404 } 447 }
405 } 448 }
406 449
407 /** 450 /**
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 /** 995 /**
953 * @return {boolean} 996 * @return {boolean}
954 */ 997 */
955 isNormalListenerType: function() 998 isNormalListenerType: function()
956 { 999 {
957 return this._listenerType === "normal"; 1000 return this._listenerType === "normal";
958 }, 1001 },
959 1002
960 __proto__: WebInspector.SDKObject.prototype 1003 __proto__: WebInspector.SDKObject.prototype
961 } 1004 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698