| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 didCompleteCurrentRecord(TimelineRecordType::ConsoleTime); | 818 didCompleteCurrentRecord(TimelineRecordType::ConsoleTime); |
| 819 } | 819 } |
| 820 | 820 |
| 821 void InspectorTimelineAgent::consoleTimeline(ExecutionContext* context, const St
ring& title, ScriptState* scriptState) | 821 void InspectorTimelineAgent::consoleTimeline(ExecutionContext* context, const St
ring& title, ScriptState* scriptState) |
| 822 { | 822 { |
| 823 if (!m_state->getBoolean(TimelineAgentState::enabled)) | 823 if (!m_state->getBoolean(TimelineAgentState::enabled)) |
| 824 return; | 824 return; |
| 825 | 825 |
| 826 String message = String::format("Timeline '%s' started.", title.utf8().data(
)); | 826 String message = String::format("Timeline '%s' started.", title.utf8().data(
)); |
| 827 | 827 |
| 828 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSour
ce, DebugMessageLevel, message); | 828 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J
SMessageSource, DebugMessageLevel, message); |
| 829 consoleMessage->setScriptState(scriptState); | 829 consoleMessage->setScriptState(scriptState); |
| 830 mainFrame()->console().addMessage(consoleMessage.release()); | 830 mainFrame()->console().addMessage(consoleMessage.release()); |
| 831 m_consoleTimelines.append(title); | 831 m_consoleTimelines.append(title); |
| 832 if (!isStarted()) { | 832 if (!isStarted()) { |
| 833 m_state->setBoolean(TimelineAgentState::bufferEvents, true); | 833 m_state->setBoolean(TimelineAgentState::bufferEvents, true); |
| 834 m_bufferedEvents = TypeBuilder::Array<TimelineEvent>::create(); | 834 m_bufferedEvents = TypeBuilder::Array<TimelineEvent>::create(); |
| 835 | 835 |
| 836 innerStart(); | 836 innerStart(); |
| 837 bool fromConsole = true; | 837 bool fromConsole = true; |
| 838 m_frontend->started(&fromConsole); | 838 m_frontend->started(&fromConsole); |
| 839 } | 839 } |
| 840 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeStamp, true, frameForExecutionContext(context)); | 840 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeStamp, true, frameForExecutionContext(context)); |
| 841 } | 841 } |
| 842 | 842 |
| 843 void InspectorTimelineAgent::consoleTimelineEnd(ExecutionContext* context, const
String& title, ScriptState* scriptState) | 843 void InspectorTimelineAgent::consoleTimelineEnd(ExecutionContext* context, const
String& title, ScriptState* scriptState) |
| 844 { | 844 { |
| 845 if (!m_state->getBoolean(TimelineAgentState::enabled)) | 845 if (!m_state->getBoolean(TimelineAgentState::enabled)) |
| 846 return; | 846 return; |
| 847 | 847 |
| 848 size_t index = m_consoleTimelines.find(title); | 848 size_t index = m_consoleTimelines.find(title); |
| 849 if (index == kNotFound) { | 849 if (index == kNotFound) { |
| 850 String message = String::format("Timeline '%s' was not started.", title.
utf8().data()); | 850 String message = String::format("Timeline '%s' was not started.", title.
utf8().data()); |
| 851 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessage
Source, DebugMessageLevel, message); | 851 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::crea
te(JSMessageSource, DebugMessageLevel, message); |
| 852 consoleMessage->setScriptState(scriptState); | 852 consoleMessage->setScriptState(scriptState); |
| 853 mainFrame()->console().addMessage(consoleMessage.release()); | 853 mainFrame()->console().addMessage(consoleMessage.release()); |
| 854 return; | 854 return; |
| 855 } | 855 } |
| 856 | 856 |
| 857 String message = String::format("Timeline '%s' finished.", title.utf8().data
()); | 857 String message = String::format("Timeline '%s' finished.", title.utf8().data
()); |
| 858 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeStamp, true, frameForExecutionContext(context)); | 858 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeStamp, true, frameForExecutionContext(context)); |
| 859 m_consoleTimelines.remove(index); | 859 m_consoleTimelines.remove(index); |
| 860 if (!m_consoleTimelines.size() && isStarted() && !m_state->getBoolean(Timeli
neAgentState::startedFromProtocol)) { | 860 if (!m_consoleTimelines.size() && isStarted() && !m_state->getBoolean(Timeli
neAgentState::startedFromProtocol)) { |
| 861 unwindRecordStack(); | 861 unwindRecordStack(); |
| 862 innerStop(true); | 862 innerStop(true); |
| 863 } | 863 } |
| 864 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSour
ce, DebugMessageLevel, message); | 864 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J
SMessageSource, DebugMessageLevel, message); |
| 865 consoleMessage->setScriptState(scriptState); | 865 consoleMessage->setScriptState(scriptState); |
| 866 mainFrame()->console().addMessage(consoleMessage.release()); | 866 mainFrame()->console().addMessage(consoleMessage.release()); |
| 867 } | 867 } |
| 868 | 868 |
| 869 void InspectorTimelineAgent::domContentLoadedEventFired(LocalFrame* frame) | 869 void InspectorTimelineAgent::domContentLoadedEventFired(LocalFrame* frame) |
| 870 { | 870 { |
| 871 bool isMainFrame = frame && m_pageAgent && (frame == m_pageAgent->mainFrame(
)); | 871 bool isMainFrame = frame && m_pageAgent && (frame == m_pageAgent->mainFrame(
)); |
| 872 appendRecord(TimelineRecordFactory::createMarkData(isMainFrame), TimelineRec
ordType::MarkDOMContent, false, frame); | 872 appendRecord(TimelineRecordFactory::createMarkData(isMainFrame), TimelineRec
ordType::MarkDOMContent, false, frame); |
| 873 if (isMainFrame) | 873 if (isMainFrame) |
| 874 m_mayEmitFirstPaint = true; | 874 m_mayEmitFirstPaint = true; |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 { | 1370 { |
| 1371 visitor->trace(m_timelineAgent); | 1371 visitor->trace(m_timelineAgent); |
| 1372 } | 1372 } |
| 1373 | 1373 |
| 1374 void TimelineThreadState::trace(Visitor* visitor) | 1374 void TimelineThreadState::trace(Visitor* visitor) |
| 1375 { | 1375 { |
| 1376 visitor->trace(recordStack); | 1376 visitor->trace(recordStack); |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 } // namespace blink | 1379 } // namespace blink |
| 1380 | |
| OLD | NEW |