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

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

Issue 2427863002: Small: Use a weak pointer for callbacks to V4LocalDatabaseManager (Closed)
Patch Set: WaitForTasksOnTaskRunner at the end of the test to ensure that the scheduled tasks get run. 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager.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_LOCAL_DATABASE_MANAGER_H_ 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_
6 #define COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_
7 7
8 // A class that provides the interface between the SafeBrowsing protocol manager 8 // A class that provides the interface between the SafeBrowsing protocol manager
9 // and database that holds the downloaded updates. 9 // and database that holds the downloaded updates.
10 10
11 #include <memory> 11 #include <memory>
12 12
13 #include "base/memory/weak_ptr.h"
13 #include "components/safe_browsing_db/database_manager.h" 14 #include "components/safe_browsing_db/database_manager.h"
14 #include "components/safe_browsing_db/hit_report.h" 15 #include "components/safe_browsing_db/hit_report.h"
15 #include "components/safe_browsing_db/v4_database.h" 16 #include "components/safe_browsing_db/v4_database.h"
16 #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" 17 #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h"
17 #include "components/safe_browsing_db/v4_protocol_manager_util.h" 18 #include "components/safe_browsing_db/v4_protocol_manager_util.h"
18 #include "components/safe_browsing_db/v4_update_protocol_manager.h" 19 #include "components/safe_browsing_db/v4_update_protocol_manager.h"
19 #include "url/gurl.h" 20 #include "url/gurl.h"
20 21
21 using content::ResourceType; 22 using content::ResourceType;
22 23
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // The sequenced task runner for running safe browsing database operations. 229 // The sequenced task runner for running safe browsing database operations.
229 scoped_refptr<base::SequencedTaskRunner> task_runner_; 230 scoped_refptr<base::SequencedTaskRunner> task_runner_;
230 231
231 // The database that manages the stores containing the hash prefix updates. 232 // The database that manages the stores containing the hash prefix updates.
232 // All writes to this variable must happen on the IO thread only. 233 // All writes to this variable must happen on the IO thread only.
233 std::unique_ptr<V4Database> v4_database_; 234 std::unique_ptr<V4Database> v4_database_;
234 235
235 // The protocol manager that downloads the hash prefix updates. 236 // The protocol manager that downloads the hash prefix updates.
236 std::unique_ptr<V4UpdateProtocolManager> v4_update_protocol_manager_; 237 std::unique_ptr<V4UpdateProtocolManager> v4_update_protocol_manager_;
237 238
239 base::WeakPtrFactory<V4LocalDatabaseManager> weak_factory_;
240
238 friend class base::RefCountedThreadSafe<V4LocalDatabaseManager>; 241 friend class base::RefCountedThreadSafe<V4LocalDatabaseManager>;
239 DISALLOW_COPY_AND_ASSIGN(V4LocalDatabaseManager); 242 DISALLOW_COPY_AND_ASSIGN(V4LocalDatabaseManager);
240 }; // class V4LocalDatabaseManager 243 }; // class V4LocalDatabaseManager
241 244
242 } // namespace safe_browsing 245 } // namespace safe_browsing
243 246
244 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ 247 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698