Index: content/browser/browser_context.cc |
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc |
index 638e0ecc2ff862914320523ccebf325b8decfda3..7e8750baf464843c5461a8ce42056b7a43b3946d 100644 |
--- a/content/browser/browser_context.cc |
+++ b/content/browser/browser_context.cc |
@@ -13,12 +13,14 @@ |
#include <vector> |
#include "base/command_line.h" |
+#include "base/debug/leak_annotations.h" |
#include "base/guid.h" |
#include "base/lazy_instance.h" |
#include "base/macros.h" |
#include "base/rand_util.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "build/build_config.h" |
+#include "components/leveldb/env_mojo.h" |
#include "content/browser/blob_storage/chrome_blob_storage_context.h" |
#include "content/browser/download/download_manager_impl.h" |
#include "content/browser/indexed_db/indexed_db_context_impl.h" |
@@ -456,10 +458,13 @@ void BrowserContext::Initialize( |
if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kMojoLocalStorage)) { |
ServiceInfo info; |
- info.factory = |
- base::Bind(&file::CreateFileService, |
- BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
- BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)); |
+ auto* env = new leveldb::MojoEnv( |
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); |
+ ANNOTATE_LEAKING_OBJECT_PTR(env); |
+ info.factory = base::Bind( |
+ &file::CreateFileService, |
+ env, |
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)); |
connection->AddEmbeddedService(file::mojom::kServiceName, info); |
} |