OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_SUBRESOURCE_FILTER_CONTENT_BROWSER_FAKE_SAFE_BROWSING_DATABAS
E_MANAGER_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_FAKE_SAFE_BROWSING_DATABAS
E_MANAGER_H_ |
6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_FAKE_SAFE_BROWSING_DATABAS
E_MANAGER_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_FAKE_SAFE_BROWSING_DATABAS
E_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <set> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "components/safe_browsing_db/test_database_manager.h" | 12 #include "components/safe_browsing_db/test_database_manager.h" |
12 #include "content/public/common/resource_type.h" | 13 #include "content/public/common/resource_type.h" |
13 | 14 |
14 class GURL; | 15 class GURL; |
15 | 16 |
16 // Database manager that allows any URL to be configured as blacklisted for | 17 // Database manager that allows any URL to be configured as blacklisted for |
17 // testing. | 18 // testing. |
18 class FakeSafeBrowsingDatabaseManager | 19 class FakeSafeBrowsingDatabaseManager |
(...skipping 15 matching lines...) Expand all Loading... |
34 bool IsSupported() const override; | 35 bool IsSupported() const override; |
35 void CancelCheck(Client* client) override; | 36 void CancelCheck(Client* client) override; |
36 bool ChecksAreAlwaysAsync() const override; | 37 bool ChecksAreAlwaysAsync() const override; |
37 bool CanCheckResourceType( | 38 bool CanCheckResourceType( |
38 content::ResourceType /* resource_type */) const override; | 39 content::ResourceType /* resource_type */) const override; |
39 safe_browsing::ThreatSource GetThreatSource() const override; | 40 safe_browsing::ThreatSource GetThreatSource() const override; |
40 bool CheckExtensionIDs(const std::set<std::string>& extension_ids, | 41 bool CheckExtensionIDs(const std::set<std::string>& extension_ids, |
41 Client* client) override; | 42 Client* client) override; |
42 | 43 |
43 private: | 44 private: |
| 45 void OnCheckUrlForSubresourceFilterComplete(Client* client, const GURL& url); |
| 46 |
44 std::map<GURL, safe_browsing::SBThreatType> url_to_threat_type_; | 47 std::map<GURL, safe_browsing::SBThreatType> url_to_threat_type_; |
| 48 std::set<Client*> checks_; |
45 bool simulate_timeout_; | 49 bool simulate_timeout_; |
46 | 50 |
47 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingDatabaseManager); | 51 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingDatabaseManager); |
48 }; | 52 }; |
49 | 53 |
50 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_FAKE_SAFE_BROWSING_DATA
BASE_MANAGER_H_ | 54 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_FAKE_SAFE_BROWSING_DATA
BASE_MANAGER_H_ |
OLD | NEW |