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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js

Issue 2749383005: [Devtools] Add stacktrace for Page.frameAttached event (Closed)
Patch Set: changes Created 3 years, 9 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 | « third_party/WebKit/Source/core/inspector/browser_protocol.json ('k') | 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/sdk/ResourceTreeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
index 2464fdd987868dcc970c752990692704be97aee1..d7dd5aaa6a2aa51a7a814cb21a4c32b8a4113630 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
@@ -138,17 +138,22 @@ SDK.ResourceTreeModel = class extends SDK.SDKModel {
/**
* @param {!Protocol.Page.FrameId} frameId
* @param {?Protocol.Page.FrameId} parentFrameId
+ * @param {!Protocol.Runtime.StackTrace=} stackTrace
* @return {?SDK.ResourceTreeFrame}
*/
- _frameAttached(frameId, parentFrameId) {
+ _frameAttached(frameId, parentFrameId, stackTrace) {
// Do nothing unless cached resource tree is processed - it will overwrite everything.
if (!this._cachedResourcesProcessed && parentFrameId)
return null;
if (this._frames.has(frameId))
return null;
+ var callFrames = null;
+ if (stackTrace && stackTrace.callFrames)
+ callFrames = stackTrace.callFrames;
+
var parentFrame = parentFrameId ? (this._frames.get(parentFrameId) || null) : null;
- var frame = new SDK.ResourceTreeFrame(this, parentFrame, frameId);
+ var frame = new SDK.ResourceTreeFrame(this, parentFrame, frameId, null, callFrames);
if (frame.isMainFrame() && this.mainFrame) {
// Navigation to the new backend process.
this._frameDetached(this.mainFrame.id);
@@ -299,7 +304,7 @@ SDK.ResourceTreeModel = class extends SDK.SDKModel {
*/
_addFramesRecursively(parentFrame, frameTreePayload) {
var framePayload = frameTreePayload.frame;
- var frame = new SDK.ResourceTreeFrame(this, parentFrame, framePayload.id, framePayload);
+ var frame = new SDK.ResourceTreeFrame(this, parentFrame, framePayload.id, framePayload, null);
this._addFrame(frame);
var frameResource = this._createResourceFromFramePayload(
@@ -473,9 +478,10 @@ SDK.ResourceTreeFrame = class {
* @param {!SDK.ResourceTreeModel} model
* @param {?SDK.ResourceTreeFrame} parentFrame
* @param {!Protocol.Page.FrameId} frameId
- * @param {!Protocol.Page.Frame=} payload
+ * @param {?Protocol.Page.Frame} payload
+ * @param {?Array<!Protocol.Runtime.CallFrame>} creationStackTrace
*/
- constructor(model, parentFrame, frameId, payload) {
+ constructor(model, parentFrame, frameId, payload, creationStackTrace) {
this._model = model;
this._parentFrame = parentFrame;
this._id = frameId;
@@ -489,6 +495,8 @@ SDK.ResourceTreeFrame = class {
this._mimeType = payload.mimeType;
}
+ this._creationStackTrace = creationStackTrace;
+
/**
* @type {!Array.<!SDK.ResourceTreeFrame>}
*/
@@ -767,9 +775,10 @@ SDK.PageDispatcher = class {
* @override
* @param {!Protocol.Page.FrameId} frameId
* @param {!Protocol.Page.FrameId} parentFrameId
+ * @param {!Protocol.Runtime.StackTrace=} stackTrace
*/
- frameAttached(frameId, parentFrameId) {
- this._resourceTreeModel._frameAttached(frameId, parentFrameId);
+ frameAttached(frameId, parentFrameId, stackTrace) {
+ this._resourceTreeModel._frameAttached(frameId, parentFrameId, stackTrace);
}
/**
« no previous file with comments | « third_party/WebKit/Source/core/inspector/browser_protocol.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698