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

Unified Diff: components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h

Issue 2645283007: Add the client for accessing Subresource Filter only list. (Closed)
Patch Set: only changes specific to this cl Created 3 years, 9 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/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h
diff --git a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h
new file mode 100644
index 0000000000000000000000000000000000000000..a2e43b2d8ed0985210bd16c6b848a4ec6ea270e1
--- /dev/null
+++ b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_SAFE_BROWSING_ACTIVATION_THROTTLE_H_
+#define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_SAFE_BROWSING_ACTIVATION_THROTTLE_H_
+
+#include <string>
engedy 2017/03/21 13:44:16 nit: Unused. nit: #include <memory>
melandory 2017/03/24 15:49:28 Done.
+#include <vector>
engedy 2017/03/21 13:44:16 nit: Only used in .cc file.
melandory 2017/03/24 15:49:28 Done.
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/single_thread_task_runner.h"
+#include "components/safe_browsing_db/database_manager.h"
+#include "content/public/browser/navigation_throttle.h"
+#include "url/gurl.h"
+
+namespace subresource_filter {
+
+// Client for accessing list with patterns to be used by the Subresource Filter.
engedy 2017/03/21 13:44:16 Phrasing suggestion: // Navigation throttle respo
+class SubresourceFilterSafeBrowsingActivationThrottle
+ : public content::NavigationThrottle,
+ public base::SupportsWeakPtr<
+ SubresourceFilterSafeBrowsingActivationThrottle> {
+ public:
+ SubresourceFilterSafeBrowsingActivationThrottle(
+ content::NavigationHandle* handle,
+ scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>
engedy 2017/03/21 13:44:16 #include "base/memory/ref_counted.h"
melandory 2017/03/24 15:49:28 Done.
+ database_manager);
+
+ ~SubresourceFilterSafeBrowsingActivationThrottle() override;
+
+ // content::NavigationThrottle:
+ content::NavigationThrottle::ThrottleCheckResult WillProcessResponse()
+ override;
+
+ void OnCheckUrlResultOnUI(const GURL& url,
+ safe_browsing::SBThreatType threat_type,
+ safe_browsing::ThreatPatternType pattern_type);
+
+ private:
+ class SBDatabaseClient;
+
+ scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner_;
+ std::unique_ptr<SBDatabaseClient, base::OnTaskRunnerDeleter> database_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(SubresourceFilterSafeBrowsingActivationThrottle);
+};
+
+} // namespace subresource_filter
+
+#endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_SAFE_BROWSING_ACTIVATION_THROTTLE_H_

Powered by Google App Engine
This is Rietveld 408576698