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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThread.cpp

Issue 2045403002: Worker: Add UMA to record an exit code of WorkerThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build failures Created 4 years, 6 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 | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/WorkerThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index 62c4fd888ac86f03869271c109be5607ccb159c8..37975e237abf0a7aa348e502e17e1a135ca1a1b4 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -38,6 +38,7 @@
#include "core/workers/WorkerClients.h"
#include "core/workers/WorkerReportingProxy.h"
#include "core/workers/WorkerThreadStartupData.h"
+#include "platform/Histogram.h"
#include "platform/ThreadSafeFunctional.h"
#include "platform/WaitableEvent.h"
#include "platform/WebThreadSupportingGC.h"
@@ -48,6 +49,7 @@
#include "public/platform/WebThread.h"
#include "wtf/Functional.h"
#include "wtf/Noncopyable.h"
+#include "wtf/Threading.h"
#include "wtf/text/WTFString.h"
#include <limits.h>
@@ -154,9 +156,9 @@ WorkerThread::~WorkerThread()
DCHECK(workerThreads().contains(this));
workerThreads().remove(this);
- // TODO(nhiroki): Record how this thread is terminated (i.e. m_exitCode)
- // in UMA.
DCHECK_NE(ExitCode::NotTerminated, m_exitCode);
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, exitCodeHistogram, new EnumerationHistogram("WorkerThread.ExitCode", static_cast<int>(ExitCode::LastEnum)));
+ exitCodeHistogram.count(static_cast<int>(m_exitCode));
}
void WorkerThread::start(PassOwnPtr<WorkerThreadStartupData> startupData)
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698