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

Unified Diff: components/safe_browsing_db/v4_protocol_manager_util.cc

Issue 2447443002: Log the size of each of the stores and complete DB on launch and after each (Closed)
Patch Set: shess@'s review Created 4 years, 2 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/safe_browsing_db/v4_protocol_manager_util.cc
diff --git a/components/safe_browsing_db/v4_protocol_manager_util.cc b/components/safe_browsing_db/v4_protocol_manager_util.cc
index 3dfbaefbbb00ad9d7aff75c82a20c0d65ddd2671..4bb856e4b7c6b204b8752dbace35e477d623867a 100644
--- a/components/safe_browsing_db/v4_protocol_manager_util.cc
+++ b/components/safe_browsing_db/v4_protocol_manager_util.cc
@@ -5,6 +5,7 @@
#include "components/safe_browsing_db/v4_protocol_manager_util.h"
#include "base/base64.h"
+#include "base/files/file_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
#include "base/strings/string_util.h"
@@ -509,4 +510,13 @@ void V4ProtocolManagerUtil::SetClientInfoFromConfig(
client_info->set_client_version(config.version);
}
+// static
+int64_t V4ProtocolManagerUtil::GetFileSizeOrZero(
+ const base::FilePath& file_path) {
+ int64_t size;
+ if (!base::GetFileSize(file_path, &size))
+ return 0;
+ return size;
+}
+
} // namespace safe_browsing

Powered by Google App Engine
This is Rietveld 408576698