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

Unified Diff: chrome/browser/sync_file_system/task_logger.cc

Issue 337073002: [SyncFS] Add EVENT_TRACE to SyncTaskToken (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « chrome/browser/sync_file_system/task_logger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/task_logger.cc
diff --git a/chrome/browser/sync_file_system/task_logger.cc b/chrome/browser/sync_file_system/task_logger.cc
index 0047238a3a837fe31afaddc0126708cc4215722a..8d8c5857f39f0279c480d76e11f719681115f000 100644
--- a/chrome/browser/sync_file_system/task_logger.cc
+++ b/chrome/browser/sync_file_system/task_logger.cc
@@ -4,17 +4,29 @@
#include "chrome/browser/sync_file_system/task_logger.h"
+#include "base/lazy_instance.h"
#include "base/stl_util.h"
+#include "base/synchronization/lock.h"
namespace sync_file_system {
namespace {
+
const size_t kMaxLogSize = 500;
+
+int g_next_log_id = 1;
+base::LazyInstance<base::Lock>::Leaky g_log_id_lock = LAZY_INSTANCE_INITIALIZER;
+
+int GenerateLogID() {
+ base::AutoLock lock(g_log_id_lock.Get());
+ return g_next_log_id++;
+}
+
} // namespace
typedef TaskLogger::TaskLog TaskLog;
-TaskLogger::TaskLog::TaskLog() {}
+TaskLogger::TaskLog::TaskLog() : log_id(GenerateLogID()) {}
TaskLogger::TaskLog::~TaskLog() {}
TaskLogger::TaskLogger() {}
« no previous file with comments | « chrome/browser/sync_file_system/task_logger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698