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

Unified Diff: Source/core/workers/WorkerMessagingProxy.cpp

Issue 460363002: Record DevTools metadata events on worker threads when starting recoring tracing based Timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/workers/WorkerMessagingProxy.h ('k') | Source/devtools/front_end/timeline/TracingModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerMessagingProxy.cpp
diff --git a/Source/core/workers/WorkerMessagingProxy.cpp b/Source/core/workers/WorkerMessagingProxy.cpp
index 081a68272cb06abb18d032731482785d41c54941..46d09cffd0fab2db4b6f4f50a8110a102e3255d4 100644
--- a/Source/core/workers/WorkerMessagingProxy.cpp
+++ b/Source/core/workers/WorkerMessagingProxy.cpp
@@ -48,6 +48,7 @@
#include "core/workers/WorkerObjectProxy.h"
#include "core/workers/WorkerThreadStartupData.h"
#include "platform/NotImplemented.h"
+#include "platform/TraceEvent.h"
#include "platform/heap/Handle.h"
#include "wtf/Functional.h"
#include "wtf/MainThread.h"
@@ -253,6 +254,22 @@ void WorkerMessagingProxy::sendMessageToInspector(const String& message)
m_workerThread->interruptAndDispatchInspectorCommands();
}
+static void dispatchWriteTimelineStartedEvent(ExecutionContext* context, const String& sessionId)
+{
+ TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "TracingStartedInWorker", "sessionId", sessionId.utf8());
+}
+
+void WorkerMessagingProxy::writeTimelineStartedEvent(const String& sessionId)
+{
+ if (m_askedToTerminate)
+ return;
+ OwnPtr<ExecutionContextTask> task = createCrossThreadTask(dispatchWriteTimelineStartedEvent, String(sessionId));
+ if (m_workerThread)
+ m_workerThread->postTask(task.release());
+ else
+ m_queuedEarlyTasks.append(task.release());
+}
+
void WorkerMessagingProxy::workerGlobalScopeDestroyed()
{
// This method is always the last to be performed, so the proxy is not needed for communication
« no previous file with comments | « Source/core/workers/WorkerMessagingProxy.h ('k') | Source/devtools/front_end/timeline/TracingModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698