diff options
author | antrim@chromium.org <antrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-22 15:52:38 +0000 |
---|---|---|
committer | antrim@chromium.org <antrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-22 15:52:38 +0000 |
commit | d41e43529b27ac423a88ada596be7e001cbee572 (patch) | |
tree | 37ce7e1f056b6f2d58037a4140f9f063ca866ebe /chromeos/login_event_recorder.h | |
parent | fe2e8506eb31302bd9ea251cba81b37cf6f9c2f6 (diff) | |
download | chromium_src-d41e43529b27ac423a88ada596be7e001cbee572.zip chromium_src-d41e43529b27ac423a88ada596be7e001cbee572.tar.gz chromium_src-d41e43529b27ac423a88ada596be7e001cbee572.tar.bz2 |
Refactoring : Move AuthAttempt and Authenticators to chromeos/login
Extracted LoginEventRecorder from BootTimesLoader to loose dependecies.
BUG=387613
R=nkostylev@chromium.org
TBR=bauerb@chromium.org
TBR=stevenjb@chromium.org
Review URL: https://codereview.chromium.org/391373002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284682 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/login_event_recorder.h')
-rw-r--r-- | chromeos/login_event_recorder.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/chromeos/login_event_recorder.h b/chromeos/login_event_recorder.h new file mode 100644 index 0000000..ec695b4 --- /dev/null +++ b/chromeos/login_event_recorder.h @@ -0,0 +1,45 @@ +// Copyright 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 { + +// LoginEventRecorder records the bootimes of Chrome OS. +// Actual implementation is handled by delegate. +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_ |