Chromium Code Reviews| Index: Source/core/inspector/InspectorTracingAgent.cpp |
| diff --git a/Source/core/inspector/InspectorTracingAgent.cpp b/Source/core/inspector/InspectorTracingAgent.cpp |
| index 8e8edac01e7a874a5244db6f0744005010bf7627..017abd357f4f2048c291d553a69bed8b9f546555 100644 |
| --- a/Source/core/inspector/InspectorTracingAgent.cpp |
| +++ b/Source/core/inspector/InspectorTracingAgent.cpp |
| @@ -40,6 +40,7 @@ void InspectorTracingAgent::restore() |
| void InspectorTracingAgent::start(ErrorString*, const String& categoryFilter, const String&, const double*, PassRefPtrWillBeRawPtr<StartCallback> callback) |
| { |
| + ASSERT(m_state->getString(TracingAgentState::sessionId).isEmpty()); |
| m_state->setString(TracingAgentState::sessionId, IdentifiersFactory::createIdentifier()); |
| m_client->enableTracing(categoryFilter); |
| emitMetadataEvents(); |
| @@ -48,8 +49,8 @@ void InspectorTracingAgent::start(ErrorString*, const String& categoryFilter, co |
| void InspectorTracingAgent::end(ErrorString* errorString, PassRefPtrWillBeRawPtr<EndCallback> callback) |
| { |
| + resetSessionId(); |
| m_client->disableTracing(); |
|
yurys
2014/10/17 08:00:54
Please move session id reset after disableTracing(
|
| - m_workerAgent->setTracingSessionId(String()); |
| callback->sendSuccess(); |
| } |
| @@ -77,4 +78,15 @@ void InspectorTracingAgent::setFrontend(InspectorFrontend* frontend) |
| m_frontend = frontend->tracing(); |
| } |
| +void InspectorTracingAgent::clearFrontend() |
| +{ |
| + resetSessionId(); |
| +} |
| + |
| +void InspectorTracingAgent::resetSessionId() |
| +{ |
| + m_state->remove(TracingAgentState::sessionId); |
| + m_workerAgent->setTracingSessionId(sessionId()); |
| +} |
| + |
| } |