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

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: 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
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 27 matching lines...) Expand all
38 38
39 // Record a APIAction in the database. 39 // Record a APIAction in the database.
40 void RecordAPIAction(scoped_refptr<APIAction> action); 40 void RecordAPIAction(scoped_refptr<APIAction> action);
41 41
42 // Record a BlockedAction in the database. 42 // Record a BlockedAction in the database.
43 void RecordBlockedAction(scoped_refptr<BlockedAction> action); 43 void RecordBlockedAction(scoped_refptr<BlockedAction> action);
44 44
45 // Record an Action in the database. 45 // Record an Action in the database.
46 void RecordAction(scoped_refptr<Action> action); 46 void RecordAction(scoped_refptr<Action> action);
47 47
48 // Break any outstanding transactions, raze the database, and close
49 // it. Future calls on the current database handle will fail, when
50 // next opened the database will be empty.
48 void KillDatabase(); 51 void KillDatabase();
49 52
50 bool initialized() const { return initialized_; } 53 bool initialized() const { return initialized_; }
51 54
52 // Standard db operation wrappers. 55 // Standard db operation wrappers.
53 void BeginTransaction(); 56 void BeginTransaction();
54 void CommitTransaction(); 57 void CommitTransaction();
55 void RollbackTransaction(); 58 void RollbackTransaction();
56 bool Raze(); 59 bool Raze();
57 void Close(); 60 void Close();
58 61
59 private: 62 private:
60 friend class base::RefCountedThreadSafe<ActivityDatabase>; 63 friend class base::RefCountedThreadSafe<ActivityDatabase>;
61 64
62 virtual ~ActivityDatabase(); 65 virtual ~ActivityDatabase();
63 66
64 sql::InitStatus InitializeTable(const char* table_name, 67 sql::InitStatus InitializeTable(const char* table_name,
65 const char* table_structure); 68 const char* table_structure);
66 69
67 sql::Connection db_; 70 sql::Connection db_;
68 bool initialized_; 71 bool initialized_;
69 72
70 DISALLOW_COPY_AND_ASSIGN(ActivityDatabase); 73 DISALLOW_COPY_AND_ASSIGN(ActivityDatabase);
71 }; 74 };
72 75
73 } // namespace extensions 76 } // namespace extensions
74 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_ 77 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_
75
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/activity_database.cc » ('j') | chrome/browser/net/sqlite_persistent_cookie_store.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698