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

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

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, 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
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_GET_HASH_PROTOCOL_MANAGER_H_ 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_
6 #define COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_
7 7
8 // A class that implements Chrome's interface with the SafeBrowsing V4 protocol. 8 // A class that implements Chrome's interface with the SafeBrowsing V4 protocol.
9 // 9 //
10 // The V4GetHashProtocolManager handles formatting and making requests of, and 10 // The V4GetHashProtocolManager handles formatting and making requests of, and
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // were no matches, and that the resource is safe. 45 // were no matches, and that the resource is safe.
46 // - The negative cache duration of the result. 46 // - The negative cache duration of the result.
47 typedef base::Callback<void(const std::vector<SBFullHashResult>&, 47 typedef base::Callback<void(const std::vector<SBFullHashResult>&,
48 const base::TimeDelta&)> 48 const base::TimeDelta&)>
49 FullHashCallback; 49 FullHashCallback;
50 50
51 ~V4GetHashProtocolManager() override; 51 ~V4GetHashProtocolManager() override;
52 52
53 // Makes the passed |factory| the factory used to instantiate 53 // Makes the passed |factory| the factory used to instantiate
54 // a V4GetHashProtocolManager. Useful for tests. 54 // a V4GetHashProtocolManager. Useful for tests.
55 static void RegisterFactory(V4GetHashProtocolManagerFactory* factory) { 55 static void RegisterFactory(
56 factory_ = factory; 56 std::unique_ptr<V4GetHashProtocolManagerFactory> factory);
57 }
58 57
59 // Create an instance of the safe browsing v4 protocol manager. 58 // Create an instance of the safe browsing v4 protocol manager.
60 static V4GetHashProtocolManager* Create( 59 static V4GetHashProtocolManager* Create(
61 net::URLRequestContextGetter* request_context_getter, 60 net::URLRequestContextGetter* request_context_getter,
62 const V4ProtocolConfig& config); 61 const V4ProtocolConfig& config);
63 62
64 // net::URLFetcherDelegate interface. 63 // net::URLFetcherDelegate interface.
65 void OnURLFetchComplete(const net::URLFetcher* source) override; 64 void OnURLFetchComplete(const net::URLFetcher* source) override;
66 65
67 // Retrieve the full hash for a set of prefixes, and invoke the callback 66 // Retrieve the full hash for a set of prefixes, and invoke the callback
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 net::URLRequestContextGetter* request_context_getter, 177 net::URLRequestContextGetter* request_context_getter,
179 const V4ProtocolConfig& config) = 0; 178 const V4ProtocolConfig& config) = 0;
180 179
181 private: 180 private:
182 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); 181 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory);
183 }; 182 };
184 183
185 } // namespace safe_browsing 184 } // namespace safe_browsing
186 185
187 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ 186 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698