Chromium Code Reviews
Help | Chromium Project | Sign in
(1250)

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

Issue 11365249: drive: Event logger for chrome:drive-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix (#2, #3). Created 1 year, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
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 #include "chrome/browser/chromeos/drive/event_logger.h"
6
7 namespace drive {
8
9 EventLogger::Event::Event(int id, const std::string& what)
10 : id(id),
11 when(base::Time::Now()),
12 what(what) {
13 }
14
15 EventLogger::EventLogger(size_t history_size)
16 : history_size_(history_size),
17 next_event_id_(0) {
18 }
19
20 EventLogger::~EventLogger() {
21 }
22
23 void EventLogger::Log(const std::string& what) {
24 history_.push_back(Event(next_event_id_++, what));
satorux1 2012/11/14 07:59:30 Let's increment this on the next line. post-increm
kinaba 2012/11/14 08:13:36 Done.
25 if (history_.size() > history_size_)
26 history_.pop_front();
27 }
28
29 } // namespace drive
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1280:2d3e6564b7b6