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

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

Issue 2103693002: SafeBrowsing PVer4: Send mutable response to the database and the stores (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_ReadFromDisk
Patch Set: Minor: Add the explicit keyword for UpdateListIdentifier constructor Created 4 years, 5 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
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_
6 #define COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 NewDatabaseReadyCallback callback); 61 NewDatabaseReadyCallback callback);
62 62
63 // Destroys the provided v4_database on its task_runner since this may be a 63 // Destroys the provided v4_database on its task_runner since this may be a
64 // long operation. 64 // long operation.
65 static void Destroy(std::unique_ptr<V4Database> v4_database); 65 static void Destroy(std::unique_ptr<V4Database> v4_database);
66 66
67 virtual ~V4Database(); 67 virtual ~V4Database();
68 68
69 // Updates the stores with the response received from the SafeBrowsing service 69 // Updates the stores with the response received from the SafeBrowsing service
70 // and calls the db_updated_callback when done. 70 // and calls the db_updated_callback when done.
71 void ApplyUpdate(const std::vector<ListUpdateResponse>& response, 71 void ApplyUpdate(std::unique_ptr<ParsedServerResponse> parsed_server_response,
72 DatabaseUpdatedCallback db_updated_callback); 72 DatabaseUpdatedCallback db_updated_callback);
73 73
74 // Returns the current state of each of the stores being managed. 74 // Returns the current state of each of the stores being managed.
75 std::unique_ptr<StoreStateMap> GetStoreStateMap(); 75 std::unique_ptr<StoreStateMap> GetStoreStateMap();
76 76
77 // Deletes the current database and creates a new one. 77 // Deletes the current database and creates a new one.
78 virtual bool ResetDatabase(); 78 virtual bool ResetDatabase();
79 79
80 protected: 80 protected:
81 V4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, 81 V4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // that needed updating and is ready for the next update. It should only be 126 // that needed updating and is ready for the next update. It should only be
127 // accessed on the IO thread. 127 // accessed on the IO thread.
128 int pending_store_updates_; 128 int pending_store_updates_;
129 129
130 DISALLOW_COPY_AND_ASSIGN(V4Database); 130 DISALLOW_COPY_AND_ASSIGN(V4Database);
131 }; 131 };
132 132
133 } // namespace safe_browsing 133 } // namespace safe_browsing
134 134
135 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ 135 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698