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

Unified Diff: components/safe_browsing_db/v4_get_hash_protocol_manager.cc

Issue 1944433002: Make V4GetHashProtocolManager::RegisterFactory safe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-enable the right tests. Created 4 years, 8 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_get_hash_protocol_manager.cc
diff --git a/components/safe_browsing_db/v4_get_hash_protocol_manager.cc b/components/safe_browsing_db/v4_get_hash_protocol_manager.cc
index 2f050a7247b07dcda1260f34d8efd961c8f1c735..6131566dbe6c54dcbe98579ff21cb364ef26355d 100644
--- a/components/safe_browsing_db/v4_get_hash_protocol_manager.cc
+++ b/components/safe_browsing_db/v4_get_hash_protocol_manager.cc
@@ -122,6 +122,14 @@ V4GetHashProtocolManager::~V4GetHashProtocolManager() {
hash_requests_.clear();
}
+// static
+void V4GetHashProtocolManager::RegisterFactory(
+ std::unique_ptr<V4GetHashProtocolManagerFactory> factory) {
+ if (factory_)
+ delete factory_;
+ factory_ = factory.release();
mattm 2016/05/02 22:36:53 If you do switch to passing in a unique_ptr, why n
Reilly Grant (use Gerrit) 2016/05/02 22:55:27 factory_ is a global variable. It must be a primit
+}
+
std::string V4GetHashProtocolManager::GetHashRequest(
const std::vector<SBPrefix>& prefixes,
const std::vector<PlatformType>& platforms,

Powered by Google App Engine
This is Rietveld 408576698