Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: Source/core/inspector/InspectorTimelineAgent.cpp

Issue 54273005: DevTools: add ids to compositor frames (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 for (size_t i = 0; i < m_consoleTimelines.size(); ++i) { 301 for (size_t i = 0; i < m_consoleTimelines.size(); ++i) {
302 String message = String::format("Timeline '%s' terminated.", m_consoleTi melines[i].utf8().data()); 302 String message = String::format("Timeline '%s' terminated.", m_consoleTi melines[i].utf8().data());
303 page()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message); 303 page()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message);
304 } 304 }
305 m_consoleTimelines.clear(); 305 m_consoleTimelines.clear();
306 306
307 m_frontend->stopped(&fromConsole); 307 m_frontend->stopped(&fromConsole);
308 } 308 }
309 309
310 void InspectorTimelineAgent::didBeginFrame() 310 void InspectorTimelineAgent::didBeginFrame(int frameId)
311 { 311 {
312 TRACE_EVENT_INSTANT0(InternalEventCategory, InstrumentationEvents::BeginFram e); 312 TRACE_EVENT_INSTANT0(InternalEventCategory, InstrumentationEvents::BeginFram e);
313 m_pendingFrameRecord = TimelineRecordFactory::createGenericRecord(timestamp( ), 0, TimelineRecordType::BeginFrame); 313 m_pendingFrameRecord = TimelineRecordFactory::createGenericRecord(timestamp( ), 0, TimelineRecordType::BeginFrame);
314 m_pendingFrameRecord->setObject("data", TimelineRecordFactory::createFrameDa ta(frameId));
314 } 315 }
315 316
316 void InspectorTimelineAgent::didCancelFrame() 317 void InspectorTimelineAgent::didCancelFrame()
317 { 318 {
318 m_pendingFrameRecord.clear(); 319 m_pendingFrameRecord.clear();
319 } 320 }
320 321
321 bool InspectorTimelineAgent::willCallFunction(ExecutionContext* context, const S tring& scriptName, int scriptLine) 322 bool InspectorTimelineAgent::willCallFunction(ExecutionContext* context, const S tring& scriptName, int scriptLine)
322 { 323 {
323 pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frameForExecutionContext(co ntext)); 324 pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frameForExecutionContext(co ntext));
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 if (hasLowLevelDetails && !m_platformInstrumentationClientInstalledAtStackDe pth && !PlatformInstrumentation::hasClient()) { 898 if (hasLowLevelDetails && !m_platformInstrumentationClientInstalledAtStackDe pth && !PlatformInstrumentation::hasClient()) {
898 m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.siz e(); 899 m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.siz e();
899 PlatformInstrumentation::setClient(this); 900 PlatformInstrumentation::setClient(this);
900 } 901 }
901 } 902 }
902 903
903 void InspectorTimelineAgent::commitFrameRecord() 904 void InspectorTimelineAgent::commitFrameRecord()
904 { 905 {
905 if (!m_pendingFrameRecord) 906 if (!m_pendingFrameRecord)
906 return; 907 return;
907
908 m_pendingFrameRecord->setObject("data", JSONObject::create());
909 innerAddRecordToTimeline(m_pendingFrameRecord.release()); 908 innerAddRecordToTimeline(m_pendingFrameRecord.release());
910 } 909 }
911 910
912 void InspectorTimelineAgent::clearRecordStack() 911 void InspectorTimelineAgent::clearRecordStack()
913 { 912 {
914 if (m_platformInstrumentationClientInstalledAtStackDepth) { 913 if (m_platformInstrumentationClientInstalledAtStackDepth) {
915 m_platformInstrumentationClientInstalledAtStackDepth = 0; 914 m_platformInstrumentationClientInstalledAtStackDepth = 0;
916 PlatformInstrumentation::setClient(0); 915 PlatformInstrumentation::setClient(0);
917 } 916 }
918 m_pendingFrameRecord.clear(); 917 m_pendingFrameRecord.clear();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc reasingTime()); 952 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc reasingTime());
954 } 953 }
955 954
956 Page* InspectorTimelineAgent::page() 955 Page* InspectorTimelineAgent::page()
957 { 956 {
958 return m_pageAgent ? m_pageAgent->page() : 0; 957 return m_pageAgent ? m_pageAgent->page() : 0;
959 } 958 }
960 959
961 } // namespace WebCore 960 } // namespace WebCore
962 961
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698