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

Side by Side Diff: chrome/browser/chromeos/drive/event_logger.h

Issue 11365249: drive: Event logger for chrome:drive-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_EVENT_LOGGER_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_EVENT_LOGGER_H_
7
8 #include <string>
9 #include <deque>
10
11 #include "base/basictypes.h"
12 #include "base/time.h"
13
14 namespace drive {
15
16 class EventLogger {
satorux1 2012/11/14 05:55:11 Class comment is missing.
kinaba 2012/11/14 06:19:52 Done.
17 public:
18 struct Event {
19 explicit Event(const std::string& what);
20 base::Time when;
21 std::string what;
22 };
23
24 // Creates an event logger that keeps the latest |history_size| events.
25 explicit EventLogger(size_t history_size);
26 ~EventLogger();
27
28 // Logs a message.
29 void Log(const std::string& what);
30
31 // Gets the list of latest events (the oldest event comes first).
32 const std::deque<Event>& history() const { return history_; }
33
34 private:
35 std::deque<Event> history_;
36 const size_t history_size_;
37
38 DISALLOW_COPY_AND_ASSIGN(EventLogger);
39 };
40
41 } // namespace drive
42
43 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_EVENT_LOGGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698