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

Side by Side Diff: sql/connection.cc

Issue 1351653002: [sql] sqlite3_initialize() before additional entry point. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sql/connection.h" 5 #include "sql/connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 bool Connection::Delete(const base::FilePath& path) { 669 bool Connection::Delete(const base::FilePath& path) {
670 base::ThreadRestrictions::AssertIOAllowed(); 670 base::ThreadRestrictions::AssertIOAllowed();
671 671
672 base::FilePath journal_path(path.value() + FILE_PATH_LITERAL("-journal")); 672 base::FilePath journal_path(path.value() + FILE_PATH_LITERAL("-journal"));
673 base::FilePath wal_path(path.value() + FILE_PATH_LITERAL("-wal")); 673 base::FilePath wal_path(path.value() + FILE_PATH_LITERAL("-wal"));
674 674
675 std::string journal_str = AsUTF8ForSQL(journal_path); 675 std::string journal_str = AsUTF8ForSQL(journal_path);
676 std::string wal_str = AsUTF8ForSQL(wal_path); 676 std::string wal_str = AsUTF8ForSQL(wal_path);
677 std::string path_str = AsUTF8ForSQL(path); 677 std::string path_str = AsUTF8ForSQL(path);
678 678
679 // Make sure sqlite3_initialize() is called before anything else.
680 InitializeSqlite();
681
679 sqlite3_vfs* vfs = sqlite3_vfs_find(NULL); 682 sqlite3_vfs* vfs = sqlite3_vfs_find(NULL);
680 CHECK(vfs); 683 CHECK(vfs);
681 CHECK(vfs->xDelete); 684 CHECK(vfs->xDelete);
682 CHECK(vfs->xAccess); 685 CHECK(vfs->xAccess);
683 686
684 // We only work with unix, win32 and mojo filesystems. If you're trying to 687 // We only work with unix, win32 and mojo filesystems. If you're trying to
685 // use this code with any other VFS, you're not in a good place. 688 // use this code with any other VFS, you're not in a good place.
686 CHECK(strncmp(vfs->zName, "unix", 4) == 0 || 689 CHECK(strncmp(vfs->zName, "unix", 4) == 0 ||
687 strncmp(vfs->zName, "win32", 5) == 0 || 690 strncmp(vfs->zName, "win32", 5) == 0 ||
688 strcmp(vfs->zName, "mojo") == 0); 691 strcmp(vfs->zName, "mojo") == 0);
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 ignore_result(Execute(kNoWritableSchema)); 1385 ignore_result(Execute(kNoWritableSchema));
1383 1386
1384 return ret; 1387 return ret;
1385 } 1388 }
1386 1389
1387 base::TimeTicks TimeSource::Now() { 1390 base::TimeTicks TimeSource::Now() {
1388 return base::TimeTicks::Now(); 1391 return base::TimeTicks::Now();
1389 } 1392 }
1390 1393
1391 } // namespace sql 1394 } // namespace sql
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698