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

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

Issue 11946028: Record event activity to the extension activity log. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rename ActivityLog::IsLoggingEnabled 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include <string> 5 #include <string>
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/browser/extensions/activity_database.h" 8 #include "chrome/browser/extensions/activity_database.h"
9 #include "chrome/browser/history/url_database.h" 9 #include "chrome/browser/history/url_database.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #endif 49 #endif
50 50
51 db_.Preload(); 51 db_.Preload();
52 52
53 // Create the UrlAction database. 53 // Create the UrlAction database.
54 if (InitializeTable(UrlAction::kTableName, UrlAction::kTableStructure) != 54 if (InitializeTable(UrlAction::kTableName, UrlAction::kTableStructure) !=
55 sql::INIT_OK) 55 sql::INIT_OK)
56 return LogInitFailure(); 56 return LogInitFailure();
57 57
58 // Create the APIAction database. 58 // Create the APIAction database.
59 if (InitializeTable(APIAction::kTableName, APIAction::kTableStructure) 59 if (!APIAction::InitializeTable(&db_))
60 != sql::INIT_OK)
61 return LogInitFailure(); 60 return LogInitFailure();
62 61
63 // Create the BlockedAction database. 62 // Create the BlockedAction database.
64 if (InitializeTable(BlockedAction::kTableName, BlockedAction::kTableStructure) 63 if (InitializeTable(BlockedAction::kTableName, BlockedAction::kTableStructure)
65 != sql::INIT_OK) 64 != sql::INIT_OK)
66 return LogInitFailure(); 65 return LogInitFailure();
67 66
68 sql::InitStatus stat = committer.Commit() ? sql::INIT_OK : sql::INIT_FAILURE; 67 sql::InitStatus stat = committer.Commit() ? sql::INIT_OK : sql::INIT_FAILURE;
69 if (stat == sql::INIT_OK) 68 if (stat == sql::INIT_OK)
70 initialized_ = true; 69 initialized_ = true;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 db_.Close(); 113 db_.Close();
115 } 114 }
116 115
117 void ActivityDatabase::KillDatabase() { 116 void ActivityDatabase::KillDatabase() {
118 db_.RollbackTransaction(); 117 db_.RollbackTransaction();
119 db_.Raze(); 118 db_.Raze();
120 db_.Close(); 119 db_.Close();
121 } 120 }
122 121
123 } // namespace extensions 122 } // namespace extensions
124
OLDNEW
« no previous file with comments | « chrome/browser/extensions/activity_database.h ('k') | chrome/browser/extensions/activity_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698