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

Side by Side Diff: chrome/browser/history/visit_log.h

Issue 187004: Adding in memory log of history visit database. This... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/visit_database.cc ('k') | chrome/browser/history/visit_log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 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_HISTORY_VISIT_LOG_H_
6 #define CHROME_BROWSER_HISTORY_VISIT_LOG_H_
7
8 #include "base/basictypes.h"
9
10 namespace history {
11
12 // VisitLog provides support for basic in-memory logging of history visit
13 // events. It keeps a circular buffer where the recent visit events is
14 // recorded.
15
16 // This class is not thread safe.
17 class VisitLog {
18 public:
19 VisitLog();
20 ~VisitLog();
21
22 enum EventType {
23 NO_OP,
24 ADD_VISIT,
25 DELETE_VISIT,
26 UPDATE_VISIT,
27 SELECT_VISIT,
28 };
29
30 static int events_buffer_size() { return kVisitLogBufferSize; }
31 unsigned char* events() { return events_; }
32 int index() { return index_; }
33
34 int num_add() { return num_add_; }
35 int num_delete() { return num_delete_; }
36 int num_update() { return num_update_; }
37 int num_select() { return num_select_; }
38
39 void AddEvent(EventType event);
40
41 private:
42 // Circular buffer of recent events.
43 static const int kVisitLogBufferSize = 4096;
44 unsigned char events_[kVisitLogBufferSize];
45 int index_;
46
47 // Event counters
48 int num_add_;
49 int num_delete_;
50 int num_update_;
51 int num_select_;
52
53 DISALLOW_COPY_AND_ASSIGN(VisitLog);
54 };
55
56 void InitVisitLog(VisitLog* vlog);
57 void AddEventToVisitLog(VisitLog::EventType event);
58
59 } // namespace history
60
61 #endif // CHROME_BROWSER_HISTORY_VISIT_LOG_H_
OLDNEW
« no previous file with comments | « chrome/browser/history/visit_database.cc ('k') | chrome/browser/history/visit_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698