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

Unified Diff: chrome/browser/history/archived_database.h

Issue 235863023: Eliminate the archived history database and clean up related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename a few outstanding instances of "archived" to "expired". Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/archived_database.h
diff --git a/chrome/browser/history/archived_database.h b/chrome/browser/history/archived_database.h
deleted file mode 100644
index 3bf896a27752489f10e75810c19a2afb4331ed2b..0000000000000000000000000000000000000000
--- a/chrome/browser/history/archived_database.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_HISTORY_ARCHIVED_DATABASE_H_
-#define CHROME_BROWSER_HISTORY_ARCHIVED_DATABASE_H_
-
-#include "base/basictypes.h"
-#include "chrome/browser/history/url_database.h"
-#include "chrome/browser/history/visit_database.h"
-#include "sql/connection.h"
-#include "sql/init_status.h"
-#include "sql/meta_table.h"
-
-namespace base {
-class FilePath;
-}
-
-namespace history {
-
-// Encapsulates the database operations for archived history.
-//
-// IMPORTANT NOTE: The IDs in this system for URLs and visits will be
-// different than those in the main database. This is to eliminate the
-// dependency between them so we can deal with each one on its own.
-class ArchivedDatabase : public URLDatabase,
- public VisitDatabase {
- public:
- // Must call Init() before using other members.
- ArchivedDatabase();
- virtual ~ArchivedDatabase();
-
- // Initializes the database connection. This must return true before any other
- // functions on this class are called.
- bool Init(const base::FilePath& file_name);
-
- // Try to trim the cache memory used by the database. If |aggressively| is
- // true try to trim all unused cache, otherwise trim by half.
- void TrimMemory(bool aggressively);
-
- // Transactions on the database. We support nested transactions and only
- // commit when the outermost one is committed (sqlite doesn't support true
- // nested transactions).
- void BeginTransaction();
- void CommitTransaction();
-
- // Returns the current version that we will generate archived databases with.
- static int GetCurrentVersion();
-
- private:
- bool InitTables();
-
- // Implemented for the specialized databases.
- virtual sql::Connection& GetDB() OVERRIDE;
-
- // Makes sure the version is up-to-date, updating if necessary. If the
- // database is too old to migrate, the user will be notified. In this case, or
- // for other errors, false will be returned. True means it is up-to-date and
- // ready for use.
- //
- // This assumes it is called from the init function inside a transaction. It
- // may commit the transaction and start a new one if migration requires it.
- sql::InitStatus EnsureCurrentVersion();
-
- // The database.
- sql::Connection db_;
- sql::MetaTable meta_table_;
-
- DISALLOW_COPY_AND_ASSIGN(ArchivedDatabase);
-};
-
-} // namespace history
-
-#endif // CHROME_BROWSER_HISTORY_ARCHIVED_DATABASE_H_

Powered by Google App Engine
This is Rietveld 408576698