summaryrefslogtreecommitdiffstats
path: root/third_party/leveldatabase/env_chromium.cc
Commit message (Collapse)AuthorAgeFilesLines
* Use a direct include of the message_loop header in third_party/, win8/.avi@chromium.org2013-07-181-1/+1
| | | | | | | | | | BUG=260807 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/19510006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212205 0039d316-1c4b-4281-b951-d872f2087c98
* Rename base::Delete to base::DeleteFilebrettw@chromium.org2013-07-161-2/+2
| | | | | | | | | | | Also renames DeleteAfterReboot to DeleteFileAfterReboot, and removes FileUtilProxy::RecursiveDelete which was never called. BUG= R=shess@chromium.org Review URL: https://codereview.chromium.org/18584011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211822 0039d316-1c4b-4281-b951-d872f2087c98
* Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual ↵brettw@chromium.org2013-07-151-1/+1
| | | | | | | | | | to the base namespace. TBR=sky Review URL: https://codereview.chromium.org/19052005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211675 0039d316-1c4b-4281-b951-d872f2087c98
* Move PathExists to base namespace.brettw@chromium.org2013-07-111-2/+2
| | | | | | | | | BUG= TBR=jam@chromium.org Review URL: https://codereview.chromium.org/18286004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211147 0039d316-1c4b-4281-b951-d872f2087c98
* Move DeleteAfterReboot, Move, and ReplaceFile to base namespacebrettw@chromium.org2013-07-011-3/+1
| | | | | | | | | | | | Rename ReplaceFileAndGetError (only used once) to ReplaceFile (used 5 times) and have each of those callers specify NULL for the output error if they don't care. Remove InsertBeforeExtension from file_util.cc which seems to be unused. BUG= Review URL: https://codereview.chromium.org/18383003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209532 0039d316-1c4b-4281-b951-d872f2087c98
* Move file_util::Delete to the base namespacebrettw@chromium.org2013-07-011-2/+2
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/16950028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209475 0039d316-1c4b-4281-b951-d872f2087c98
* Save errno for logging before potentially overwriting it.dgrogan@chromium.org2013-06-261-4/+9
| | | | | | | | | | There are a few places in ChromiumEnv where errno is written to, then a line of code runs, then errno is logged. That intermediate line may have overwritten errno, so save it before logging it. Review URL: https://chromiumcodereview.appspot.com/17756002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208610 0039d316-1c4b-4281-b951-d872f2087c98
* Pass CreateDirectory errors up to IndexedDB.dgrogan@chromium.org2013-06-261-1/+1
| | | | | | | | | | | While https://chromiumcodereview.appspot.com/17151017 logged the error when CreateDir failed, this CL will log it separately when it causes data loss. BUG=239880 Review URL: https://chromiumcodereview.appspot.com/17745006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208598 0039d316-1c4b-4281-b951-d872f2087c98
* Record error when CreateDir fails.dgrogan@chromium.org2013-06-201-1/+1
| | | | | | | | | | | | There's not been too much success retrying CreateDir in the wild. Only once has it succeeded after an error. This patch will let us see what errors it is encountering and can't recover from. BUG=225051 Review URL: https://chromiumcodereview.appspot.com/17151017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207521 0039d316-1c4b-4281-b951-d872f2087c98
* Histogram location/error when open or write failsdgrogan@chromium.org2013-06-181-58/+65
| | | | | | | | | | | | | We currently have to infer which methods are probably causing failures but can't know for sure. This will allow us to know. It was unblocked by the blink->chromium code move; leveldatabase needs to include env_chromium.h. BUG=239880 Review URL: https://chromiumcodereview.appspot.com/16703013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206925 0039d316-1c4b-4281-b951-d872f2087c98
* Make CreateDirectory return an error code instead of just a bool.dgrogan@chromium.org2013-06-111-4/+8
| | | | | | | | | | | | | | | | | | | Make use of the new error code in IndexedDB, where we'll histogram which errors can be recovered from by retrying and which can't. We're going to try retrying CreateDirectory because LevelDB doesn't pay attention to what env_->CreateDir returns and a frequent error on the next operation (locking the lock file) is that the directory doesn't exist. I want to find out what's causing the directories to not be created in the first place, and which errors can be considered ephemeral. BUG=225051 Review URL: https://chromiumcodereview.appspot.com/15812007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205386 0039d316-1c4b-4281-b951-d872f2087c98
* Move FileEnumerator to its own file, do some refactoring.brettw@chromium.org2013-06-081-2/+3
| | | | | | | | | | | | | | It creates a class FileInfo to contain the details rather than using a platform-specific typedef. This allows the accessors GetName, GetSize, etc. to be moved directly to this class (previously they were static helpers on the FileEnumerator class) which makes a bunch of code much cleaner. It also gives reasonable getting and initialization which the previous version lacked. BUG=175002 Reland of 198820 and 298824 Original review = https://codereview.chromium.org/13165005 R=rvargas@chromium.org Review URL: https://codereview.chromium.org/16392011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205019 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of utf_string_conversions.h in google_apis/, gpu/, ↵avi@chromium.org2013-06-071-1/+1
| | | | | | | | | | | | ipc/, media/, ppapi/, printing/, remoting/, rlz/, skia/, sql/, sync/, third_party/, tools/, webkit/, win8/. BUG=none TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/15995038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204967 0039d316-1c4b-4281-b951-d872f2087c98
* Only fsync leveldb's directory when the manifest is being updated.dgrogan@chromium.org2013-06-071-45/+73
| | | | | | | | | | | | That is, when the manifest is being updated and new have files have been created since the last directory fsync. BUG=242269 R=jsbell@chromium.org Review URL: https://codereview.chromium.org/15843010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204688 0039d316-1c4b-4281-b951-d872f2087c98
* Put more declarations in env_chromium.h.dgrogan@chromium.org2013-06-051-487/+412
| | | | | | | | | | | | This will allow more unit testing of ChromiumEnv. See https://codereview.chromium.org/15843010 BUG=242269 R=jsbell@chromium.org Review URL: https://codereview.chromium.org/16399003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204301 0039d316-1c4b-4281-b951-d872f2087c98
* Only sync parent directory once after a leveldb file rename.dgrogan@chromium.org2013-05-221-1/+4
| | | | | | | | | | This should prevent ~2 fsyncs when opening a leveldb. BUG=242269 Review URL: https://chromiumcodereview.appspot.com/15591003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201417 0039d316-1c4b-4281-b951-d872f2087c98
* When Retrier succeeds, record errors it encountered.dgrogan@chromium.org2013-05-211-29/+65
| | | | | | | | | | | | | | | Right now we just know that retrying a file operation eventually succeeds and the approximate number of times it was retried. With this patch we'll know which kinds of filesystem errors can be overcome by retrying. It will give us a better idea of what's causing the errors in the first place. BUG=225051 Review URL: https://chromiumcodereview.appspot.com/15304008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201267 0039d316-1c4b-4281-b951-d872f2087c98
* Encode method and error message inside LevelDB::Status messagedgrogan@chromium.org2013-05-201-56/+109
| | | | | | | | | BUG=239880 R=jsbell@chromium.org Review URL: https://codereview.chromium.org/15375002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201144 0039d316-1c4b-4281-b951-d872f2087c98
* ClangFormat a constructor's initializer list; update variable name.dgrogan@chromium.org2013-05-181-14/+14
| | | | | | | | | | | RenameTime was originally only used in retrying a rename. Now it is used to retry other operations as well. BUG= Review URL: https://chromiumcodereview.appspot.com/14643025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200941 0039d316-1c4b-4281-b951-d872f2087c98
* Record number of non-existing path components of LockFile pathdgrogan@chromium.org2013-05-141-2/+32
| | | | | | | | | | | | When LevelDB's lock file can't be created because the directory is not found, histogram the number of directories needed to be stripped before an existent directory is found. BUG=239999 Review URL: https://chromiumcodereview.appspot.com/15104002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199931 0039d316-1c4b-4281-b951-d872f2087c98
* Check for and histogram one class of unsafe thread accesses in LevelDB.dgrogan@chromium.org2013-05-101-7/+43
| | | | | | | | | | | This is where multiple threads may be using one FILE* handle. This patch doesn't address two threads reading/writing the same file through different handles. BUG=230154 Review URL: https://chromiumcodereview.appspot.com/14772024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199348 0039d316-1c4b-4281-b951-d872f2087c98
* Make base:ReplaceFile return an informative error.dgrogan@chromium.org2013-05-081-4/+10
| | | | | | | | | | | | | | | It currently just returns true/false to indicate success. More information to diagnose and log failures would be helpful in IndexedDB. This patch also logs the new error when ReplaceFile fails in IndexedDB. BUG=229268 Review URL: https://chromiumcodereview.appspot.com/14886003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199025 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 198820 "Move FileEnumerator to its own file, do some refa..."dbeam@chromium.org2013-05-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Broke both windows clobber and official builders' compile with this error: 771>Link: 771> Creating library ..\..\..\build\Release\lib\gcp_portmon64.lib and object ..\..\..\build\Release\lib\gcp_portmon64.exp 771>base.lib(path_service.obj) : fatalerror LNK1112: module machine type 'X86' conflicts with target machine type 'x64' 771> 771>Build FAILED. > Move FileEnumerator to its own file, do some refactoring. > > It creates a class FileInfo to contain the details rather than using a platform-specific typedef. This allows the accessors GetName, GetSize, etc. to be moved directly to this class (previously they were static helpers on the FileEnumerator class) which makes a bunch of code much cleaner. It also gives reasonable getting and initialization which the previous version lacked. > > BUG=175002 > R=rvargas@chromium.org > > Review URL: https://codereview.chromium.org/13165005 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/14824006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198850 0039d316-1c4b-4281-b951-d872f2087c98
* Move FileEnumerator to its own file, do some refactoring.brettw@chromium.org2013-05-071-2/+3
| | | | | | | | | | | It creates a class FileInfo to contain the details rather than using a platform-specific typedef. This allows the accessors GetName, GetSize, etc. to be moved directly to this class (previously they were static helpers on the FileEnumerator class) which makes a bunch of code much cleaner. It also gives reasonable getting and initialization which the previous version lacked. BUG=175002 R=rvargas@chromium.org Review URL: https://codereview.chromium.org/13165005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198820 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused method and field from leveldb::ChromiumEnvdgrogan@chromium.org2013-05-051-15/+0
| | | | | | | | | | I don't know the history, just that they are currently unused. BUG= Review URL: https://chromiumcodereview.appspot.com/14594009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198357 0039d316-1c4b-4281-b951-d872f2087c98
* Histogram system's open file limit from LevelDB.dgrogan@chromium.org2013-05-031-7/+37
| | | | | | | | | | | Some IDB users are running into the open file limit on Mac and CrOS. BUG=197371 R=isherman@chromium.org, jsbell@chromium.org Review URL: https://codereview.chromium.org/14198005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198134 0039d316-1c4b-4281-b951-d872f2087c98
* Add more error codes to base::CreatePlatformFile on windows.dgrogan@chromium.org2013-05-021-0/+2
| | | | | | | | | | | | | | This is a rough classification of the errors that showed up in the PlatformFile.UnknownCreateFileErrors histogram. I added an IO entry to to the enum because a bunch of the errors seem to indicate a low-level problem that is out of the application programmer's control. BUG=229252 R=jar@chromium.org Review URL: https://codereview.chromium.org/14586003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197947 0039d316-1c4b-4281-b951-d872f2087c98
* Add period lost in r197264.dgrogan@chromium.org2013-04-301-1/+1
| | | | | | | | | BUG=233405 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/14656004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197496 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup / refactor LevelDB histogramsdgrogan@chromium.org2013-04-301-78/+37
| | | | | | | | | | | | | | * Don't cache LevelDB histograms at start up, Retrieve them on demand instead. * Change linear TimeTo(.*) histograms to exponential TimeUntilSuccessFor(.*) * Correct Rename/Renamefile misspellings to RenameFile. BUG=233405 Review URL: https://chromiumcodereview.appspot.com/14328025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197264 0039d316-1c4b-4281-b951-d872f2087c98
* IndexedDB: Add tracing to leveldb env filesystem sync callsjsbell@chromium.org2013-04-221-0/+2
| | | | | | | | | | | | | Local testing seems to show that filesystem stalls resulting in multi-second times for fdatasync() account for some extremely long database opens/transaction commits reported by users. Add tracing so users can check if these operations are to blame. BUG=170111 Review URL: https://codereview.chromium.org/14328052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195600 0039d316-1c4b-4281-b951-d872f2087c98
* Rename SpecificError to OSError to reflect its sourcedgrogan@chromium.org2013-04-191-13/+12
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/14163006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195031 0039d316-1c4b-4281-b951-d872f2087c98
* Add chrome://tracing entries for leveldb background threadsjsbell@chromium.org2013-04-121-3/+11
| | | | | | | | R=dgrogan@chromium.org Review URL: https://codereview.chromium.org/13956014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194052 0039d316-1c4b-4281-b951-d872f2087c98
* Histogram failure reasons for 3 more LevelDB env methods.dgrogan@chromium.org2013-04-091-6/+12
| | | | | | | | | | | This will give us reasons for 6 of the top 7 most common failing methods. RenameFile doesn't have a histogram because base::ReplaceFile only returns a bool. Plumbing an error value is planned. BUG=225051 Review URL: https://chromiumcodereview.appspot.com/13838003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193012 0039d316-1c4b-4281-b951-d872f2087c98
* Retry LockFile and record its specific errordgrogan@chromium.org2013-04-031-7/+23
| | | | | | | | | | On a particular day, 2.3% of failing Env calls were LockFile, which is only called while opening a database. A LockFile failure results directly in a directory deletion in IDB. BUG=225051 Review URL: https://chromiumcodereview.appspot.com/13460007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191996 0039d316-1c4b-4281-b951-d872f2087c98
* Record exact errors for more than just NewRandomAccessFiledgrogan@chromium.org2013-04-021-17/+102
| | | | | | | | | BUG=225051 Review URL: https://chromiumcodereview.appspot.com/13084012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191810 0039d316-1c4b-4281-b951-d872f2087c98
* Extract a generalized Retrier class for use in other LevelDB Env methodsdgrogan@chromium.org2013-03-301-18/+37
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/13252005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191482 0039d316-1c4b-4281-b951-d872f2087c98
* Surround LevelDB fflush calls with HANDLE_EINTR.dgrogan@chromium.org2013-03-291-3/+3
| | | | | | | | | | | | | From the man page: The function fflush() may also fail and set errno for any of the errors specified for write(2). write can fail with EINTR. BUG=222266 Review URL: https://chromiumcodereview.appspot.com/13261002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191303 0039d316-1c4b-4281-b951-d872f2087c98
* Increase the RenameFile time out from 500ms to 1s.dgrogan@chromium.org2013-03-271-2/+6
| | | | | | | | | | | Data shows that some calls are first succeeding even at 500ms. BUG=222853 Review URL: https://chromiumcodereview.appspot.com/12567024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190819 0039d316-1c4b-4281-b951-d872f2087c98
* Let leveldb's RenameFile retry a few times on failure.dgrogan@chromium.org2013-03-231-13/+43
| | | | | | | | | | Added a histogram to see how long successes actually take. BUG=222853 Review URL: https://codereview.chromium.org/12674046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189992 0039d316-1c4b-4281-b951-d872f2087c98
* Move file_path.h to base/files.brettw@chromium.org2013-02-241-2/+4
| | | | | | TBR=sky git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184344 0039d316-1c4b-4281-b951-d872f2087c98
* Replace FilePath with base::FilePath.brettw@chromium.org2013-02-171-9/+9
| | | | | | | | This is im preparation for removing the 'using" in file_path.h Review URL: https://codereview.chromium.org/12286020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183021 0039d316-1c4b-4281-b951-d872f2087c98
* Only HistogramBase is used outside of base/metrics.kaiwang@chromium.org2013-01-231-3/+3
| | | | | | | | | | | | | | So client code of histogram will see a simpler interface. This also makes adding SparseHistogram to existing metrics framework possible. This CL depends on https://codereview.chromium.org/11682003/ So please review that one first. TBR=sky@chromium.org,erikwright@chromium.org BUG=139612 Review URL: https://chromiumcodereview.appspot.com/11615008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178242 0039d316-1c4b-4281-b951-d872f2087c98
* Don't try to rename LevelDB's LOG file if it doesn't existdgrogan@chromium.org2013-01-171-1/+4
| | | | | | | | | BUG=169328 Review URL: https://chromiumcodereview.appspot.com/11970020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177283 0039d316-1c4b-4281-b951-d872f2087c98
* Fix LevelDB histogram code.dgrogan@chromium.org2013-01-121-45/+51
| | | | | | | | | | | | | | | | | | | | The old code misused the macros provided by histogram.h such that a DCHECK failed on the bots. UMA_HISTOGRAM_ENUMERATION et al use a static variable to retrieve the Histogram objects, so a single instance of that macro can't be used to retrieve multiple histograms. The old code tried to retrieve both LevelDBEnv.IOError and LevelDBEnv.IDB.IOError. This CL forgoes use of the macro and keeps a pointer to the Histogram objects around. http://wkb.ug/106135 will have to reland to make use of this. BUG=164755 Review URL: https://chromiumcodereview.appspot.com/11860015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176577 0039d316-1c4b-4281-b951-d872f2087c98
* Handle EINTR in leveldb ChromiumEnvjsbell@chromium.org2013-01-111-4/+5
| | | | | | | | | | BUG=168437 R=dgrogan@chromium.org,alecflett@chromium.org,ericu@chromium.org Review URL: https://chromiumcodereview.appspot.com/11817056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176427 0039d316-1c4b-4281-b951-d872f2087c98
* Log IDB leveldb uma stats into LevelDBEnv.IDB.dgrogan@chromium.org2013-01-081-34/+75
| | | | | | | | | | | Other LevelDB consumers will still be aggregated under LevelDBEnv. BUG=164755 Review URL: https://chromiumcodereview.appspot.com/11776009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175432 0039d316-1c4b-4281-b951-d872f2087c98
* Add detailed UMA logging for errors in NewRandomAccessFile.dgrogan@chromium.org2012-12-151-2/+11
| | | | | | | | | BUG=164755 Review URL: https://chromiumcodereview.appspot.com/11585002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173312 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Don't enable corruption and OOM detectors in leveldb.shess@chromium.org2012-12-121-5/+0
| | | | | | | | | | | | | These modify operation of the system malloc library, and thus should be controlled by the overall policy-decider for the system, rather than a linked library. BUG=105580, 165168 Review URL: https://chromiumcodereview.appspot.com/11547007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172558 0039d316-1c4b-4281-b951-d872f2087c98
* Call fdatasync even if fflush fails.ericu@chromium.org2012-12-111-3/+11
| | | | | | Review URL: https://chromiumcodereview.appspot.com/11507012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172452 0039d316-1c4b-4281-b951-d872f2087c98
* Add sync of parent directory when creating or renaming a file.ericu@chromium.org2012-12-111-16/+44
| | | | | | Review URL: https://chromiumcodereview.appspot.com/11445030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172237 0039d316-1c4b-4281-b951-d872f2087c98