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

Unified Diff: components/leveldb/env_mojo.h

Issue 2752963002: Add UMA histograms to mojo leveldb env (Closed)
Patch Set: use UmaHistogramExactLinear convenience wrapper Created 3 years, 7 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
« no previous file with comments | « no previous file | components/leveldb/env_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb/env_mojo.h
diff --git a/components/leveldb/env_mojo.h b/components/leveldb/env_mojo.h
index 8af9ef4aebcd0e0a8dfe927e291ef21ea56db948..569bcfe5ccb9e1eb0238acafa2571c46c229dfa8 100644
--- a/components/leveldb/env_mojo.h
+++ b/components/leveldb/env_mojo.h
@@ -7,6 +7,7 @@
#include "components/filesystem/public/interfaces/directory.mojom.h"
#include "components/leveldb/leveldb_mojo_proxy.h"
+#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/include/leveldb/env.h"
namespace leveldb {
@@ -16,7 +17,7 @@ namespace leveldb {
// synchronous and block on responses from the filesystem service. That's fine
// since, for the most part, they merely open files or check for a file's
// existence.
-class MojoEnv : public leveldb::Env {
+class MojoEnv : public Env, public leveldb_env::UMALogger {
public:
MojoEnv(scoped_refptr<LevelDBMojoProxy> file_thread,
LevelDBMojoProxy::OpaqueDir* dir);
@@ -50,6 +51,13 @@ class MojoEnv : public leveldb::Env {
void StartThread(void (*function)(void* arg), void* arg) override;
private:
+ void RecordErrorAt(leveldb_env::MethodID method) const override;
+ void RecordOSError(leveldb_env::MethodID method,
+ base::File::Error error) const override;
+
+ void RecordFileError(leveldb_env::MethodID method,
+ filesystem::mojom::FileError error) const;
+
scoped_refptr<LevelDBMojoProxy> thread_;
LevelDBMojoProxy::OpaqueDir* dir_;
« no previous file with comments | « no previous file | components/leveldb/env_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698