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

Side by Side Diff: chrome/browser/extensions/activity_database.h

Issue 12096073: Implement sql::Connection::RazeAndClose(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable DEATH test on android and ios. Created 7 years, 10 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 | « no previous file | chrome/browser/extensions/activity_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 29 matching lines...) Expand all
40 40
41 // Record a APIAction in the database. 41 // Record a APIAction in the database.
42 void RecordAPIAction(scoped_refptr<APIAction> action); 42 void RecordAPIAction(scoped_refptr<APIAction> action);
43 43
44 // Record a BlockedAction in the database. 44 // Record a BlockedAction in the database.
45 void RecordBlockedAction(scoped_refptr<BlockedAction> action); 45 void RecordBlockedAction(scoped_refptr<BlockedAction> action);
46 46
47 // Record an Action in the database. 47 // Record an Action in the database.
48 void RecordAction(scoped_refptr<Action> action); 48 void RecordAction(scoped_refptr<Action> action);
49 49
50 // Break any outstanding transactions, raze the database, and close
51 // it. Future calls on the current database handle will fail, when
52 // next opened the database will be empty.
50 void KillDatabase(); 53 void KillDatabase();
51 54
52 bool initialized() const { return initialized_; } 55 bool initialized() const { return initialized_; }
53 56
54 // Standard db operation wrappers. 57 // Standard db operation wrappers.
55 void BeginTransaction(); 58 void BeginTransaction();
56 void CommitTransaction(); 59 void CommitTransaction();
57 void RollbackTransaction(); 60 void RollbackTransaction();
58 bool Raze(); 61 bool Raze();
59 void Close(); 62 void Close();
60 63
61 private: 64 private:
62 friend class base::RefCountedThreadSafe<ActivityDatabase>; 65 friend class base::RefCountedThreadSafe<ActivityDatabase>;
63 66
64 virtual ~ActivityDatabase(); 67 virtual ~ActivityDatabase();
65 68
66 sql::InitStatus InitializeTable(const char* table_name, 69 sql::InitStatus InitializeTable(const char* table_name,
67 const char* table_structure); 70 const char* table_structure);
68 71
69 sql::Connection db_; 72 sql::Connection db_;
70 bool initialized_; 73 bool initialized_;
71 74
72 DISALLOW_COPY_AND_ASSIGN(ActivityDatabase); 75 DISALLOW_COPY_AND_ASSIGN(ActivityDatabase);
73 }; 76 };
74 77
75 } // namespace extensions 78 } // namespace extensions
76 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_ 79 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/activity_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698