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

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 2887603002: DevTools: Attempt to get badges from StackTrace in console (Closed)
Patch Set: upstream Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
index 1359d4fcd127582c0076cd5e99708ba1551961f9..ee36d6472f34f467a2e4a420617092c9999c79cf 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -301,6 +301,25 @@ Console.ConsoleViewMessage = class {
* @return {?Element}
*/
_buildMessageBadge() {
+ var badgeElement = this._badgeElement();
+ if (!badgeElement)
+ return null;
+ badgeElement.classList.add('console-message-badge');
+ return badgeElement;
+ }
+
+ /**
+ * @return {?Element}
+ */
+ _badgeElement() {
+ if (this._message._url)
+ return this._badgePool.badgeForURL(new Common.ParsedURL(this._message._url));
+ if (this._message.stackTrace) {
+ for (var callFrame of this._message.stackTrace.callFrames) {
pfeldman 2017/05/16 20:30:06 What about async chain frames? You could go all th
einbinder 2017/05/16 20:41:34 Done.
+ if (callFrame.url)
+ return this._badgePool.badgeForURL(new Common.ParsedURL(callFrame.url));
pfeldman 2017/05/16 20:30:06 Do you want the first mapped url or any first url
einbinder 2017/05/16 20:41:34 I think I want the first URL for now. I want to tr
+ }
+ }
if (!this._message.executionContextId)
return null;
var runtimeModel = this._message.runtimeModel();
@@ -315,9 +334,7 @@ Console.ConsoleViewMessage = class {
var frame = resourceTreeModel.frameForId(executionContext.frameId);
if (!frame || !frame.parentFrame)
return null;
- var badgeElement = this._badgePool.badgeForFrame(frame);
- badgeElement.classList.add('console-message-badge');
- return badgeElement;
+ return this._badgePool.badgeForFrame(frame);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698