DescriptionFix lifetime of leveldb::MojoEnv instances.
ChromiumEnv does not support being destructed, so since MojoEnv derives
from ChromiumEnv it can't be destroyed either. This changes the lifetime
of MojoEnv instances to no longer have one instance for each database
connection, but instead have a global instance (which leaks).
To make this possibly, MojoEnv uses "virtual" paths to be able to look up
the correct mojo Directory instance to use for a particular database
connection.
Also added a NOTREACHED to ~ChromiumEnv, as the comment there suggested,
since nothing seem to be broken by this change.
Finally also got rid of being able to specify a custom environment name
for MojoEnv. If eventually we do want different histograms for different
leveldb connections, the same virtual path trick could be used to look up
the histogram name to use for particular connections. But that would be a
fairly invasive change for now. Also MojoEnv doesn't actually emit any of
the ChromiumEnv histograms yet, since it overrides (nearly) every method
that would emit histograms. In a follow-up CL I'll add the histogram logging
to MojoEnv.
BUG=697612
Patch Set 1 #Patch Set 2 : hack to see if anything other than mojo stuff fails #Patch Set 3 : refactor mojoenv #Patch Set 4 : undo incorrect change #Patch Set 5 : fix directory lifetime #Patch Set 6 : fix memory backed leveldb lifetime #Patch Set 7 : minor cleanups #
Total comments: 9
Patch Set 8 : make registering directories nicer #Patch Set 9 : pass in leveldb environment to leveldb service, rather than creating it internally #Patch Set 10 : annotate leaks #
Total comments: 5
Dependent Patchsets: Messages
Total messages: 63 (51 generated)
|