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

Unified Diff: chromeos/login_event_recorder.h

Issue 391373002: Refactoring : Move AuthAttempt and Authenticators to chromeos/login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 6 years, 5 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 | « chromeos/login/auth/test_attempt_state.cc ('k') | chromeos/login_event_recorder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/login_event_recorder.h
diff --git a/chromeos/login_event_recorder.h b/chromeos/login_event_recorder.h
new file mode 100644
index 0000000000000000000000000000000000000000..d435f5310d3d3a3aa17b91a0d79a54c52a8eb83b
--- /dev/null
+++ b/chromeos/login_event_recorder.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_LOGIN_EVENT_RECORDER_H_
+#define CHROMEOS_LOGIN_EVENT_RECORDER_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "chromeos/chromeos_export.h"
+
+namespace chromeos {
+
+// BootTimesLoader loads the bootimes of Chrome OS from the file system.
Nikita (slow) 2014/07/16 16:57:45 nit: Comments needs to be updated.
+// Loading is done asynchronously on the file thread. Once loaded,
+// BootTimesLoader calls back to a method of your choice with the boot times.
+// To use BootTimesLoader, do the following:
+//
+// . In your class define a member field of type chromeos::BootTimesLoader and
+// base::CancelableTaskTracker.
+// . Define the callback method, something like:
+// void OnBootTimesLoaded(const BootTimesLoader::BootTimes& boot_times);
+// . When you want the version invoke: loader.GetBootTimes(callback, &tracker_);
+class CHROMEOS_EXPORT LoginEventRecorder {
+ public:
+ class Delegate {
+ public:
+ virtual void AddLoginTimeMarker(const std::string& marker_name,
+ bool send_to_uma) = 0;
+ };
+ LoginEventRecorder();
+ virtual ~LoginEventRecorder();
+
+ static LoginEventRecorder* Get();
+
+ void SetDelegate(Delegate* delegate);
+
+ // Add a time marker for login. A timeline will be dumped to
+ // /tmp/login-times-sent after login is done. If |send_to_uma| is true
+ // the time between this marker and the last will be sent to UMA with
+ // the identifier BootTime.|marker_name|.
+ void AddLoginTimeMarker(const std::string& marker_name, bool send_to_uma);
+
+ private:
+ Delegate* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoginEventRecorder);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_LOGIN_EVENT_RECORDER_H_
« no previous file with comments | « chromeos/login/auth/test_attempt_state.cc ('k') | chromeos/login_event_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698