Skip to content

Commit

Permalink
Revert of DevTools: add initial support for console.time/timeEnd in t…
Browse files Browse the repository at this point in the history
…racing based Timeline (patchset #3 of https://codereview.chromium.org/464063008/)

Reason for revert:
As per comment from nduca. I also don't understand why instrumentation is not reused.

Original issue's description:
> DevTools: add initial support for console.time/timeEnd in tracing based Timeline
> 
> console.time/timeEnd will result in instant trace events. The events will be shown as marker events, i.e. as markers on the Timeline overview.
> 
> BUG=361045
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180635

[email protected],[email protected],[email protected],[email protected]
NOTREECHECKS=true
NOTRY=true
BUG=361045

Review URL: https://codereview.chromium.org/485893006

git-svn-id: svn://svn.chromium.org/blink/trunk@180640 bbb929c8-8fbe-4397-9dbb-9b2b20218538
  • Loading branch information
[email protected] committed Aug 20, 2014
1 parent d7398b8 commit d797af1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 43 deletions.
2 changes: 0 additions & 2 deletions Source/core/frame/ConsoleBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,11 @@ void ConsoleBase::time(const String& title)
{
InspectorInstrumentation::consoleTime(context(), title);
TRACE_EVENT_COPY_ASYNC_BEGIN0("blink.console", title.utf8().data(), this);
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ConsoleTime", "data", InspectorConsoleTimeEvent::data(context(), title));
}

void ConsoleBase::timeEnd(ScriptState* scriptState, const String& title)
{
TRACE_EVENT_COPY_ASYNC_END0("blink.console", title.utf8().data(), this);
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ConsoleTimeEnd", "data", InspectorConsoleTimeEvent::data(context(), title));
InspectorInstrumentation::consoleTimeEnd(context(), title, scriptState);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/core/inspector/InspectorInstrumentation.idl
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ class ConsoleMessage;
[Console]
void consoleCount(ExecutionContext* context, ScriptState* state, PassRefPtrWillBeRawPtr<ScriptArguments> arguments);

[Console, Timeline]
[Timeline, Console]
void consoleTime([Keep] ExecutionContext* context, const String& title);

[Console, Timeline]
Expand Down
12 changes: 1 addition & 11 deletions Source/core/inspector/InspectorTraceEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorEventDispatchEvent::da
return value;
}

static PassRefPtr<TraceEvent::ConvertableToTraceFormat> genericTimeEventData(ExecutionContext* context, const String& message)
PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorTimeStampEvent::data(ExecutionContext* context, const String& message)
{
RefPtr<TracedValue> value = TracedValue::create();
value->setString("message", message);
Expand All @@ -355,14 +355,4 @@ static PassRefPtr<TraceEvent::ConvertableToTraceFormat> genericTimeEventData(Exe
return value;
}

PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorTimeStampEvent::data(ExecutionContext* context, const String& message)
{
return genericTimeEventData(context, message);
}

PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorConsoleTimeEvent::data(ExecutionContext* context, const String& message)
{
return genericTimeEventData(context, message);
}

}
5 changes: 0 additions & 5 deletions Source/core/inspector/InspectorTraceEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,6 @@ class InspectorTimeStampEvent {
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, const String& message);
};

class InspectorConsoleTimeEvent {
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, const String& message);
};

} // namespace blink


Expand Down
1 change: 0 additions & 1 deletion Source/devtools/front_end/timeline/TracingTimelineModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ WebInspector.TracingTimelineModel.RecordType = {

TimeStamp: "TimeStamp",
ConsoleTime: "ConsoleTime",
ConsoleTimeEnd: "ConsoleTimeEnd",

ResourceSendRequest: "ResourceSendRequest",
ResourceReceiveResponse: "ResourceReceiveResponse",
Expand Down
29 changes: 6 additions & 23 deletions Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,7 @@ WebInspector.TracingTimelineUIUtils._initEventStyles = function()
eventStyles[recordTypes.MarkDOMContent] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("DOMContentLoaded event"), categories["scripting"], true);
eventStyles[recordTypes.MarkFirstPaint] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("First paint"), categories["painting"], true);
eventStyles[recordTypes.TimeStamp] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Stamp"), categories["scripting"]);
eventStyles[recordTypes.ConsoleTime] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Console Time"), categories["scripting"], true);
eventStyles[recordTypes.ConsoleTimeEnd] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Console Time End"), categories["scripting"], true);
eventStyles[recordTypes.ConsoleTime] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Console Time"), categories["scripting"]);
eventStyles[recordTypes.ResourceSendRequest] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Send Request"), categories["loading"]);
eventStyles[recordTypes.ResourceReceiveResponse] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Receive Response"), categories["loading"]);
eventStyles[recordTypes.ResourceFinish] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Finish Loading"), categories["loading"]);
Expand Down Expand Up @@ -299,10 +298,7 @@ WebInspector.TracingTimelineUIUtils.markerEventColor = function(eventName)
case recordTypes.MarkDOMContent: return blue;
case recordTypes.MarkLoad: return red;
case recordTypes.MarkFirstPaint: return green;
case recordTypes.ConsoleTime:
case recordTypes.ConsoleTimeEnd:
case recordTypes.TimeStamp:
return orange;
case recordTypes.TimeStamp: return orange;
}
return green;
}
Expand All @@ -314,17 +310,9 @@ WebInspector.TracingTimelineUIUtils.markerEventColor = function(eventName)
*/
WebInspector.TracingTimelineUIUtils.eventTitle = function(event, model)
{
var title = WebInspector.TracingTimelineUIUtils.eventStyle(event).title;
var recordTypes = WebInspector.TracingTimelineModel.RecordType;
switch(event.name) {
case recordTypes.ConsoleTime:
case recordTypes.ConsoleTimeEnd:
var message = event.args["data"]["message"];
return WebInspector.UIString("%s: %s", title, message);
case recordTypes.TimeStamp:
if (event.name === WebInspector.TracingTimelineModel.RecordType.TimeStamp)
return event.args["data"]["message"];
}

var title = WebInspector.TracingTimelineUIUtils.eventStyle(event).title;
if (WebInspector.TracingTimelineUIUtils.isMarkerEvent(event)) {
var startTime = Number.millisToString(event.startTime - model.minimumRecordTime());
return WebInspector.UIString("%s at %s", title, startTime);
Expand All @@ -340,9 +328,8 @@ WebInspector.TracingTimelineUIUtils.isMarkerEvent = function(event)
{
var recordTypes = WebInspector.TracingTimelineModel.RecordType;
switch (event.name) {
case recordTypes.ConsoleTime:
case recordTypes.ConsoleTimeEnd:
case recordTypes.TimeStamp:
return true;
case recordTypes.MarkFirstPaint:
return true;
case recordTypes.MarkDOMContent:
Expand Down Expand Up @@ -429,7 +416,6 @@ WebInspector.TracingTimelineUIUtils.buildDetailsNodeForTraceEvent = function(eve
}
break;
case recordType.ConsoleTime:
case recordType.ConsoleTimeEnd:
detailsText = eventData["message"];
break;
case recordType.EmbedderCallback:
Expand Down Expand Up @@ -647,7 +633,6 @@ WebInspector.TracingTimelineUIUtils._buildTraceEventDetailsSynchronously = funct
relatedNodeLabel = WebInspector.UIString("Layout root");
break;
case recordTypes.ConsoleTime:
case recordTypes.ConsoleTimeEnd:
contentHelper.appendTextRow(WebInspector.UIString("Message"), eventData["message"]);
break;
case recordTypes.WebSocketCreate:
Expand Down Expand Up @@ -793,9 +778,7 @@ WebInspector.TracingTimelineUIUtils._createEventDivider = function(recordType, t
eventDivider.className += " resources-red-divider";
else if (recordType === recordTypes.MarkFirstPaint)
eventDivider.className += " resources-green-divider";
else if (recordType === recordTypes.TimeStamp ||
recordType === recordTypes.ConsoleTime ||
recordType === recordTypes.ConsoleTimeEnd)
else if (recordType === recordTypes.TimeStamp)
eventDivider.className += " resources-orange-divider";
else if (recordType === recordTypes.BeginFrame)
eventDivider.className += " timeline-frame-divider";
Expand Down

0 comments on commit d797af1

Please sign in to comment.