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

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

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_log.h ('k') | chrome/browser/history/visit_log_unittest.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 #include "chrome/browser/history/visit_log.h"
6
7 namespace history {
8
9 static VisitLog* g_visit_log = NULL;
10
11 VisitLog::VisitLog()
12 : index_(0),
13 num_add_(0),
14 num_delete_(0),
15 num_update_(0),
16 num_select_(0) {
17 memset(events_, NO_OP, sizeof(events_));
18 }
19
20 VisitLog::~VisitLog() {
21 }
22
23 void VisitLog::AddEvent(EventType event) {
24 switch (event) {
25 case ADD_VISIT:
26 num_add_++;
27 break;
28 case DELETE_VISIT:
29 num_delete_++;
30 break;
31 case UPDATE_VISIT:
32 num_update_++;
33 break;
34 case SELECT_VISIT:
35 num_select_++;
36 break;
37 default:
38 return;
39 }
40
41 events_[index_++] = event;
42 if (index_ == kVisitLogBufferSize)
43 index_ = 0;
44 }
45
46 void InitVisitLog(VisitLog* vlog) {
47 g_visit_log = vlog;
48 }
49
50 void AddEventToVisitLog(VisitLog::EventType event) {
51 if (!g_visit_log)
52 return;
53 g_visit_log->AddEvent(event);
54 }
55
56 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/visit_log.h ('k') | chrome/browser/history/visit_log_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698