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

Unified Diff: chrome/browser/webdata/web_database.h

Issue 13392014: Move c/b/webdata/ code to components/webdata/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge Created 7 years, 9 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/webdata/web_database.h
diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h
deleted file mode 100644
index 578452dde2fd348044b02f09fea53b96035a357f..0000000000000000000000000000000000000000
--- a/chrome/browser/webdata/web_database.h
+++ /dev/null
@@ -1,78 +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_WEBDATA_WEB_DATABASE_H_
-#define CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_
-
-#include <map>
-
-#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/webdata/web_database_table.h"
-#include "sql/connection.h"
-#include "sql/init_status.h"
-#include "sql/meta_table.h"
-
-namespace base {
-class FilePath;
-}
-
-namespace content {
-class NotificationService;
-}
-
-// This class manages a SQLite database that stores various web page meta data.
-class WebDatabase {
- public:
- enum State {
- COMMIT_NOT_NEEDED,
- COMMIT_NEEDED
- };
- // Exposed publicly so the keyword table can access it.
- static const int kCurrentVersionNumber;
-
- WebDatabase();
- virtual ~WebDatabase();
-
- // Adds a database table. Ownership remains with the caller, which
- // must ensure that the lifetime of |table| exceeds this object's
- // lifetime. Must only be called before Init.
- void AddTable(WebDatabaseTable* table);
-
- // Retrieves a table based on its |key|.
- WebDatabaseTable* GetTable(WebDatabaseTable::TypeKey key);
-
- // Initialize the database given a name. The name defines where the SQLite
- // file is. If this returns an error code, no other method should be called.
- //
- // Before calling this method, you must call AddTable for any
- // WebDatabaseTable objects that are supposed to participate in
- // managing the database.
- sql::InitStatus Init(const base::FilePath& db_name);
-
- // Transactions management
- void BeginTransaction();
- void CommitTransaction();
-
- // Exposed for testing only.
- sql::Connection* GetSQLConnection();
-
- private:
- // Used by |Init()| to migration database schema from older versions to
- // current version.
- sql::InitStatus MigrateOldVersionsAsNeeded();
-
- sql::Connection db_;
- sql::MetaTable meta_table_;
-
- // Map of all the different tables that have been added to this
- // object. Non-owning.
- typedef std::map<WebDatabaseTable::TypeKey, WebDatabaseTable*> TableMap;
- TableMap tables_;
-
- scoped_ptr<content::NotificationService> notification_service_;
-
- DISALLOW_COPY_AND_ASSIGN(WebDatabase);
-};
-
-#endif // CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_

Powered by Google App Engine
This is Rietveld 408576698