[leveldb_proto] Migrated video_decode_stats to new API

leveldb_proto is a component that allows storing proto objects in a
leveldb database. A client can get a leveldb_proto database by calling a
static method.

This simple API made it easy for developers to integrate leveldb_proto
in their components, this resulted in a large amount of clients, with
each one using a unique leveldb instance. Having multiple db instances
increases memory consumption, as each database caches frequently used
contents.

There has been an effort to move leveldb_proto databases from multiple
instances to a shared instance, to decrease memory consumption and
simplify configuration. As part of this effort the leveldb_proto
database retrieval API was moved from a static method into
db provider given by StoragePartition

This CL migrates VideoDecodeStatsDB to the new API.


Bug: 943170
Change-Id: I1d78286589612a2cf733e3c057af35d9c1396246
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1592193
Reviewed-by: John Abd-El-Malek <[email protected]>
Reviewed-by: Chrome Cunningham <[email protected]>
Reviewed-by: Xi Han <[email protected]>
Reviewed-by: ssid <[email protected]>
Commit-Queue: ssid <[email protected]>
Cr-Commit-Position: refs/heads/master@{#687037}
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 3b6793f5..c1fee6e 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -794,8 +794,11 @@
       stats_db =
           std::make_unique<media::InMemoryVideoDecodeStatsDBImpl>(nullptr);
     } else {
+      auto* db_provider =
+          GetDefaultStoragePartition(this)->GetProtoDatabaseProvider();
+
       stats_db = media::VideoDecodeStatsDBImpl::Create(
-          GetPath().Append(FILE_PATH_LITERAL("VideoDecodeStats")));
+          GetPath().Append(FILE_PATH_LITERAL("VideoDecodeStats")), db_provider);
     }
 
     auto new_decode_history = std::make_unique<media::VideoDecodePerfHistory>(