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

Unified Diff: third_party/leveldatabase/env_chromium.h

Issue 710373002: LevelDB: Using base::File for all file I/O (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment for GetDirectoryEntries, using ReadAtCurrentPosNoBestEffort Created 6 years, 1 month 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 | « third_party/leveldatabase/chromium_logger.h ('k') | third_party/leveldatabase/env_chromium.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/leveldatabase/env_chromium.h
diff --git a/third_party/leveldatabase/env_chromium.h b/third_party/leveldatabase/env_chromium.h
index b340c26051aedc7fa3be55c0dc028fb7a07c1438..90ba227050ea81f7f2bf9284186aae17dd8c0beb 100644
--- a/third_party/leveldatabase/env_chromium.h
+++ b/third_party/leveldatabase/env_chromium.h
@@ -47,15 +47,11 @@ enum MethodID {
const char* MethodIDToString(MethodID method);
leveldb::Status MakeIOError(leveldb::Slice filename,
- const char* message,
- MethodID method,
- int saved_errno);
-leveldb::Status MakeIOError(leveldb::Slice filename,
- const char* message,
+ const std::string& message,
MethodID method,
base::File::Error error);
leveldb::Status MakeIOError(leveldb::Slice filename,
- const char* message,
+ const std::string& message,
MethodID method);
enum ErrorParsingResult {
@@ -79,7 +75,6 @@ std::string FilePathToString(const base::FilePath& file_path);
class UMALogger {
public:
virtual void RecordErrorAt(MethodID method) const = 0;
- virtual void RecordOSError(MethodID method, int saved_errno) const = 0;
virtual void RecordOSError(MethodID method,
base::File::Error error) const = 0;
virtual void RecordBackupResult(bool success) const = 0;
@@ -105,6 +100,8 @@ class ChromiumEnv : public leveldb::Env,
public RetrierProvider,
public WriteTracker {
public:
+ ChromiumEnv();
+
typedef void(ScheduleFunc)(void*);
static bool MakeBackup(const std::string& fname);
@@ -130,27 +127,32 @@ class ChromiumEnv : public leveldb::Env,
virtual leveldb::Status GetTestDirectory(std::string* path);
virtual uint64_t NowMicros();
virtual void SleepForMicroseconds(int micros);
+ virtual leveldb::Status NewSequentialFile(const std::string& fname,
+ leveldb::SequentialFile** result);
+ virtual leveldb::Status NewRandomAccessFile(
+ const std::string& fname,
+ leveldb::RandomAccessFile** result);
+ virtual leveldb::Status NewWritableFile(const std::string& fname,
+ leveldb::WritableFile** result);
+ virtual leveldb::Status NewLogger(const std::string& fname,
+ leveldb::Logger** result);
protected:
- ChromiumEnv();
+ virtual void DidSyncDir(const std::string& fname);
+ std::string name_;
+ bool make_backup_;
+
+ private:
virtual void DidCreateNewFile(const std::string& fname);
virtual bool DoesDirNeedSync(const std::string& fname);
- virtual void DidSyncDir(const std::string& fname);
- virtual base::File::Error GetDirectoryEntries(
- const base::FilePath& dir_param,
- std::vector<base::FilePath>* result) const = 0;
virtual void RecordErrorAt(MethodID method) const;
- virtual void RecordOSError(MethodID method, int saved_errno) const;
virtual void RecordOSError(MethodID method,
base::File::Error error) const;
+ void RecordOpenFilesLimit(const std::string& type);
base::HistogramBase* GetMaxFDHistogram(const std::string& type) const;
base::HistogramBase* GetOSErrorHistogram(MethodID method, int limit) const;
- std::string name_;
- bool make_backup_;
-
- private:
// File locks may not be exclusive within a process (e.g. on POSIX). Track
// locks held by the ChromiumEnv to prevent access within the process.
class LockTable {
« no previous file with comments | « third_party/leveldatabase/chromium_logger.h ('k') | third_party/leveldatabase/env_chromium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698