| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 reportMessageToConsole(consoleMessage.release()); | 175 reportMessageToConsole(consoleMessage.release()); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void ConsoleBase::timeStamp(const String& title) | 178 void ConsoleBase::timeStamp(const String& title) |
| 179 { | 179 { |
| 180 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "TimeSt
amp", "data", InspectorTimeStampEvent::data(context(), title)); | 180 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "TimeSt
amp", "data", InspectorTimeStampEvent::data(context(), title)); |
| 181 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. | 181 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. |
| 182 InspectorInstrumentation::consoleTimeStamp(context(), title); | 182 InspectorInstrumentation::consoleTimeStamp(context(), title); |
| 183 } | 183 } |
| 184 | 184 |
| 185 static String formatTimelineTitle(const String& title) |
| 186 { |
| 187 return String::format("Timeline '%s'", title.utf8().data()); |
| 188 } |
| 189 |
| 185 void ConsoleBase::timeline(ScriptState* scriptState, const String& title) | 190 void ConsoleBase::timeline(ScriptState* scriptState, const String& title) |
| 186 { | 191 { |
| 192 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. |
| 187 InspectorInstrumentation::consoleTimeline(context(), title, scriptState); | 193 InspectorInstrumentation::consoleTimeline(context(), title, scriptState); |
| 194 |
| 195 TRACE_EVENT_COPY_ASYNC_BEGIN0("blink.console", formatTimelineTitle(title).ut
f8().data(), this); |
| 188 } | 196 } |
| 189 | 197 |
| 190 void ConsoleBase::timelineEnd(ScriptState* scriptState, const String& title) | 198 void ConsoleBase::timelineEnd(ScriptState* scriptState, const String& title) |
| 191 { | 199 { |
| 200 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. |
| 192 InspectorInstrumentation::consoleTimelineEnd(context(), title, scriptState); | 201 InspectorInstrumentation::consoleTimelineEnd(context(), title, scriptState); |
| 202 |
| 203 TRACE_EVENT_COPY_ASYNC_END0("blink.console", formatTimelineTitle(title).utf8
().data(), this); |
| 193 } | 204 } |
| 194 | 205 |
| 195 void ConsoleBase::group(ScriptState* scriptState, PassRefPtrWillBeRawPtr<ScriptA
rguments> arguments) | 206 void ConsoleBase::group(ScriptState* scriptState, PassRefPtrWillBeRawPtr<ScriptA
rguments> arguments) |
| 196 { | 207 { |
| 197 internalAddMessage(StartGroupMessageType, LogMessageLevel, scriptState, argu
ments, true); | 208 internalAddMessage(StartGroupMessageType, LogMessageLevel, scriptState, argu
ments, true); |
| 198 } | 209 } |
| 199 | 210 |
| 200 void ConsoleBase::groupCollapsed(ScriptState* scriptState, PassRefPtrWillBeRawPt
r<ScriptArguments> arguments) | 211 void ConsoleBase::groupCollapsed(ScriptState* scriptState, PassRefPtrWillBeRawPt
r<ScriptArguments> arguments) |
| 201 { | 212 { |
| 202 internalAddMessage(StartGroupCollapsedMessageType, LogMessageLevel, scriptSt
ate, arguments, true); | 213 internalAddMessage(StartGroupCollapsedMessageType, LogMessageLevel, scriptSt
ate, arguments, true); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 220 consoleMessage->setType(type); | 231 consoleMessage->setType(type); |
| 221 consoleMessage->setScriptState(scriptState); | 232 consoleMessage->setScriptState(scriptState); |
| 222 consoleMessage->setScriptArguments(arguments); | 233 consoleMessage->setScriptArguments(arguments); |
| 223 | 234 |
| 224 size_t stackSize = printTrace ? ScriptCallStack::maxCallStackSizeToCapture :
1; | 235 size_t stackSize = printTrace ? ScriptCallStack::maxCallStackSizeToCapture :
1; |
| 225 consoleMessage->setCallStack(createScriptCallStackForConsole(stackSize)); | 236 consoleMessage->setCallStack(createScriptCallStackForConsole(stackSize)); |
| 226 reportMessageToConsole(consoleMessage.release()); | 237 reportMessageToConsole(consoleMessage.release()); |
| 227 } | 238 } |
| 228 | 239 |
| 229 } // namespace blink | 240 } // namespace blink |
| OLD | NEW |