示例#1
0
void Console::profileEnd(const JSC::UString& title, ScriptCallStack* callStack)
{
    Page* page = this->page();
    if (!page)
        return;

    if (!this->page())
        return;

#if ENABLE(INSPECTOR)
    InspectorController* controller = page->inspectorController();
    if (!controller->profilerEnabled())
        return;
#endif

    RefPtr<JSC::Profile> profile = JSC::Profiler::profiler()->stopProfiling(callStack->state(), title);
    if (!profile)
        return;

    m_profiles.append(profile);

#if ENABLE(INSPECTOR)
    const ScriptCallFrame& lastCaller = callStack->at(0);
    controller->addProfile(profile, lastCaller.lineNumber(), lastCaller.sourceURL());
#endif
}