void InspectorTimelineAgent::didReceiveResourceResponse(unsigned long identifier, const ResourceResponse& response) { ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); record.set("data", TimelineRecordFactory::createResourceReceiveResponseData(m_frontend, identifier, response)); record.set("type", ResourceReceiveResponseTimelineRecordType); m_frontend->addRecordToTimeline(record); }
void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail) { ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); record.set("data", TimelineRecordFactory::createResourceFinishData(m_frontend, identifier, didFail)); record.set("type", ResourceFinishTimelineRecordType); m_frontend->addRecordToTimeline(record); }
InspectorTimelineAgent::InspectorTimelineAgent(InspectorFrontend* frontend) : m_sessionStartTime(currentTimeInMilliseconds()) , m_frontend(frontend) , m_currentTimelineItem(0) { ASSERT(m_frontend); }
void InspectorTimelineAgent::willSendResourceRequest(unsigned long identifier, bool isMainResource, const ResourceRequest& request) { ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); record.set("data", TimelineRecordFactory::createResourceSendRequestData(m_frontend, identifier, isMainResource, request)); record.set("type", ResourceSendRequestTimelineRecordType); m_frontend->addRecordToTimeline(record); }
void InspectorTimelineAgent::didCompleteCurrentRecord(TimelineRecordType type) { // An empty stack could merely mean that the timeline agent was turned on in the middle of // an event. Don't treat as an error. if (!m_recordStack.isEmpty()) { TimelineRecordEntry entry = m_recordStack.last(); m_recordStack.removeLast(); ASSERT(entry.type == type); entry.record.set("data", entry.data); entry.record.set("children", entry.children); entry.record.set("endTime", currentTimeInMilliseconds()); addRecordToTimeline(entry.record, type); } }
int main(int argc, char** argv) { pthread_t th_test[THREAD_COUNT]; int i; int th_index[THREAD_COUNT]; g_ctx = cdl_create(); for(i=0; i<THREAD_COUNT; i++) { th_index[i] = i; pthread_create(&th_test[i], NULL, test_thread, &th_index[i]); } while(1) { usleep(10*1000); cdl_init(g_ctx, THREAD_COUNT); pthread_cond_broadcast(&test_cond); cdl_wait(g_ctx); printf("all done %llu\n", currentTimeInMilliseconds()); } return 0; }
void InspectorTimelineAgent::pushCurrentRecord(ScriptObject data, TimelineRecordType type) { ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); m_recordStack.append(TimelineRecordEntry(record, data, m_frontend->newScriptArray(), type)); }
void InspectorTimelineAgent::didMarkTimeline(const String& message) { ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); record.set("data", TimelineRecordFactory::createMarkTimelineData(m_frontend, message)); addRecordToTimeline(record, MarkTimelineRecordType); }
void InspectorTimelineAgent::didRemoveTimer(int timerId) { ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); record.set("data", TimelineRecordFactory::createGenericTimerData(m_frontend, timerId)); addRecordToTimeline(record, TimerRemoveTimelineRecordType); }
void InspectorTimelineAgent::didInstallTimer(int timerId, int timeout, bool singleShot) { ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); record.set("data", TimelineRecordFactory::createTimerInstallData(m_frontend, timerId, timeout, singleShot)); addRecordToTimeline(record, TimerInstallTimelineRecordType); }
double InspectorTimelineAgent::sessionTimeInMilliseconds() { return currentTimeInMilliseconds() - m_sessionStartTime; }
void InspectorTimelineAgent::reset() { m_sessionStartTime = currentTimeInMilliseconds(); m_currentTimelineItem.set(0); }