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

Unified Diff: components/leveldb/leveldb_app.h

Issue 2722293002: Fix lifetime of leveldb::MojoEnv instances. (Closed)
Patch Set: annotate leaks Created 3 years, 8 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
Index: components/leveldb/leveldb_app.h
diff --git a/components/leveldb/leveldb_app.h b/components/leveldb/leveldb_app.h
index 1898f525984b5be631d6fe6b0f621e3483c682e9..03d65b8854aa5820de656a60b693fcbd4129f90b 100644
--- a/components/leveldb/leveldb_app.h
+++ b/components/leveldb/leveldb_app.h
@@ -17,6 +17,8 @@
namespace leveldb {
+class MojoEnv;
+
class LevelDBApp
: public service_manager::Service,
public service_manager::InterfaceFactory<mojom::LevelDBService> {
@@ -41,6 +43,9 @@ class LevelDBApp
mojo::BindingSet<mojom::LevelDBService> bindings_;
base::Thread file_thread_;
+ // env_ is owned by LevelDBApp (since it depends on the file_thread_ above),
cmumford 2017/04/12 21:51:34 The only reason ChromiumEnv has a NOTREACHED in th
Marijn Kruisselbrink 2017/04/12 22:00:34 That it not the only reason. Destroying ChromiumEn
cmumford 2017/04/12 23:06:39 That's right. Also, this was prior to your change
Marijn Kruisselbrink 2017/04/12 23:46:22 Yeah, maybe that's the way to go... If we do that,
+ // but doesn't support destruction, so it is leaked.
+ MojoEnv* env_;
DISALLOW_COPY_AND_ASSIGN(LevelDBApp);
};

Powered by Google App Engine
This is Rietveld 408576698