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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 { | 786 { |
787 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeEnd, true, frameForExecutionContext(context)); | 787 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeEnd, true, frameForExecutionContext(context)); |
788 } | 788 } |
789 | 789 |
790 void InspectorTimelineAgent::consoleTimeline(ExecutionContext* context, const St
ring& title, ScriptState* state) | 790 void InspectorTimelineAgent::consoleTimeline(ExecutionContext* context, const St
ring& title, ScriptState* state) |
791 { | 791 { |
792 if (!m_state->getBoolean(TimelineAgentState::enabled)) | 792 if (!m_state->getBoolean(TimelineAgentState::enabled)) |
793 return; | 793 return; |
794 | 794 |
795 String message = String::format("Timeline '%s' started.", title.utf8().data(
)); | 795 String message = String::format("Timeline '%s' started.", title.utf8().data(
)); |
796 frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel
, message, String(), 0, 0, 0, state); | 796 frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel
, message, String(), 0, 0, nullptr, state); |
797 m_consoleTimelines.append(title); | 797 m_consoleTimelines.append(title); |
798 if (!isStarted()) { | 798 if (!isStarted()) { |
799 innerStart(); | 799 innerStart(); |
800 bool fromConsole = true; | 800 bool fromConsole = true; |
801 m_frontend->started(&fromConsole); | 801 m_frontend->started(&fromConsole); |
802 } | 802 } |
803 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeStamp, true, frameForExecutionContext(context)); | 803 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeStamp, true, frameForExecutionContext(context)); |
804 } | 804 } |
805 | 805 |
806 void InspectorTimelineAgent::consoleTimelineEnd(ExecutionContext* context, const
String& title, ScriptState* state) | 806 void InspectorTimelineAgent::consoleTimelineEnd(ExecutionContext* context, const
String& title, ScriptState* state) |
807 { | 807 { |
808 if (!m_state->getBoolean(TimelineAgentState::enabled)) | 808 if (!m_state->getBoolean(TimelineAgentState::enabled)) |
809 return; | 809 return; |
810 | 810 |
811 size_t index = m_consoleTimelines.find(title); | 811 size_t index = m_consoleTimelines.find(title); |
812 if (index == kNotFound) { | 812 if (index == kNotFound) { |
813 String message = String::format("Timeline '%s' was not started.", title.
utf8().data()); | 813 String message = String::format("Timeline '%s' was not started.", title.
utf8().data()); |
814 frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageL
evel, message, String(), 0, 0, 0, state); | 814 frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageL
evel, message, String(), 0, 0, nullptr, state); |
815 return; | 815 return; |
816 } | 816 } |
817 | 817 |
818 String message = String::format("Timeline '%s' finished.", title.utf8().data
()); | 818 String message = String::format("Timeline '%s' finished.", title.utf8().data
()); |
819 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeStamp, true, frameForExecutionContext(context)); | 819 appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRe
cordType::TimeStamp, true, frameForExecutionContext(context)); |
820 m_consoleTimelines.remove(index); | 820 m_consoleTimelines.remove(index); |
821 if (!m_consoleTimelines.size() && isStarted() && !m_state->getBoolean(Timeli
neAgentState::startedFromProtocol)) { | 821 if (!m_consoleTimelines.size() && isStarted() && !m_state->getBoolean(Timeli
neAgentState::startedFromProtocol)) { |
822 unwindRecordStack(); | 822 unwindRecordStack(); |
823 innerStop(true); | 823 innerStop(true); |
824 } | 824 } |
825 frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel
, message, String(), 0, 0, 0, state); | 825 frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel
, message, String(), 0, 0, nullptr, state); |
826 } | 826 } |
827 | 827 |
828 void InspectorTimelineAgent::domContentLoadedEventFired(Frame* frame) | 828 void InspectorTimelineAgent::domContentLoadedEventFired(Frame* frame) |
829 { | 829 { |
830 bool isMainFrame = frame && m_pageAgent && (frame == m_pageAgent->mainFrame(
)); | 830 bool isMainFrame = frame && m_pageAgent && (frame == m_pageAgent->mainFrame(
)); |
831 appendRecord(TimelineRecordFactory::createMarkData(isMainFrame), TimelineRec
ordType::MarkDOMContent, false, frame); | 831 appendRecord(TimelineRecordFactory::createMarkData(isMainFrame), TimelineRec
ordType::MarkDOMContent, false, frame); |
832 if (isMainFrame) | 832 if (isMainFrame) |
833 m_mayEmitFirstPaint = true; | 833 m_mayEmitFirstPaint = true; |
834 } | 834 } |
835 | 835 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 | 1290 |
1291 #ifndef NDEBUG | 1291 #ifndef NDEBUG |
1292 bool TimelineRecordStack::isOpenRecordOfType(const String& type) | 1292 bool TimelineRecordStack::isOpenRecordOfType(const String& type) |
1293 { | 1293 { |
1294 return !m_stack.isEmpty() && m_stack.last().type == type; | 1294 return !m_stack.isEmpty() && m_stack.last().type == type; |
1295 } | 1295 } |
1296 #endif | 1296 #endif |
1297 | 1297 |
1298 } // namespace WebCore | 1298 } // namespace WebCore |
1299 | 1299 |
OLD | NEW |