Loading fs_mgr/libsnapshot/include/libsnapshot/snapshot_stats.h +1 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ class SnapshotMergeStats : public ISnapshotMergeStats { public: // Not thread safe. static SnapshotMergeStats* GetInstance(SnapshotManager& manager); SnapshotMergeStats(const std::string& path); // ISnapshotMergeStats overrides bool Start() override; Loading @@ -88,7 +89,6 @@ class SnapshotMergeStats : public ISnapshotMergeStats { private: bool ReadState(); bool DeleteState(); SnapshotMergeStats(const std::string& path); std::string path_; SnapshotMergeReport report_; Loading fs_mgr/libsnapshot/snapshot_stats.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -24,9 +24,12 @@ namespace android { namespace snapshot { SnapshotMergeStats* SnapshotMergeStats::GetInstance(SnapshotManager& parent) { static SnapshotMergeStats g_instance(parent.GetMergeStateFilePath()); CHECK_EQ(g_instance.path_, parent.GetMergeStateFilePath()); return &g_instance; static std::unique_ptr<SnapshotMergeStats> g_instance; if (!g_instance || g_instance->path_ != parent.GetMergeStateFilePath()) { g_instance = std::make_unique<SnapshotMergeStats>(parent.GetMergeStateFilePath()); } return g_instance.get(); } SnapshotMergeStats::SnapshotMergeStats(const std::string& path) : path_(path), running_(false) {} Loading Loading
fs_mgr/libsnapshot/include/libsnapshot/snapshot_stats.h +1 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ class SnapshotMergeStats : public ISnapshotMergeStats { public: // Not thread safe. static SnapshotMergeStats* GetInstance(SnapshotManager& manager); SnapshotMergeStats(const std::string& path); // ISnapshotMergeStats overrides bool Start() override; Loading @@ -88,7 +89,6 @@ class SnapshotMergeStats : public ISnapshotMergeStats { private: bool ReadState(); bool DeleteState(); SnapshotMergeStats(const std::string& path); std::string path_; SnapshotMergeReport report_; Loading
fs_mgr/libsnapshot/snapshot_stats.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -24,9 +24,12 @@ namespace android { namespace snapshot { SnapshotMergeStats* SnapshotMergeStats::GetInstance(SnapshotManager& parent) { static SnapshotMergeStats g_instance(parent.GetMergeStateFilePath()); CHECK_EQ(g_instance.path_, parent.GetMergeStateFilePath()); return &g_instance; static std::unique_ptr<SnapshotMergeStats> g_instance; if (!g_instance || g_instance->path_ != parent.GetMergeStateFilePath()) { g_instance = std::make_unique<SnapshotMergeStats>(parent.GetMergeStateFilePath()); } return g_instance.get(); } SnapshotMergeStats::SnapshotMergeStats(const std::string& path) : path_(path), running_(false) {} Loading