summaryrefslogtreecommitdiffstats
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* Mark gtest and gmock as testonly in GN.Brett Wilson2014-09-081-0/+1
| | | | | | | | | | | This updates the targets that depend on these to also be test-only. BUG=http://crbug.com/412064 R=jamesr@chromium.org, tfarina@chromium.org Review URL: https://codereview.chromium.org/551933002 Cr-Commit-Position: refs/heads/master@{#293808}
* Change base/file_utils.h includes to base/files/file_utils.h in gin, ↵thestig2014-09-058-8/+8
| | | | | | | | | | google_apis, printing, sql, ui, and webkit. TBR=jochen@chromium.org,rogerta@chromium.org,shess@chromium.org,ben@chromium.org,jamesr@chromium.org Review URL: https://codereview.chromium.org/529273002 Cr-Commit-Position: refs/heads/master@{#293479}
* Move StringToLowerASCII to base namespacebrettw@chromium.org2014-08-071-1/+1
| | | | | | | | TBR=sky Review URL: https://codereview.chromium.org/448853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288085 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes for re-enabling more MSVC level 4 warnings: misc edition #2pkasting@chromium.org2014-07-181-2/+2
| | | | | | | | | | | | | | | | | | This contains fixes for the following sorts of issues: * Assignment inside conditional * Taking the address of a temporary * Octal escape sequence terminated by decimal number * Signedness mismatch * Possibly-uninitialized local variable This also contains a small number of cleanups to nearby code (e.g. no else after return). BUG=81439 TEST=none Review URL: https://codereview.chromium.org/382673002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283967 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Test recovery of corrupt golden file.shess@chromium.org2014-07-109-2/+221
| | | | | | | | | | | | | Manually modify a SQLite database to have the problem described by the bug, then test that it can be recovered. Also, infrastructure to introduce testing data to sql/ tests. BUG=387868 Review URL: https://codereview.chromium.org/355093003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282197 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Land binary golden file for test.shess@chromium.org2014-07-081-0/+0
| | | | | | | | | | | recovery_387868 is modified to have a specific form of corruption. BUG=387868 TBR=michaeln@chromium.org Review URL: https://codereview.chromium.org/372823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281787 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Windows build, add Sandbox implementation.brettw@chromium.org2014-06-021-1/+1
| | | | | | | | R=scottmg@chromium.org Review URL: https://codereview.chromium.org/301193005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274160 0039d316-1c4b-4281-b951-d872f2087c98
* Add GN build files for sql and google_apis.brettw@chromium.org2014-05-281-0/+94
| | | | | | | | R=scottmg@chromium.org, scottmg Review URL: https://codereview.chromium.org/298293005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273343 0039d316-1c4b-4281-b951-d872f2087c98
* Android: cleanup gtest_target_type conditions.bulach@chromium.org2014-05-171-4/+2
| | | | | | | | | | | | For a long time (crrev.com/133053) OS==android implies: gtest_target_type=shared_library Cleanup the spurious conditions and obsolete TODOs. BUG= Review URL: https://codereview.chromium.org/278443003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271222 0039d316-1c4b-4281-b951-d872f2087c98
* Remove {linux|android}_use_tcmalloc and switch to use_allocator in Chromium.dmikurube@chromium.org2014-05-071-2/+1
| | | | | | | | | | | | | | If this change breaks some bots, please try restarting the bot before reverting it. http://crrev.com/264460 may not be effective yet until restarting. See the bug and http://crrev.com/255129 for the details. BUG=345554 Review URL: https://codereview.chromium.org/258433005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268876 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused input_shlib_pathcjhopman@chromium.org2014-04-171-1/+0
| | | | | | | | | | This path is now only inferred from test_suite_name. TBR=darin NOTRY=true Review URL: https://codereview.chromium.org/226353002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264666 0039d316-1c4b-4281-b951-d872f2087c98
* Remove all uses of GG_LONGLONG and GG_ULONGLONG.viettrungluu@chromium.org2014-04-081-2/+2
| | | | | | | | | | | | | | | | | | | 123LL and 123ULL now work everywhere. You can also use INT64_C and UINT64_C (from <stdint.h>) in Chromium code (we force-define __STDC_CONSTANT_MACROS). (And sometimes you can just use static_cast<(u)int64_t>.) Don't remove their definitions yet, because some macros that are multiply-defined (in an identical way) rely on them. D'oh. R=brettw@chromium.org TBR=sky@chromium.org,satorux@chromium.org,vrk@chromium.org,rch@chromium.org,shess@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=262147 Review URL: https://codereview.chromium.org/218953003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262294 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 262147 "Remove all uses of GG_LONGLONG and GG_ULONGLONG."scottmg@chromium.org2014-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | > Remove all uses of GG_LONGLONG and GG_ULONGLONG. > > 123LL and 123ULL now work everywhere. You can also use INT64_C and > UINT64_C (from <stdint.h>) in Chromium code (we force-define > __STDC_CONSTANT_MACROS). (And sometimes you can just use > static_cast<(u)int64_t>.) > > Don't remove their definitions yet, because some macros that are > multiply-defined (in an identical way) rely on them. D'oh. > > R=brettw@chromium.org > TBR=sky@chromium.org,satorux@chromium.org,vrk@chromium.org,rch@chromium.org,shess@chromium.org > > Review URL: https://codereview.chromium.org/218953003 TBR=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/227743006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262165 0039d316-1c4b-4281-b951-d872f2087c98
* Remove all uses of GG_LONGLONG and GG_ULONGLONG.viettrungluu@chromium.org2014-04-071-2/+2
| | | | | | | | | | | | | | | | | 123LL and 123ULL now work everywhere. You can also use INT64_C and UINT64_C (from <stdint.h>) in Chromium code (we force-define __STDC_CONSTANT_MACROS). (And sometimes you can just use static_cast<(u)int64_t>.) Don't remove their definitions yet, because some macros that are multiply-defined (in an identical way) rely on them. D'oh. R=brettw@chromium.org TBR=sky@chromium.org,satorux@chromium.org,vrk@chromium.org,rch@chromium.org,shess@chromium.org Review URL: https://codereview.chromium.org/218953003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262147 0039d316-1c4b-4281-b951-d872f2087c98
* Misc. cleanup found while mucking with search engines code:pkasting@chromium.org2014-04-012-15/+6
| | | | | | | | | | | | | | | | | | | | | | | * Don't handle DCHECK failure * Remove NOTREACHED()/LOG(ERROR) from cases that look like they could legitimately happen * All lines of args should begin at the same position * WebDataService::SetDefaultSearchProvider() doesn't actually need a full TemplateURL, just an ID * Use GetCachedStatement correctly, and in more places * Make KeywordTableTest a friend of KeywordTable to reduce FRIEND_TEST declarations and in preparation for making Add/Update/RemoveKeyword private * Data members should be private, not protected * Function declarations: all args on first line or one arg per line * Fix misspelling BUG=none TEST=none R=shess@chromium.org Review URL: https://codereview.chromium.org/217613002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260933 0039d316-1c4b-4281-b951-d872f2087c98
* Add unistd.h include in a file using geteuid().thakis@chromium.org2014-03-311-4/+0
| | | | | | | | | | | (Also delete two dead methods in other files.) BUG=31877 NOTRY=true Review URL: https://codereview.chromium.org/218133002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260569 0039d316-1c4b-4281-b951-d872f2087c98
* Move ScopedFILE to base namespace and scoped_file.hbrettw@chromium.org2014-03-172-5/+7
| | | | | | | | R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/196073002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257518 0039d316-1c4b-4281-b951-d872f2087c98
* Add use_allocator instead of linux_use_tcmalloc to switch the allocator.dmikurube@chromium.org2014-03-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is to add a new build option 'use_allocator' which will replace 'linux_use_tcmalloc' in the future. It doesn't change the behavior immediately. The migration plan is as follows: 1) (this change) ... Add 'use_allocator' and set its default to "see_use_tcmalloc". ... Change allocator conditions to check use_allocator firstly. ... Use linux_use_tcmalloc if use_allocator=="see_use_tcmalloc". ... NO IMPACT without specifying use_allocator explicitly. 2) Change Blink to accept use_allocator. http://crrev.com/177053003/ 3) Change gyp to accept use_allocator. http://crrev.com/178643004/ 4) PSA the transition period to chromium-dev@. 5) (after the PSA-ed transition period) ... Make 'use_allocator' to "tcmalloc" or "none" (it depends) by default. ... Remove all linux_use_tcmalloc. ... Assert in gyp_chromium to check if linux_use_tcmalloc is not specified. At the point of this change (1), linux_use_tcmalloc is still used by default because 'use_allocator%': "see_use_tcmalloc". As written in http://crbug.com/345554, linux_use_tcmalloc would be confusing to have more options about allocators. We plan to: A) enable gperftools' heap-profiler with non-tcmalloc allocator, B) add a new memory allocator instead of tcmalloc. BUG=345554, 339604, 341349 R=agl@chromium.org, brettw@chromium.org, dgarrett@chromium.org, jam@chromium.org, jamesr@chromium.org, joi@chromium.org, miket@chromium.org, nick@chromium.org, rsleevi@chromium.org, scherkus@chromium.org, sergeyu@chromium.org, shess@chromium.org, sievers@chromium.org, sky@chromium.org, vitalybuka@chromium.org, willchan@chromium.org Review URL: https://codereview.chromium.org/177353002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255129 0039d316-1c4b-4281-b951-d872f2087c98
* ui/base/resource: Remove dependency on net's big_endian implementation.tfarina@chromium.org2014-02-261-1/+1
| | | | | | | | | | | | | | | | To remove this dependency we ended up moving big_endian* to base/, since besides ui/, big_endian is also used by other top-level modules: chrome/utility/, cloud_print, media/cast This way we removed one more net dependency from ui/base/. BUG=299841 TEST=ui_unittests R=tony@chromium.org,mark@chromium.org,hclam@chromium.org,vitalybuka@chromium.org TBR=ben@chromium.org Review URL: https://codereview.chromium.org/145873006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253510 0039d316-1c4b-4281-b951-d872f2087c98
* Update uses of UTF conversions in ppapi/, printing/, remoting/, rlz/, ↵avi@chromium.org2013-12-252-3/+3
| | | | | | | | | | | | sandbox/, skia/, sql/, sync/, tools/, webkit/, win8/ to use the base:: namespace. BUG=330556 TEST=no change TBR=ben@chromium.org Review URL: https://codereview.chromium.org/121123002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242502 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Rewrite Connection::Preload() in terms of file reading.shess@chromium.org2013-12-212-27/+51
| | | | | | | | | | | | | | | r204860 rewrote sqlite3_preload() to read the file without placing the data in the SQLite cache to improve memory footprint. No reports of performance degradation ensued. This CL rewrites Connection::Preload() to use the SQLite file handle to read the data, and backs out the preload-cache.patch from third_party/sqlite/. BUG=243949 Review URL: https://codereview.chromium.org/116443004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242225 0039d316-1c4b-4281-b951-d872f2087c98
* AppCache: Run a quick integrity check on the sqlite database when opening. ↵michaeln@chromium.org2013-12-163-9/+73
| | | | | | | | | | | | If the test fails, delete the appcache directory and start afresh. NOTRY=true TBR=sky BUG=318544 Review URL: https://codereview.chromium.org/104593010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240937 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 239400 "Revert 239280 "Move more file_util functions to b..."thakis@chromium.org2013-12-082-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Broke all bots 9_9 > Revert 239280 "Move more file_util functions to base namespace." > > dbus_unittests started fialing on Linux Tests (dbg)(2) and Linux Tests (dbg)(2)(32). > This CL is the only in the intersection of CLs in the first failing build on > the two builders, so giving a speculative revert a try (rlarocque already > tried a clobber, it didn't help). > > http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%282%29/builds/41806 > http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%282%29%2832%29/builds/8544 > > > > Move more file_util functions to base namespace. > > > > TBR=sky > > > > Review URL: https://codereview.chromium.org/109043002 > > TBR=brettw@chromium.org > > Review URL: https://codereview.chromium.org/105823009 TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/100923007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239401 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 239280 "Move more file_util functions to base namespace."thakis@chromium.org2013-12-082-5/+5
| | | | | | | | | | | | | | | | | | | | | | | dbus_unittests started fialing on Linux Tests (dbg)(2) and Linux Tests (dbg)(2)(32). This CL is the only in the intersection of CLs in the first failing build on the two builders, so giving a speculative revert a try (rlarocque already tried a clobber, it didn't help). http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%282%29/builds/41806 http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%282%29%2832%29/builds/8544 > Move more file_util functions to base namespace. > > TBR=sky > > Review URL: https://codereview.chromium.org/109043002 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/105823009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239400 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Recovery code for "Top Sites" database.shess@chromium.org2013-12-085-86/+147
| | | | | | | | | | | | | | | | | | | | Port recovery code from thumbnail_database.cc to top_sites_database.cc. Also retry Init() in case the recovery code fixes things (a quarter to a third of databases have problems detected during open). Extend sql::Recovery::AutoRecoverTable() to handle DOUBLE columns. Abstract out sql::test::CorruptTableOrIndex() to ease writing corruption tests. IWYU pass on various files. BUG=321852 Review URL: https://codereview.chromium.org/86653002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239377 0039d316-1c4b-4281-b951-d872f2087c98
* Move more file_util functions to base namespace.brettw@chromium.org2013-12-073-7/+7
| | | | | | | | TBR=sky Review URL: https://codereview.chromium.org/109043002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239280 0039d316-1c4b-4281-b951-d872f2087c98
* Move GetFileSize, NormalizeFilePath to base namespacebrettw@chromium.org2013-12-042-2/+2
| | | | | | | | | BUG= R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/102873002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238722 0039d316-1c4b-4281-b951-d872f2087c98
* Convert string16 to base::string16 in content.brettw@chromium.org2013-12-032-10/+10
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/102593002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238447 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Annotate sql::Recovery failure cases.shess@chromium.org2013-11-281-9/+128
| | | | | | | | | | | | | | | A large number of thumbnail_database.cc recovery failures are in building the scoped recovery instance. Break down failure cases for sql::Recovery to see if there is any action to be taken. Additionally, track failure calling sql::Recovery::Recovered(). BUG=109482 TBR=sky@chromium.org Review URL: https://codereview.chromium.org/83323005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237680 0039d316-1c4b-4281-b951-d872f2087c98
* Move Posix file utils to the base namespace.brettw@chromium.org2013-11-272-23/+23
| | | | | | | | | BUG= R=rvargas@chromium.org Review URL: https://codereview.chromium.org/89523002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237642 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 235595 "Revert 235492 "[sql] Recover Favicons v5 database..."kinuko@chromium.org2013-11-186-21/+636
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > Revert 235492 "[sql] Recover Favicons v5 databases, with more re..." > > Speculative revert to find the cause for Mac size regression > (will revert this revert later) > > > [sql] Recover Favicons v5 databases, with more recovery automation. > > > > An entirely automated recovery system runs afoul of questions about > > whether the corrupt database's schema can be trusted. > > sql::Recovery::AutoRecoverTable() uses a schema created by the caller > > to construct the recovery virtual table and then copies the data over. > > > > sql::Recovery::SetupMeta() and GetMetaVersionNumber() simplify > > accessing meta-table info in the corrupt database. > > > > sql::test::IntegrityCheck() and CorruptSizeInHeader() helpers to > > simplify common testing operations. > > > > Rewrite ThumbnailDatabase v6 and v7 recovery code and tests using > > these changes, and add a v5 recovery path. Additionally handle > > deprecated versions. > > > > BUG=240396,109482 > > > > Review URL: https://codereview.chromium.org/50493012 > > TBR=shess@chromium.org > > Review URL: https://codereview.chromium.org/74933002 TBR=kinuko@chromium.org Review URL: https://codereview.chromium.org/74953002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235604 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 235492 "[sql] Recover Favicons v5 databases, with more re..."kinuko@chromium.org2013-11-186-636/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Speculative revert to find the cause for Mac size regression (will revert this revert later) > [sql] Recover Favicons v5 databases, with more recovery automation. > > An entirely automated recovery system runs afoul of questions about > whether the corrupt database's schema can be trusted. > sql::Recovery::AutoRecoverTable() uses a schema created by the caller > to construct the recovery virtual table and then copies the data over. > > sql::Recovery::SetupMeta() and GetMetaVersionNumber() simplify > accessing meta-table info in the corrupt database. > > sql::test::IntegrityCheck() and CorruptSizeInHeader() helpers to > simplify common testing operations. > > Rewrite ThumbnailDatabase v6 and v7 recovery code and tests using > these changes, and add a v5 recovery path. Additionally handle > deprecated versions. > > BUG=240396,109482 > > Review URL: https://codereview.chromium.org/50493012 TBR=shess@chromium.org Review URL: https://codereview.chromium.org/74933002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235595 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Recover Favicons v5 databases, with more recovery automation.shess@chromium.org2013-11-166-21/+636
| | | | | | | | | | | | | | | | | | | | | | | An entirely automated recovery system runs afoul of questions about whether the corrupt database's schema can be trusted. sql::Recovery::AutoRecoverTable() uses a schema created by the caller to construct the recovery virtual table and then copies the data over. sql::Recovery::SetupMeta() and GetMetaVersionNumber() simplify accessing meta-table info in the corrupt database. sql::test::IntegrityCheck() and CorruptSizeInHeader() helpers to simplify common testing operations. Rewrite ThumbnailDatabase v6 and v7 recovery code and tests using these changes, and add a v5 recovery path. Additionally handle deprecated versions. BUG=240396,109482 Review URL: https://codereview.chromium.org/50493012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235492 0039d316-1c4b-4281-b951-d872f2087c98
* ios: Enable -Wunused-functions.thakis@chromium.org2013-11-141-0/+2
| | | | | | | | | BUG=315884 TBR=net,sql owners Review URL: https://codereview.chromium.org/64273005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235014 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Complain about statement mutations after stepping has started.shess@chromium.org2013-10-252-0/+18
| | | | | | | | | | | | | | | | | DCHECK if any Bind*() calls occur after Step() has been called. The bind cannot be implemented at that point, so most likely the calling code has an error, such as a forgotted Reset(). Also DCHECK if Run() is called after Run() or Step() without an intervening Reset(). Such a calling sequence is unlikely to be intentional, because the results of calling Run() twice aren't defined. BUG=309759 Review URL: https://codereview.chromium.org/40733003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231098 0039d316-1c4b-4281-b951-d872f2087c98
* Recover version 6 Favicons, fix meta table.shess@chromium.org2013-10-161-0/+6
| | | | | | | | | | | | | | | | | | | | | Version 6 is exactly like version 7, except it has an extra trailing column on favicons which was never used. The version-7 recovery code works for it, so long as the meta table is updated correctly. In writing this change, I realized that the meta table wasn't being created for recovered databases. Instead, SQLite was resolving to the corrupt.meta table. This works so long as the version doesn't change (next open will populate meta with kCurrentVersion). This change makes the table references absolute, and fixes the meta table setup. BUG=240396 R=jar@chromium.org, pkotwicz@chromium.org, sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=228217 Review URL: https://codereview.chromium.org/25032004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228871 0039d316-1c4b-4281-b951-d872f2087c98
* Deprecate old Favicons database versions.shess@chromium.org2013-10-085-3/+166
| | | | | | | | | | | | | | | | | | Histograms show a non-zero number of users with very old databases at startup. These old databases likely result from some sort of corruption or filesystem problem, and are unlikely to spontaneously progress forward. Since the number of databases involved is very low (<.03% of users), just delete them in hopes that that allows forward progress. Arbitrarily set a 2-year deprecation deadline for this database. This is a few weeks early, as version 5 landed on 2011-10-12. BUG=240396 Review URL: https://codereview.chromium.org/24443002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227433 0039d316-1c4b-4281-b951-d872f2087c98
* Disable recovery test for USE_SYSTEM_SQLITE.shess@chromium.org2013-10-072-0/+19
| | | | | | | | | | | | | Detact and short-circuit rather than using an #ifdef because the test eventually needs to be adapted to actually test this case. I'm just not confident enough about possible edge cases to start deleting data. BUG=299677 TBR=sky@chromium.org Review URL: https://codereview.chromium.org/24989006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227360 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Log tag with sqlite errors.shess@chromium.org2013-09-263-10/+23
| | | | | | | | | | | | | | | Log lines like: ERROR:connection.cc(1007)] sqlite error 266, errno 5: disk I/O error would be ever so much more useful if they indicated which database they were associated with. This logs the histogram tag, which indicates the logical database (the code which owns this connection). [As opposed to the filesystem name.] BUG=none Review URL: https://codereview.chromium.org/24638002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225518 0039d316-1c4b-4281-b951-d872f2087c98
* Recover corrupt Favicon databases.shess@chromium.org2013-09-254-4/+36
| | | | | | | | | | | | | | | | | | | | Add sql::Recovery support to ThumbnailDatabase. Rearrange the schema setup to allow sharing with the recovery code. Unit test a few corruption cases. Add sql::Recovery::Rollback() to allow transitioning code to monitor failures for diagnostic purposes. It is possible/likely that that function can be removed if failure cases are infrequent enough (in which case it with Unrecoverable()). Expose sql::Connection::ShouldIgnore() to allow the error callback to support sql::ScopedErrorIgnorer for testing. BUG=240396 Review URL: https://chromiumcodereview.appspot.com/23533038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225144 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite Thumbnail and Top Sites test with golden files.shess@chromium.org2013-09-103-0/+122
| | | | | | | | | | | | | | Previously, the tests manually changes the current schema to look like an old schema, then targetted specific implementation functions. Change to instead create the schema from a golden file, testing that Init() works correctly, and the expected data is in place. BUG=none R=pkotwicz@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/23536014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222400 0039d316-1c4b-4281-b951-d872f2087c98
* Unit tests for sql::MetaTable.shess@chromium.org2013-09-074-10/+232
| | | | | | | | BUG=273203 Review URL: https://chromiumcodereview.appspot.com/23649002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221922 0039d316-1c4b-4281-b951-d872f2087c98
* Convert most run_all_unittests.cc files to use new unit test launcher.phajdan.jr@chromium.org2013-09-052-10/+1
| | | | | | | | | | | | | Note that the new code is still behind a runtime flag (--brave-new-test-launcher), but compiling tests with support for it will make further testing possible. BUG=236893, 79359 R=akalin@chromium.org, enne@chromium.org, erikwright@chromium.org, joi@chromium.org, keybuk@chromium.org, sky@chromium.org, thestig@chromium.org, tommi@chromium.org, wtc@chromium.org, xhwang@chromium.org, yzshen@chromium.org Review URL: https://codereview.chromium.org/23442019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221464 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor clearing thumbnail history.shess@chromium.org2013-08-162-0/+28
| | | | | | | | | | | | | Previously, ThumbnailDatabase exposed much internals knowledge. Push most of that down into the class and remove the schema hacks which are no longer necessary. BUG=272519 TEST=Unit tests. Review URL: https://chromiumcodereview.appspot.com/22898003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217993 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Use recover virtual table in sql::Recovery.shess@chromium.org2013-08-064-6/+305
| | | | | | | | | | | | Load the recover virtual table as part of sql::Recovery::Begin(), and implement basic unit tests that it correctly recovers valid and corrupt tables. BUG=109482 Review URL: https://chromiumcodereview.appspot.com/20022006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215764 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Cleanup open and close error histograms.shess@chromium.org2013-07-241-12/+20
| | | | | | | | | | | | | | | | Cleanup open-time histograms to use the sparse framework so that extended histograms can be recorded - also add entries to the xml file. Add a histogram to track close-time failures. This should never fail, but if it is it probably leaks memory and file handles, and possibly locks. BUG=none Review URL: https://chromiumcodereview.appspot.com/18978012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213345 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Serialize calls to sqlite3_initialize().shess@chromium.org2013-07-222-0/+20
| | | | | | | | | | | sqlite3_initialize() uses double-check locking, and is thus prone to data races. BUG=248101 Review URL: https://chromiumcodereview.appspot.com/19000007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212984 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Scoped recovery framework.shess@chromium.org2013-07-197-9/+637
| | | | | | | | | | | | | | | | | | sql::Recovery is intended to be used within a sql::Connection error callback to either recover the database (*) or indicate that the database is unrecoverable and should be razed. The intend is that the code should either progress to a valid database which is composed of data recovered from the original (likely corrupt) database, or a valid database which is empty. This is just the framework without the SQLite-level data-recovery virtual table. BUG=109482 Review URL: https://chromiumcodereview.appspot.com/19281002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212607 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a MemoryPressureListener to sql::Connection.rmcilroy@chromium.org2013-07-182-0/+35
| | | | | | | | | | | This will allow SQLite database to reduce their page cache memory on systems which provide a MemoryPressureListener signal. BUG=243769 Review URL: https://chromiumcodereview.appspot.com/17071007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212374 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Allow restricting database to user read access.shess@chromium.org2013-07-173-6/+116
| | | | | | | | | | | | | | By default POSIX umask is generally 0644. For some databases, it makes sense to restrict access to 0600. Use new setting for password database. BUG=258771 R=gbillock@chromium.org, isherman@chromium.org, jorgelo@chromium.org Review URL: https://codereview.chromium.org/5125579611308032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212106 0039d316-1c4b-4281-b951-d872f2087c98