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

Unified Diff: Source/WebCore/storage/SQLTransactionSync.cpp

Issue 7563014: Merge 92155 - [Chromium] WebSQLDatabase version handling is broken in multi-process browsers. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 5 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 | « Source/WebCore/storage/SQLTransactionSync.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/storage/SQLTransactionSync.cpp
===================================================================
--- Source/WebCore/storage/SQLTransactionSync.cpp (revision 92303)
+++ Source/WebCore/storage/SQLTransactionSync.cpp (working copy)
@@ -58,6 +58,7 @@
: m_database(db)
, m_callback(callback)
, m_readOnly(readOnly)
+ , m_hasVersionMismatch(false)
, m_modifiedDatabase(false)
, m_transactionClient(adoptPtr(new SQLTransactionClient()))
{
@@ -79,7 +80,7 @@
return 0;
}
- if (!m_database->versionMatchesExpected()) {
+ if (m_hasVersionMismatch) {
ec = SQLException::VERSION_ERR;
return 0;
}
@@ -150,6 +151,16 @@
return SQLException::DATABASE_ERR;
}
+ // Note: We intentionally retrieve the actual version even with an empty expected version.
+ // In multi-process browsers, we take this opportinutiy to update the cached value for
+ // the actual version. In single-process browsers, this is just a map lookup.
+ String actualVersion;
+ if (!m_database->getActualVersionForTransaction(actualVersion)) {
+ rollback();
+ return SQLException::DATABASE_ERR;
+ }
+ m_hasVersionMismatch = !m_database->expectedVersion().isEmpty()
+ && (m_database->expectedVersion() != actualVersion);
return 0;
}
« no previous file with comments | « Source/WebCore/storage/SQLTransactionSync.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698