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

Side by Side Diff: components/safe_browsing_db/v4_database.h

Issue 1952843003: Skeleton of the overall design for the database for Pver4 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
Nathan Parker 2016/05/05 18:26:44 no (c) here anymore
vakh (use Gerrit instead) 2016/05/06 00:23:15 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_
6 #define COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_
7
8 #include "base/files/file_path.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/sequenced_task_runner.h"
11
12 namespace safe_browsing {
13
14 class V4Database;
15
16 // Factory for creating V4Database. Tests implement this factory to create fake
17 // databases for testing.
18 class V4DatabaseFactory {
19 public:
20 V4DatabaseFactory() {}
21 virtual ~V4DatabaseFactory() {}
22 virtual V4Database* CreateV4Database(
23 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
24 bool enable_malware_list,
Nathan Parker 2016/05/05 18:26:44 Do you think we need the enable_* switches? They
vakh (use Gerrit instead) 2016/05/06 00:23:15 Done. I also realized that this morning. Changing
25 bool enable_phishing_list,
26 bool enable_unwanted_software_list) = 0;
27
28 private:
29 DISALLOW_COPY_AND_ASSIGN(V4DatabaseFactory);
30 };
31
32 // The on-disk databases are shared among all profiles, as it doesn't contain
Nathan Parker 2016/05/05 18:26:44 Maybe describe the relationship of this to Store's
vakh (use Gerrit instead) 2016/05/06 00:23:15 Done.
33 // user-specific data. This object is not thread-safe, i.e. all its methods
34 // should be used on the same thread that it was created on, unless specified
35 // otherwise.
36 class V4Database {
37 public:
38 // Factory method for obtaining a V4Database implementation.
39 // It is not thread safe.
40 // The availability of each list is controlled by the one flag on this
41 // method.
42 static V4Database* Create(
43 V4DatabaseFactory* factory,
44 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
45 bool enable_malware_list,
46 bool enable_phishing_list,
47 bool enable_unwanted_software_list);
48
49 virtual ~V4Database();
50
51 // Initializes the database with the given filename.
52 virtual void Init(const base::FilePath& filename) = 0;
Nathan Parker 2016/05/05 18:26:44 "filename_prefix"?
vakh (use Gerrit instead) 2016/05/06 00:23:15 Done. Removed that part. The DB maintains the stor
53
54 // Deletes the current database and creates a new one.
55 virtual bool ResetDatabase() = 0;
56 };
57
58 } // namespace safe_browsing
59
60 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698