Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017 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 COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_SAFE_BR OWSING_ACTIVATION_THROTTLE_H_ | |
| 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_SAFE_BR OWSING_ACTIVATION_THROTTLE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "base/memory/weak_ptr.h" | |
| 13 #include "base/single_thread_task_runner.h" | |
| 14 #include "components/safe_browsing_db/database_manager.h" | |
|
engedy
2017/03/10 14:39:33
nit: This include could be avoided if we fwd-decla
melandory
2017/03/15 13:41:36
For some weird reason it doesn't work
| |
| 15 #include "content/public/browser/navigation_throttle.h" | |
| 16 #include "url/gurl.h" | |
| 17 | |
| 18 namespace subresource_filter { | |
| 19 | |
| 20 // Client for accessing list with patterns to be used by the Subresource Filter. | |
| 21 class SubresourceFilterSafeBrowsingActivationThrottle | |
| 22 : public content::NavigationThrottle, | |
| 23 public base::SupportsWeakPtr< | |
| 24 SubresourceFilterSafeBrowsingActivationThrottle> { | |
| 25 public: | |
| 26 SubresourceFilterSafeBrowsingActivationThrottle( | |
| 27 content::NavigationHandle* handle, | |
| 28 const scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>& | |
|
engedy
2017/03/10 14:39:33
style nit: According to [1], the new preferred way
| |
| 29 database_manager); | |
| 30 | |
| 31 ~SubresourceFilterSafeBrowsingActivationThrottle() override; | |
| 32 | |
| 33 // content::NavigationThrottle: | |
| 34 content::NavigationThrottle::ThrottleCheckResult WillProcessResponse() | |
| 35 override; | |
| 36 | |
| 37 void OnCheckUrlResultOnUI(const GURL& url, | |
| 38 safe_browsing::SBThreatType threat_type, | |
| 39 safe_browsing::ThreatPatternType pattern_type); | |
| 40 | |
| 41 private: | |
| 42 class ActivationClient; | |
| 43 | |
| 44 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 45 std::unique_ptr<ActivationClient, base::OnTaskRunnerDeleter> | |
| 46 activation_client_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterSafeBrowsingActivationThrottle); | |
| 49 }; | |
| 50 | |
| 51 } // namespace subresource_filter | |
| 52 | |
| 53 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_SAFE _BROWSING_ACTIVATION_THROTTLE_H_ | |
| OLD | NEW |