diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-30 15:52:34 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-30 15:52:34 +0000 |
commit | 23e152e917c70e0399770433d564fe2f54c5ea95 (patch) | |
tree | 8bc4584d15b8bafe7b019448e79e81f1d74be9e5 /chrome/browser/webdata/web_database_table.h | |
parent | 8549a7c039c6db1f1ab9dcf529a97c9262faf227 (diff) | |
download | chromium_src-23e152e917c70e0399770433d564fe2f54c5ea95.zip chromium_src-23e152e917c70e0399770433d564fe2f54c5ea95.tar.gz chromium_src-23e152e917c70e0399770433d564fe2f54c5ea95.tar.bz2 |
Split out Keywords and Autofill logic from WebDatabase.
This is simply moving things around.
No underlying logic has changed.
Since the new class AutofillTable actually encapsulates more
than one table within the schema, I'm open to naming suggestions.
No plans yet for the migration code.
BUG=none
TEST=WebDatabaseTest*,AutofillTableTest*,KeywordTableTest*,ProfileSyncServiceAutofillTest.*
Review URL: http://codereview.chromium.org/6708110
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata/web_database_table.h')
-rw-r--r-- | chrome/browser/webdata/web_database_table.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/chrome/browser/webdata/web_database_table.h b/chrome/browser/webdata/web_database_table.h new file mode 100644 index 0000000..5bb95b9 --- /dev/null +++ b/chrome/browser/webdata/web_database_table.h @@ -0,0 +1,41 @@ +// Copyright (c) 2011 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_TABLE_H_ +#define CHROME_BROWSER_WEBDATA_WEB_DATABASE_TABLE_H_ +#pragma once + +#include "app/sql/connection.h" +#include "app/sql/init_status.h" +#include "app/sql/meta_table.h" + +// An abstract base class representing a table within a WebDatabase. +// Each table should subclass this, adding type-specific methods as needed. +class WebDatabaseTable { + protected: + explicit WebDatabaseTable(sql::Connection* db, sql::MetaTable* meta_table) + : db_(db), meta_table_(meta_table) {} + virtual ~WebDatabaseTable() { + db_ = NULL; + meta_table_ = NULL; + }; + + // Attempts to initialize the table and returns true if successful. + virtual bool Init() = 0; + + // In order to encourage developers to think about sync when adding or + // or altering new tables, this method must be implemented. Please get in + // contact with the sync team if you believe you're making a change that they + // should be aware of (or if you could break something). + // TODO(andybons): Implement something more robust. + virtual bool IsSyncable() = 0; + + sql::Connection* db_; + sql::MetaTable* meta_table_; + + private: + DISALLOW_COPY_AND_ASSIGN(WebDatabaseTable); +}; + +#endif // CHROME_BROWSER_WEBDATA_WEB_DATABASE_TABLE_H_ |