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

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

Issue 10870029: Remove legacy migration code that coupled history and bookmarks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove obsoleted unit test. Created 8 years, 4 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) 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 #ifndef CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_
6 #define CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ 6 #define CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Must call Init() to complete construction. Although it can be created on 60 // Must call Init() to complete construction. Although it can be created on
61 // any thread, it must be destructed on the history thread for proper 61 // any thread, it must be destructed on the history thread for proper
62 // database cleanup. 62 // database cleanup.
63 HistoryDatabase(); 63 HistoryDatabase();
64 64
65 virtual ~HistoryDatabase(); 65 virtual ~HistoryDatabase();
66 66
67 // Must call this function to complete initialization. Will return true on 67 // Must call this function to complete initialization. Will return true on
68 // success. On false, no other function should be called. You may want to call 68 // success. On false, no other function should be called. You may want to call
69 // BeginExclusiveMode after this when you are ready. 69 // BeginExclusiveMode after this when you are ready.
70 sql::InitStatus Init(const FilePath& history_name, 70 sql::InitStatus Init(const FilePath& history_name);
71 const FilePath& tmp_bookmarks_path);
72 71
73 // Call to set the mode on the database to exclusive. The default locking mode 72 // Call to set the mode on the database to exclusive. The default locking mode
74 // is "normal" but we want to run in exclusive mode for slightly better 73 // is "normal" but we want to run in exclusive mode for slightly better
75 // performance since we know nobody else is using the database. This is 74 // performance since we know nobody else is using the database. This is
76 // separate from Init() since the in-memory database attaches to slurp the 75 // separate from Init() since the in-memory database attaches to slurp the
77 // data out, and this can't happen in exclusive mode. 76 // data out, and this can't happen in exclusive mode.
78 void BeginExclusiveMode(); 77 void BeginExclusiveMode();
79 78
80 // Returns the current version that we will generate history databases with. 79 // Returns the current version that we will generate history databases with.
81 static int GetCurrentVersion(); 80 static int GetCurrentVersion();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 168
170 // Migration ----------------------------------------------------------------- 169 // Migration -----------------------------------------------------------------
171 170
172 // Makes sure the version is up-to-date, updating if necessary. If the 171 // Makes sure the version is up-to-date, updating if necessary. If the
173 // database is too old to migrate, the user will be notified. In this case, or 172 // database is too old to migrate, the user will be notified. In this case, or
174 // for other errors, false will be returned. True means it is up-to-date and 173 // for other errors, false will be returned. True means it is up-to-date and
175 // ready for use. 174 // ready for use.
176 // 175 //
177 // This assumes it is called from the init function inside a transaction. It 176 // This assumes it is called from the init function inside a transaction. It
178 // may commit the transaction and start a new one if migration requires it. 177 // may commit the transaction and start a new one if migration requires it.
179 sql::InitStatus EnsureCurrentVersion(const FilePath& tmp_bookmarks_path); 178 sql::InitStatus EnsureCurrentVersion();
180 179
181 #if !defined(OS_WIN) 180 #if !defined(OS_WIN)
182 // Converts the time epoch in the database from being 1970-based to being 181 // Converts the time epoch in the database from being 1970-based to being
183 // 1601-based which corresponds to the change in Time.internal_value_. 182 // 1601-based which corresponds to the change in Time.internal_value_.
184 void MigrateTimeEpoch(); 183 void MigrateTimeEpoch();
185 #endif 184 #endif
186 185
187 // --------------------------------------------------------------------------- 186 // ---------------------------------------------------------------------------
188 187
189 sql::Connection db_; 188 sql::Connection db_;
190 sql::MetaTable meta_table_; 189 sql::MetaTable meta_table_;
191 190
192 base::Time cached_early_expiration_threshold_; 191 base::Time cached_early_expiration_threshold_;
193 192
194 // See the getters above. 193 // See the getters above.
195 bool needs_version_17_migration_; 194 bool needs_version_17_migration_;
196 195
197 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); 196 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase);
198 }; 197 };
199 198
200 } // namespace history 199 } // namespace history
201 200
202 #endif // CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ 201 #endif // CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698