Diff
Modified: trunk/LayoutTests/ChangeLog (141402 => 141403)
--- trunk/LayoutTests/ChangeLog 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/LayoutTests/ChangeLog 2013-01-31 12:45:12 UTC (rev 141403)
@@ -1,3 +1,13 @@
+2013-01-31 Andrey Adaikin <aand...@chromium.org>
+
+ Web Inspector: [Canvas] remove invalid canvas profile trace logs upon frame navigation
+ https://bugs.webkit.org/show_bug.cgi?id=108454
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/profiler/canvas-profiler-test.js:
+ (initialize_CanvasWebGLProfilerTest.InspectorTest.enableCanvasAgent.InspectorBackend.registerCanvasDispatcher):
+
2013-01-31 Andrey Lushnikov <lushni...@chromium.org>
Web Inspector: DTE doesn't highlight words if the selected one is the last in the line
Modified: trunk/LayoutTests/inspector/profiler/canvas-profiler-test.js (141402 => 141403)
--- trunk/LayoutTests/inspector/profiler/canvas-profiler-test.js 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/LayoutTests/inspector/profiler/canvas-profiler-test.js 2013-01-31 12:45:12 UTC (rev 141403)
@@ -5,7 +5,8 @@
var dispatcher = InspectorBackend._domainDispatchers["Canvas"];
if (!dispatcher) {
InspectorBackend.registerCanvasDispatcher({
- contextCreated: function() {}
+ contextCreated: function() {},
+ traceLogsRemoved: function() {}
});
}
Modified: trunk/Source/WebCore/ChangeLog (141402 => 141403)
--- trunk/Source/WebCore/ChangeLog 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/Source/WebCore/ChangeLog 2013-01-31 12:45:12 UTC (rev 141403)
@@ -1,3 +1,52 @@
+2013-01-31 Andrey Adaikin <aand...@chromium.org>
+
+ Web Inspector: [Canvas] remove invalid canvas profile trace logs upon frame navigation
+ https://bugs.webkit.org/show_bug.cgi?id=108454
+
+ Reviewed by Pavel Feldman.
+
+ When canvas profile trace logs stored in the backend get destroyed (for example, on frame navigation), send an event to frontend and update the UI.
+ Drive-by: replace String types to corresponding TypeBuilder::Canvas::* typedefs.
+
+ * inspector/InjectedScriptCanvasModule.cpp:
+ (WebCore::InjectedScriptCanvasModule::captureFrame):
+ (WebCore::InjectedScriptCanvasModule::startCapturing):
+ (WebCore::InjectedScriptCanvasModule::callStartCapturingFunction):
+ (WebCore::InjectedScriptCanvasModule::stopCapturing):
+ (WebCore::InjectedScriptCanvasModule::dropTraceLog):
+ (WebCore::InjectedScriptCanvasModule::callVoidFunctionWithTraceLogIdArgument):
+ (WebCore::InjectedScriptCanvasModule::traceLog):
+ (WebCore::InjectedScriptCanvasModule::replayTraceLog):
+ (WebCore::InjectedScriptCanvasModule::resourceInfo):
+ (WebCore::InjectedScriptCanvasModule::resourceState):
+ * inspector/InjectedScriptCanvasModule.h:
+ (InjectedScriptCanvasModule):
+ * inspector/Inspector.json:
+ * inspector/InspectorCanvasAgent.cpp:
+ (WebCore::InspectorCanvasAgent::dropTraceLog):
+ (WebCore::InspectorCanvasAgent::stopCapturing):
+ (WebCore::InspectorCanvasAgent::getTraceLog):
+ (WebCore::InspectorCanvasAgent::replayTraceLog):
+ (WebCore::InspectorCanvasAgent::getResourceInfo):
+ (WebCore::InspectorCanvasAgent::getResourceState):
+ (WebCore::InspectorCanvasAgent::frameNavigated):
+ * inspector/InspectorCanvasAgent.h:
+ (InspectorCanvasAgent):
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::hasIdForFrame):
+ (WebCore):
+ * inspector/InspectorPageAgent.h:
+ (InspectorPageAgent):
+ * inspector/front-end/CanvasProfileView.js:
+ (WebInspector.CanvasProfileType.prototype._runSingleFrameCapturing):
+ (WebInspector.CanvasProfileType.prototype._startFrameCapturing):
+ (WebInspector.CanvasProfileType.prototype._didStartCapturingFrame):
+ (WebInspector.CanvasProfileType.prototype._traceLogsRemoved):
+ (WebInspector.CanvasDispatcher.prototype.contextCreated):
+ (WebInspector.CanvasDispatcher.prototype.traceLogsRemoved):
+ (WebInspector.CanvasProfileHeader):
+ (WebInspector.CanvasProfileHeader.prototype.frameId):
+
2013-01-31 Andrey Lushnikov <lushni...@chromium.org>
Web Inspector: DTE doesn't highlight words if the selected one is the last in the line
Modified: trunk/Source/WebCore/inspector/InjectedScriptCanvasModule.cpp (141402 => 141403)
--- trunk/Source/WebCore/inspector/InjectedScriptCanvasModule.cpp 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/Source/WebCore/inspector/InjectedScriptCanvasModule.cpp 2013-01-31 12:45:12 UTC (rev 141403)
@@ -40,6 +40,13 @@
#include "ScriptFunctionCall.h"
#include "ScriptObject.h"
+using WebCore::TypeBuilder::Array;
+using WebCore::TypeBuilder::Canvas::ResourceId;
+using WebCore::TypeBuilder::Canvas::ResourceInfo;
+using WebCore::TypeBuilder::Canvas::ResourceState;
+using WebCore::TypeBuilder::Canvas::TraceLog;
+using WebCore::TypeBuilder::Canvas::TraceLogId;
+
namespace WebCore {
InjectedScriptCanvasModule::InjectedScriptCanvasModule()
@@ -84,17 +91,17 @@
return ScriptObject(context.scriptState(), resultValue);
}
-void InjectedScriptCanvasModule::captureFrame(ErrorString* errorString, String* traceLogId)
+void InjectedScriptCanvasModule::captureFrame(ErrorString* errorString, TraceLogId* traceLogId)
{
callStartCapturingFunction("captureFrame", errorString, traceLogId);
}
-void InjectedScriptCanvasModule::startCapturing(ErrorString* errorString, String* traceLogId)
+void InjectedScriptCanvasModule::startCapturing(ErrorString* errorString, TraceLogId* traceLogId)
{
callStartCapturingFunction("startCapturing", errorString, traceLogId);
}
-void InjectedScriptCanvasModule::callStartCapturingFunction(const String& functionName, ErrorString* errorString, String* traceLogId)
+void InjectedScriptCanvasModule::callStartCapturingFunction(const String& functionName, ErrorString* errorString, TraceLogId* traceLogId)
{
ScriptFunctionCall function(injectedScriptObject(), functionName);
RefPtr<InspectorValue> resultValue;
@@ -103,17 +110,17 @@
*errorString = "Internal error: " + functionName;
}
-void InjectedScriptCanvasModule::stopCapturing(ErrorString* errorString, const String& traceLogId)
+void InjectedScriptCanvasModule::stopCapturing(ErrorString* errorString, const TraceLogId& traceLogId)
{
callVoidFunctionWithTraceLogIdArgument("stopCapturing", errorString, traceLogId);
}
-void InjectedScriptCanvasModule::dropTraceLog(ErrorString* errorString, const String& traceLogId)
+void InjectedScriptCanvasModule::dropTraceLog(ErrorString* errorString, const TraceLogId& traceLogId)
{
callVoidFunctionWithTraceLogIdArgument("dropTraceLog", errorString, traceLogId);
}
-void InjectedScriptCanvasModule::callVoidFunctionWithTraceLogIdArgument(const String& functionName, ErrorString* errorString, const String& traceLogId)
+void InjectedScriptCanvasModule::callVoidFunctionWithTraceLogIdArgument(const String& functionName, ErrorString* errorString, const TraceLogId& traceLogId)
{
ScriptFunctionCall function(injectedScriptObject(), functionName);
function.appendArgument(traceLogId);
@@ -124,7 +131,7 @@
*errorString = "Internal error: " + functionName;
}
-void InjectedScriptCanvasModule::traceLog(ErrorString* errorString, const String& traceLogId, const int* startOffset, const int* maxLength, RefPtr<TypeBuilder::Canvas::TraceLog>* traceLog)
+void InjectedScriptCanvasModule::traceLog(ErrorString* errorString, const TraceLogId& traceLogId, const int* startOffset, const int* maxLength, RefPtr<TraceLog>* traceLog)
{
ScriptFunctionCall function(injectedScriptObject(), "traceLog");
function.appendArgument(traceLogId);
@@ -139,10 +146,10 @@
*errorString = "Internal error: traceLog";
return;
}
- *traceLog = TypeBuilder::Canvas::TraceLog::runtimeCast(resultValue);
+ *traceLog = TraceLog::runtimeCast(resultValue);
}
-void InjectedScriptCanvasModule::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, RefPtr<TypeBuilder::Canvas::ResourceState>* result)
+void InjectedScriptCanvasModule::replayTraceLog(ErrorString* errorString, const TraceLogId& traceLogId, int stepNo, RefPtr<ResourceState>* result)
{
ScriptFunctionCall function(injectedScriptObject(), "replayTraceLog");
function.appendArgument(traceLogId);
@@ -154,10 +161,10 @@
*errorString = "Internal error: replayTraceLog";
return;
}
- *result = TypeBuilder::Canvas::ResourceState::runtimeCast(resultValue);
+ *result = ResourceState::runtimeCast(resultValue);
}
-void InjectedScriptCanvasModule::resourceInfo(ErrorString* errorString, const String& resourceId, RefPtr<TypeBuilder::Canvas::ResourceInfo>* result)
+void InjectedScriptCanvasModule::resourceInfo(ErrorString* errorString, const ResourceId& resourceId, RefPtr<ResourceInfo>* result)
{
ScriptFunctionCall function(injectedScriptObject(), "resourceInfo");
function.appendArgument(resourceId);
@@ -168,10 +175,10 @@
*errorString = "Internal error: resourceInfo";
return;
}
- *result = TypeBuilder::Canvas::ResourceInfo::runtimeCast(resultValue);
+ *result = ResourceInfo::runtimeCast(resultValue);
}
-void InjectedScriptCanvasModule::resourceState(ErrorString* errorString, const String& traceLogId, const String& resourceId, RefPtr<TypeBuilder::Canvas::ResourceState>* result)
+void InjectedScriptCanvasModule::resourceState(ErrorString* errorString, const TraceLogId& traceLogId, const ResourceId& resourceId, RefPtr<ResourceState>* result)
{
ScriptFunctionCall function(injectedScriptObject(), "resourceState");
function.appendArgument(traceLogId);
@@ -183,7 +190,7 @@
*errorString = "Internal error: resourceState";
return;
}
- *result = TypeBuilder::Canvas::ResourceState::runtimeCast(resultValue);
+ *result = ResourceState::runtimeCast(resultValue);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/inspector/InjectedScriptCanvasModule.h (141402 => 141403)
--- trunk/Source/WebCore/inspector/InjectedScriptCanvasModule.h 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/Source/WebCore/inspector/InjectedScriptCanvasModule.h 2013-01-31 12:45:12 UTC (rev 141403)
@@ -55,14 +55,14 @@
ScriptObject wrapWebGLContext(const ScriptObject&);
#endif
- void captureFrame(ErrorString*, String*);
- void startCapturing(ErrorString*, String*);
- void stopCapturing(ErrorString*, const String&);
- void dropTraceLog(ErrorString*, const String&);
+ void captureFrame(ErrorString*, TypeBuilder::Canvas::TraceLogId*);
+ void startCapturing(ErrorString*, TypeBuilder::Canvas::TraceLogId*);
+ void stopCapturing(ErrorString*, const TypeBuilder::Canvas::TraceLogId&);
+ void dropTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogId&);
void traceLog(ErrorString*, const String&, const int*, const int*, RefPtr<TypeBuilder::Canvas::TraceLog>*);
- void replayTraceLog(ErrorString*, const String&, int, RefPtr<TypeBuilder::Canvas::ResourceState>*);
- void resourceInfo(ErrorString*, const String&, RefPtr<TypeBuilder::Canvas::ResourceInfo>*);
- void resourceState(ErrorString*, const String&, const String&, RefPtr<TypeBuilder::Canvas::ResourceState>*);
+ void replayTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogId&, int, RefPtr<TypeBuilder::Canvas::ResourceState>*);
+ void resourceInfo(ErrorString*, const TypeBuilder::Canvas::ResourceId&, RefPtr<TypeBuilder::Canvas::ResourceInfo>*);
+ void resourceState(ErrorString*, const TypeBuilder::Canvas::TraceLogId&, const TypeBuilder::Canvas::ResourceId&, RefPtr<TypeBuilder::Canvas::ResourceState>*);
private:
ScriptObject callWrapContextFunction(const String&, const ScriptObject&);
Modified: trunk/Source/WebCore/inspector/Inspector.json (141402 => 141403)
--- trunk/Source/WebCore/inspector/Inspector.json 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/Source/WebCore/inspector/Inspector.json 2013-01-31 12:45:12 UTC (rev 141403)
@@ -3419,6 +3419,14 @@
{ "name": "frameId", "$ref": "Network.FrameId", "description": "Identifier of the frame containing a canvas with a context." }
],
"description": "Fired when a canvas context has been created in the given frame. The context may not be instrumented (see hasUninstrumentedCanvases command)."
+ },
+ {
+ "name": "traceLogsRemoved",
+ "parameters": [
+ { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "If given, trace logs from the given frame were removed." },
+ { "name": "traceLogId", "$ref": "TraceLogId", "optional": true, "description": "If given, trace log with the given ID was removed." }
+ ],
+ "description": "Fired when a set of trace logs were removed from the backend. If no parameters are given, all trace logs were removed."
}
]
},
Modified: trunk/Source/WebCore/inspector/InspectorCanvasAgent.cpp (141402 => 141403)
--- trunk/Source/WebCore/inspector/InspectorCanvasAgent.cpp 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/Source/WebCore/inspector/InspectorCanvasAgent.cpp 2013-01-31 12:45:12 UTC (rev 141403)
@@ -51,6 +51,8 @@
#include "ScriptProfiler.h"
#include "ScriptState.h"
+using WebCore::TypeBuilder::Array;
+using WebCore::TypeBuilder::Canvas::ResourceId;
using WebCore::TypeBuilder::Canvas::ResourceInfo;
using WebCore::TypeBuilder::Canvas::ResourceState;
using WebCore::TypeBuilder::Canvas::TraceLog;
@@ -114,7 +116,7 @@
m_framesWithUninstrumentedCanvases.clear();
}
-void InspectorCanvasAgent::dropTraceLog(ErrorString* errorString, const String& traceLogId)
+void InspectorCanvasAgent::dropTraceLog(ErrorString* errorString, const TraceLogId& traceLogId)
{
InjectedScriptCanvasModule module = injectedScriptCanvasModule(errorString, traceLogId);
if (!module.hasNoValue())
@@ -148,35 +150,35 @@
module.startCapturing(errorString, traceLogId);
}
-void InspectorCanvasAgent::stopCapturing(ErrorString* errorString, const String& traceLogId)
+void InspectorCanvasAgent::stopCapturing(ErrorString* errorString, const TraceLogId& traceLogId)
{
InjectedScriptCanvasModule module = injectedScriptCanvasModule(errorString, traceLogId);
if (!module.hasNoValue())
module.stopCapturing(errorString, traceLogId);
}
-void InspectorCanvasAgent::getTraceLog(ErrorString* errorString, const String& traceLogId, const int* startOffset, const int* maxLength, RefPtr<TraceLog>& traceLog)
+void InspectorCanvasAgent::getTraceLog(ErrorString* errorString, const TraceLogId& traceLogId, const int* startOffset, const int* maxLength, RefPtr<TraceLog>& traceLog)
{
InjectedScriptCanvasModule module = injectedScriptCanvasModule(errorString, traceLogId);
if (!module.hasNoValue())
module.traceLog(errorString, traceLogId, startOffset, maxLength, &traceLog);
}
-void InspectorCanvasAgent::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, RefPtr<ResourceState>& result)
+void InspectorCanvasAgent::replayTraceLog(ErrorString* errorString, const TraceLogId& traceLogId, int stepNo, RefPtr<ResourceState>& result)
{
InjectedScriptCanvasModule module = injectedScriptCanvasModule(errorString, traceLogId);
if (!module.hasNoValue())
module.replayTraceLog(errorString, traceLogId, stepNo, &result);
}
-void InspectorCanvasAgent::getResourceInfo(ErrorString* errorString, const String& resourceId, RefPtr<ResourceInfo>& result)
+void InspectorCanvasAgent::getResourceInfo(ErrorString* errorString, const ResourceId& resourceId, RefPtr<ResourceInfo>& result)
{
InjectedScriptCanvasModule module = injectedScriptCanvasModule(errorString, resourceId);
if (!module.hasNoValue())
module.resourceInfo(errorString, resourceId, &result);
}
-void InspectorCanvasAgent::getResourceState(ErrorString* errorString, const String& traceLogId, const String& resourceId, RefPtr<ResourceState>& result)
+void InspectorCanvasAgent::getResourceState(ErrorString* errorString, const TraceLogId& traceLogId, const ResourceId& resourceId, RefPtr<ResourceState>& result)
{
InjectedScriptCanvasModule module = injectedScriptCanvasModule(errorString, traceLogId);
if (!module.hasNoValue())
@@ -302,11 +304,16 @@
{
if (!m_enabled)
return;
- if (frame == m_pageAgent->mainFrame())
+ if (frame == m_pageAgent->mainFrame()) {
m_framesWithUninstrumentedCanvases.clear();
- else {
+ m_frontend->traceLogsRemoved(0, 0);
+ } else {
while (frame) {
m_framesWithUninstrumentedCanvases.remove(frame);
+ if (m_pageAgent->hasIdForFrame(frame)) {
+ String frameId = m_pageAgent->frameId(frame);
+ m_frontend->traceLogsRemoved(&frameId, 0);
+ }
frame = frame->tree()->traverseNext();
}
}
Modified: trunk/Source/WebCore/inspector/InspectorCanvasAgent.h (141402 => 141403)
--- trunk/Source/WebCore/inspector/InspectorCanvasAgent.h 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/Source/WebCore/inspector/InspectorCanvasAgent.h 2013-01-31 12:45:12 UTC (rev 141403)
@@ -79,15 +79,15 @@
// Called from the front-end.
virtual void enable(ErrorString*);
virtual void disable(ErrorString*);
- virtual void dropTraceLog(ErrorString*, const String&);
+ virtual void dropTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogId&);
virtual void hasUninstrumentedCanvases(ErrorString*, bool*);
virtual void captureFrame(ErrorString*, const TypeBuilder::Network::FrameId*, TypeBuilder::Canvas::TraceLogId*);
virtual void startCapturing(ErrorString*, const TypeBuilder::Network::FrameId*, TypeBuilder::Canvas::TraceLogId*);
- virtual void stopCapturing(ErrorString*, const String&);
- virtual void getTraceLog(ErrorString*, const String&, const int*, const int*, RefPtr<TypeBuilder::Canvas::TraceLog>&);
- virtual void replayTraceLog(ErrorString*, const String&, int, RefPtr<TypeBuilder::Canvas::ResourceState>&);
- virtual void getResourceInfo(ErrorString*, const String&, RefPtr<TypeBuilder::Canvas::ResourceInfo>&);
- virtual void getResourceState(ErrorString*, const String&, const String&, RefPtr<TypeBuilder::Canvas::ResourceState>&);
+ virtual void stopCapturing(ErrorString*, const TypeBuilder::Canvas::TraceLogId&);
+ virtual void getTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogId&, const int*, const int*, RefPtr<TypeBuilder::Canvas::TraceLog>&);
+ virtual void replayTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogId&, int, RefPtr<TypeBuilder::Canvas::ResourceState>&);
+ virtual void getResourceInfo(ErrorString*, const TypeBuilder::Canvas::ResourceId&, RefPtr<TypeBuilder::Canvas::ResourceInfo>&);
+ virtual void getResourceState(ErrorString*, const TypeBuilder::Canvas::TraceLogId&, const TypeBuilder::Canvas::ResourceId&, RefPtr<TypeBuilder::Canvas::ResourceState>&);
private:
InspectorCanvasAgent(InstrumentingAgents*, InspectorCompositeState*, InspectorPageAgent*, InjectedScriptManager*);
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (141402 => 141403)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2013-01-31 12:45:12 UTC (rev 141403)
@@ -879,6 +879,11 @@
return identifier;
}
+bool InspectorPageAgent::hasIdForFrame(Frame* frame) const
+{
+ return frame && m_frameToIdentifier.contains(frame);
+}
+
String InspectorPageAgent::loaderId(DocumentLoader* loader)
{
if (!loader)
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (141402 => 141403)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.h 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h 2013-01-31 12:45:12 UTC (rev 141403)
@@ -165,6 +165,7 @@
String createIdentifier();
Frame* frameForId(const String& frameId);
String frameId(Frame*);
+ bool hasIdForFrame(Frame*) const;
String loaderId(DocumentLoader*);
Frame* assertFrame(ErrorString*, const String& frameId);
String scriptPreprocessor() { return m_scriptPreprocessor; }
Modified: trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js (141402 => 141403)
--- trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js 2013-01-31 12:43:15 UTC (rev 141402)
+++ trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js 2013-01-31 12:45:12 UTC (rev 141403)
@@ -456,7 +456,8 @@
*/
_runSingleFrameCapturing: function(profilesPanel)
{
- CanvasAgent.captureFrame(this._selectedFrameId(), this._didStartCapturingFrame.bind(this, profilesPanel));
+ var frameId = this._selectedFrameId();
+ CanvasAgent.captureFrame(frameId, this._didStartCapturingFrame.bind(this, profilesPanel, frameId));
},
/**
@@ -464,7 +465,8 @@
*/
_startFrameCapturing: function(profilesPanel)
{
- CanvasAgent.startCapturing(this._selectedFrameId(), this._didStartCapturingFrame.bind(this, profilesPanel));
+ var frameId = this._selectedFrameId();
+ CanvasAgent.startCapturing(frameId, this._didStartCapturingFrame.bind(this, profilesPanel, frameId));
},
_stopFrameCapturing: function()
@@ -483,14 +485,15 @@
/**
* @param {WebInspector.ProfilesPanel} profilesPanel
+ * @param {string|undefined} frameId
* @param {?Protocol.Error} error
* @param {CanvasAgent.TraceLogId} traceLogId
*/
- _didStartCapturingFrame: function(profilesPanel, error, traceLogId)
+ _didStartCapturingFrame: function(profilesPanel, frameId, error, traceLogId)
{
if (error || this._lastProfileHeader && this._lastProfileHeader.traceLogId() === traceLogId)
return;
- var profileHeader = new WebInspector.CanvasProfileHeader(this, WebInspector.UIString("Trace Log %d", this._nextProfileUid), this._nextProfileUid, traceLogId);
+ var profileHeader = new WebInspector.CanvasProfileHeader(this, WebInspector.UIString("Trace Log %d", this._nextProfileUid), this._nextProfileUid, traceLogId, frameId);
++this._nextProfileUid;
this._lastProfileHeader = profileHeader;
profilesPanel.addProfileHeader(profileHeader);
@@ -640,6 +643,28 @@
},
/**
+ * @param {NetworkAgent.FrameId=} frameId
+ * @param {CanvasAgent.TraceLogId=} traceLogId
+ */
+ _traceLogsRemoved: function(frameId, traceLogId)
+ {
+ var sidebarElementsToDelete = [];
+ var sidebarElements = /** @type {!Array.<WebInspector.ProfileSidebarTreeElement>} */ ((this.treeElement && this.treeElement.children) || []);
+ for (var i = 0, n = sidebarElements.length; i < n; ++i) {
+ var header = /** @type {WebInspector.CanvasProfileHeader} */ (sidebarElements[i].profile);
+ if (!header)
+ continue;
+ if (frameId && frameId !== header.frameId())
+ continue;
+ if (traceLogId && traceLogId !== header.traceLogId())
+ continue;
+ sidebarElementsToDelete.push(sidebarElements[i]);
+ }
+ for (var i = 0, n = sidebarElementsToDelete.length; i < n; ++i)
+ sidebarElementsToDelete[i].ondelete();
+ },
+
+ /**
* @return {string|undefined}
*/
_selectedFrameId: function()
@@ -675,6 +700,15 @@
contextCreated: function(frameId)
{
this._profileType._contextCreated(frameId);
+ },
+
+ /**
+ * @param {NetworkAgent.FrameId=} frameId
+ * @param {CanvasAgent.TraceLogId=} traceLogId
+ */
+ traceLogsRemoved: function(frameId, traceLogId)
+ {
+ this._profileType._traceLogsRemoved(frameId, traceLogId);
}
}
@@ -685,12 +719,14 @@
* @param {string} title
* @param {number=} uid
* @param {CanvasAgent.TraceLogId=} traceLogId
+ * @param {NetworkAgent.FrameId=} frameId
*/
-WebInspector.CanvasProfileHeader = function(type, title, uid, traceLogId)
+WebInspector.CanvasProfileHeader = function(type, title, uid, traceLogId, frameId)
{
WebInspector.ProfileHeader.call(this, type, title, uid);
/** @type {CanvasAgent.TraceLogId} */
this._traceLogId = traceLogId || "";
+ this._frameId = frameId;
this._alive = true;
this._traceLogSize = 0;
}
@@ -705,7 +741,16 @@
},
/**
+ * @return {NetworkAgent.FrameId|undefined}
+ */
+ frameId: function()
+ {
+ return this._frameId;
+ },
+
+ /**
* @override
+ * @return {WebInspector.ProfileSidebarTreeElement}
*/
createSidebarTreeElement: function()
{