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

Side by Side Diff: chrome/browser/safe_browsing/test_database_manager.h

Issue 1110723002: Split to SafeBrowsingDatabaseManager into Local* and Remote*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: extend test db manager to fix browser tests Created 5 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) 2015 The Chromium Authors. All rights reserved.
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 CHROME_BROWSER_SAFE_BROWSING_TEST_DATABASE_MANAGER_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_TEST_DATABASE_MANAGER_H_
7
8 #include <set>
9 #include <string>
10 #include <vector>
11
12 #include "chrome/browser/safe_browsing/database_manager.h"
13 #include "chrome/browser/safe_browsing/protocol_manager.h"
14
15 // This is a non-pure-virtual implementation of the SafeBrowsingDatabaseManager
16 // interface. It's used in tests by overriding only the functions that get
17 // called, and it'll complain if you call one that isn't overriden.
18 class TestSafeBrowsingDatabaseManager
19 : public SafeBrowsingDatabaseManager,
20 public SafeBrowsingProtocolManagerDelegate {
mattm 2015/05/06 02:42:46 Doesn't that make this sort of a TestLocalSafeBrow
Nathan Parker 2015/05/06 22:27:36 I've removed this since SafeBrowsingService now ha
21 public:
22 // SafeBrowsingDatabaseManager implementation:
23 bool CanCheckUrl(const GURL& url) const override;
24 bool download_protection_enabled() const override;
25 bool CheckBrowseUrl(const GURL& url, Client* client) override;
26 bool CheckDownloadUrl(const std::vector<GURL>& url_chain,
27 Client* client) override;
28 bool CheckExtensionIDs(const std::set<std::string>& extension_ids,
29 Client* client) override;
30 bool MatchCsdWhitelistUrl(const GURL& url) override;
31 bool MatchMalwareIP(const std::string& ip_address) override;
32 bool MatchDownloadWhitelistUrl(const GURL& url) override;
33 bool MatchDownloadWhitelistString(const std::string& str) override;
34 bool MatchInclusionWhitelistUrl(const GURL& url) override;
35 bool IsMalwareKillSwitchOn() override;
36 bool IsCsdWhitelistKillSwitchOn() override;
37 void CancelCheck(Client* client) override;
38 void StartOnIOThread() override;
39 void StopOnIOThread(bool shutdown) override;
40 SafeBrowsingProtocolManagerDelegate* GetProtocolManagerDelegate() override;
41
42 // SafeBrowsingProtocolManagerDelegate implementation:
43 void UpdateFinished(bool success) override;
44 void ResetDatabase() override;
45 void GetChunks(GetChunksCallback callback) override;
46 void AddChunks(const std::string& list,
47 scoped_ptr<ScopedVector<SBChunkData>> chunks,
48 AddChunksCallback callback) override;
49 void DeleteChunks(
50 scoped_ptr<std::vector<SBChunkDelete>> chunk_deletes) override;
51 void UpdateStarted() override;
52
53 protected:
54 ~TestSafeBrowsingDatabaseManager() override {};
55 };
56 #endif // CHROME_BROWSER_SAFE_BROWSING_TEST_DATABASE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698