summaryrefslogtreecommitdiffstats
path: root/sql/connection.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 02:00:53 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 02:00:53 +0000
commite2cadec89844f232f4b8887e85cfb72182d49107 (patch)
treeb387565d11df7aabfbd4c8b30b780b620bf0f9cf /sql/connection.cc
parent91f10325d9835d204cbe88693f79221b3b402931 (diff)
downloadchromium_src-e2cadec89844f232f4b8887e85cfb72182d49107.zip
chromium_src-e2cadec89844f232f4b8887e85cfb72182d49107.tar.gz
chromium_src-e2cadec89844f232f4b8887e85cfb72182d49107.tar.bz2
AppCache INTERCEPT namespace.
- Add support for a custom CHROMIUM CACHE MANIFEST signature. Other browsers should ignore files with this signature. - Parse intercept namespace entries out of the new CHROMIUM-INTERCEPT manifest section. Other browsers should ignore this entire section. - Store and retrieve the new kind of namespace records in the database layer. - Upgrade existing databases to the new schema. - Look for matches in the new namespaces when handling main and sub resource requests. - Add unit tests. BUG=101565 Review URL: http://codereview.chromium.org/8396013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114151 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection.cc')
-rw-r--r--sql/connection.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/connection.cc b/sql/connection.cc
index 26e71fd..38fd62a 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -283,12 +283,22 @@ bool Connection::IsSQLValid(const char* sql) {
}
bool Connection::DoesTableExist(const char* table_name) const {
+ return DoesTableOrIndexExist(table_name, "table");
+}
+
+bool Connection::DoesIndexExist(const char* index_name) const {
+ return DoesTableOrIndexExist(index_name, "index");
+}
+
+bool Connection::DoesTableOrIndexExist(
+ const char* name, const char* type) const {
// GetUniqueStatement can't be const since statements may modify the
// database, but we know ours doesn't modify it, so the cast is safe.
Statement statement(const_cast<Connection*>(this)->GetUniqueStatement(
"SELECT name FROM sqlite_master "
- "WHERE type='table' AND name=?"));
- statement.BindString(0, table_name);
+ "WHERE type=? AND name=?"));
+ statement.BindString(0, type);
+ statement.BindString(1, name);
return statement.Step(); // Table exists if any row was returned.
}