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

Unified Diff: components/safe_browsing_db/v4_database.cc

Issue 2066083002: SafeBrowising: Read and write V4Store from/to disk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_UpdateDbAndStores
Patch Set: Track writes to store via UMA. Create a temp file for writing. Remove some DVLOGs. Created 4 years, 6 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_database.cc
diff --git a/components/safe_browsing_db/v4_database.cc b/components/safe_browsing_db/v4_database.cc
index d6a8389a6dd41ea24aa0ca2ebfa0afaf795a90fb..127a470bccf79de86ad574413807dfb727f2ff29 100644
--- a/components/safe_browsing_db/v4_database.cc
+++ b/components/safe_browsing_db/v4_database.cc
@@ -6,6 +6,7 @@
#include "base/callback.h"
#include "base/debug/leak_annotations.h"
+#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "components/safe_browsing_db/v4_database.h"
@@ -54,6 +55,8 @@ void V4Database::CreateOnTaskRunner(
ANNOTATE_LEAKING_OBJECT_PTR(factory_);
}
+ DCHECK(base::CreateDirectory(base_path));
Scott Hess - ex-Googler 2016/06/22 22:58:38 I don't think DCHECK and side effects mix well. M
vakh (use Gerrit instead) 2016/06/23 23:09:31 It ensures that the directory exists or gets creat
Scott Hess - ex-Googler 2016/06/24 04:14:11 What I'm saying is that (I think) you want the Cre
vakh (use Gerrit instead) 2016/06/24 18:03:50 Yes, didn't realize that. Thanks for catching. Don
+
std::unique_ptr<StoreMap> store_map = base::MakeUnique<StoreMap>();
for (const auto& store_info : store_file_name_map) {
const UpdateListIdentifier& update_list_identifier = store_info.first;

Powered by Google App Engine
This is Rietveld 408576698