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

Unified Diff: chrome/browser/webdata/web_apps_table.cc

Issue 12543034: Move creation of the various WebDatabaseTable types out of WebDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows release builds (COMDAT folding combined static functions being used for keys. 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
« no previous file with comments | « chrome/browser/webdata/web_apps_table.h ('k') | chrome/browser/webdata/web_apps_table_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/web_apps_table.cc
diff --git a/chrome/browser/webdata/web_apps_table.cc b/chrome/browser/webdata/web_apps_table.cc
index 927b934c6e1322912591a03fca6c8c3a9dbdc0f9..ffa8cb028580e20d08a5010ebfd496a3d8772fe2 100644
--- a/chrome/browser/webdata/web_apps_table.cc
+++ b/chrome/browser/webdata/web_apps_table.cc
@@ -6,12 +6,33 @@
#include "base/logging.h"
#include "chrome/browser/history/history_database.h"
+#include "chrome/browser/webdata/web_database.h"
#include "googleurl/src/gurl.h"
#include "sql/statement.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
-bool WebAppsTable::Init() {
+namespace {
+
+int table_key = 0;
+
+WebDatabaseTable::TypeKey GetKey() {
+ return reinterpret_cast<void*>(&table_key);
+}
+
+} // namespace
+
+WebAppsTable* WebAppsTable::FromWebDatabase(WebDatabase* db) {
+ return static_cast<WebAppsTable*>(db->GetTable(GetKey()));
+}
+
+WebDatabaseTable::TypeKey WebAppsTable::GetTypeKey() const {
+ return GetKey();
+}
+
+bool WebAppsTable::Init(sql::Connection* db, sql::MetaTable* meta_table) {
+ WebDatabaseTable::Init(db, meta_table);
+
return (InitWebAppIconsTable() && InitWebAppsTable());
}
« no previous file with comments | « chrome/browser/webdata/web_apps_table.h ('k') | chrome/browser/webdata/web_apps_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698