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

Unified Diff: third_party/sqlite/patches/0005-Modify-default-VFS-to-support-WebDatabase.patch

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: third_party/sqlite/patches/0005-Modify-default-VFS-to-support-WebDatabase.patch
diff --git a/third_party/sqlite/patches/0005-Modify-default-VFS-to-support-WebDatabase.patch b/third_party/sqlite/patches/0005-Modify-default-VFS-to-support-WebDatabase.patch
deleted file mode 100644
index 658136b076e4a9e2bd053f4e534401dc1c875674..0000000000000000000000000000000000000000
--- a/third_party/sqlite/patches/0005-Modify-default-VFS-to-support-WebDatabase.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From 0125566ec87741be89ba7c4e9c2e4cc3436a6122 Mon Sep 17 00:00:00 2001
-From: dumi <dumi@chromium.org>
-Date: Mon, 20 Jul 2009 23:40:51 +0000
-Subject: [PATCH 05/12] Modify default VFS to support WebDatabase.
-
-The renderer WebDatabase implementation needs to broker certain requests
-to the browser. This modifies SQLite to allow monkey-patching the VFS
-to support this.
-
-NOTE(shess): This patch relies on core SQLite implementation details
-remaining unchanged. When importing a new version of SQLite, pay very
-close attention to whether the change is still doing what is intended.
-
-Original review URLs:
-https://codereview.chromium.org/159044
-https://codereview.chromium.org/384075
-https://codereview.chromium.org/377039
-[Possibly not a complete list.]
----
- third_party/sqlite/src/src/os_unix.c | 49 ++++++++++++++++++++++++++++++++++
- third_party/sqlite/src/src/os_win.c | 8 ++++++
- third_party/sqlite/src/src/sqlite.h.in | 23 ++++++++++++++++
- 3 files changed, 80 insertions(+)
-
-diff --git a/third_party/sqlite/src/src/os_unix.c b/third_party/sqlite/src/src/os_unix.c
-index a9344ee..ea52abb 100644
---- a/third_party/sqlite/src/src/os_unix.c
-+++ b/third_party/sqlite/src/src/os_unix.c
-@@ -1321,6 +1321,12 @@ static int fileHasMoved(unixFile *pFile){
- return pFile->pInode!=0 && pFile->pId!=pFile->pInode->fileId.pId;
- #else
- struct stat buf;
-+
-+ /* TODO(shess): This check doesn't work when the Chromium's WebDB code is
-+ ** running in the sandbox.
-+ */
-+ return 0;
-+
- return pFile->pInode!=0 &&
- (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino);
- #endif
-@@ -5615,6 +5621,44 @@ static int findCreateFileMode(
- }
-
- /*
-+** Initialize |unixFile| internals of |file| on behalf of chromiumOpen() in
-+** WebDatabase SQLiteFileSystemPosix.cpp. Function is a subset of unixOpen(),
-+** each duplicated piece is marked by "Duplicated in" comment in unixOpen().
-+*/
-+CHROMIUM_SQLITE_API
-+int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* pVfs,
-+ int fd,
-+ sqlite3_file* pFile,
-+ const char* zPath,
-+ int noLock,
-+ int flags) {
-+ unixFile *p = (unixFile *)pFile;
-+ const int eType = flags&0xFFFFFF00; /* Type of file to open */
-+ const int ctrlFlags = (noLock ? UNIXFILE_NOLOCK : 0);
-+ int rc;
-+
-+ memset(p, 0, sizeof(unixFile));
-+
-+ /* osStat() will not work in the sandbox, so findReusableFd() will always
-+ ** fail, so directly include the failure-case setup then initialize pUnused.
-+ */
-+ if( eType==SQLITE_OPEN_MAIN_DB ){
-+ p->pUnused = sqlite3_malloc(sizeof(*p->pUnused));
-+ if (!p->pUnused) {
-+ return SQLITE_NOMEM;
-+ }
-+ p->pUnused->fd = fd;
-+ p->pUnused->flags = flags;
-+ }
-+
-+ rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags);
-+ if( rc!=SQLITE_OK ){
-+ sqlite3_free(p->pUnused);
-+ }
-+ return rc;
-+}
-+
-+/*
- ** Open the file zPath.
- **
- ** Previously, the SQLite OS layer used three functions in place of this
-@@ -5715,6 +5759,7 @@ static int unixOpen(
- sqlite3_randomness(0,0);
- }
-
-+ /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */
- memset(p, 0, sizeof(unixFile));
-
- if( eType==SQLITE_OPEN_MAIN_DB ){
-@@ -5723,6 +5768,7 @@ static int unixOpen(
- if( pUnused ){
- fd = pUnused->fd;
- }else{
-+ /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */
- pUnused = sqlite3_malloc(sizeof(*pUnused));
- if( !pUnused ){
- return SQLITE_NOMEM;
-@@ -5799,6 +5845,7 @@ static int unixOpen(
- }
-
- if( p->pUnused ){
-+ /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */
- p->pUnused->fd = fd;
- p->pUnused->flags = flags;
- }
-@@ -5889,10 +5936,12 @@ static int unixOpen(
- }
- #endif
-
-+ /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */
- rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags);
-
- open_finished:
- if( rc!=SQLITE_OK ){
-+ /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */
- sqlite3_free(p->pUnused);
- }
- return rc;
-diff --git a/third_party/sqlite/src/src/os_win.c b/third_party/sqlite/src/src/os_win.c
-index 8ca2107..9320bfc 100644
---- a/third_party/sqlite/src/src/os_win.c
-+++ b/third_party/sqlite/src/src/os_win.c
-@@ -5546,4 +5546,12 @@ int sqlite3_os_end(void){
- return SQLITE_OK;
- }
-
-+CHROMIUM_SQLITE_API
-+void chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE handle) {
-+ winFile* winSQLite3File = (winFile*)file;
-+ memset(file, 0, sizeof(*file));
-+ winSQLite3File->pMethod = &winIoMethod;
-+ winSQLite3File->h = handle;
-+}
-+
- #endif /* SQLITE_OS_WIN */
-diff --git a/third_party/sqlite/src/src/sqlite.h.in b/third_party/sqlite/src/src/sqlite.h.in
-index f1d4e40..14c12f2 100644
---- a/third_party/sqlite/src/src/sqlite.h.in
-+++ b/third_party/sqlite/src/src/sqlite.h.in
-@@ -7408,6 +7408,29 @@ int sqlite3_vtab_on_conflict(sqlite3 *);
-
-
-
-+/* Begin WebDatabase patch for Chromium */
-+/* Expose some SQLite internals for the WebDatabase vfs.
-+** DO NOT EXTEND THE USE OF THIS.
-+*/
-+#ifndef CHROMIUM_SQLITE_API
-+#define CHROMIUM_SQLITE_API SQLITE_API
-+#endif
-+#if defined(CHROMIUM_SQLITE_INTERNALS)
-+#ifdef _WIN32
-+CHROMIUM_SQLITE_API
-+void chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE handle);
-+#else /* _WIN32 */
-+CHROMIUM_SQLITE_API
-+int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* pVfs,
-+ int fd,
-+ sqlite3_file* pFile,
-+ const char* zPath,
-+ int noLock,
-+ int flags);
-+#endif /* _WIN32 */
-+#endif /* CHROMIUM_SQLITE_INTERNALS */
-+/* End WebDatabase patch for Chromium */
-+
- /*
- ** Undo the hack that converts floating point types to integer for
- ** builds on processors without floating point support.
---
-2.6.3
-

Powered by Google App Engine
This is Rietveld 408576698