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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_impl.h

Issue 2900563002: Network service: Safe browsing check for sub-resources from renderer. (Closed)
Patch Set: . Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_impl.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_impl.h b/chrome/browser/safe_browsing/safe_browsing_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..70591ec722746e5c899da075f44b891cccbdda38
--- /dev/null
+++ b/chrome/browser/safe_browsing/safe_browsing_impl.h
@@ -0,0 +1,55 @@
+// Copyright 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 CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_IMPL_H_
+#define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_IMPL_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "chrome/browser/safe_browsing/ui_manager.h"
+#include "chrome/common/safe_browsing.mojom.h"
+#include "components/safe_browsing_db/database_manager.h"
+
+namespace service_manager {
+struct BindSourceInfo;
+}
+
+namespace safe_browsing {
+
+class SafeBrowsingImpl : public chrome::mojom::SafeBrowsing {
jam 2017/05/25 15:45:50 nit: document purpose of this class
yzshen1 2017/05/26 20:43:52 Done.
+ public:
+ SafeBrowsingImpl(scoped_refptr<SafeBrowsingDatabaseManager> database_manager,
jam 2017/05/25 15:45:50 did you consider having one of these classes per p
yzshen1 2017/05/26 20:43:51 I have changed it as you suggested. It not only re
+ scoped_refptr<SafeBrowsingUIManager> ui_manager,
+ int render_process_id,
+ int render_frame_id);
+ ~SafeBrowsingImpl() override;
+
+ static void Create(
+ scoped_refptr<SafeBrowsingDatabaseManager> database_manager,
+ scoped_refptr<SafeBrowsingUIManager> ui_manager,
+ int render_process_id,
+ int render_frame_id,
+ const service_manager::BindSourceInfo& source_info,
+ chrome::mojom::SafeBrowsingRequest request);
+
+ private:
+ // chrome::mojom::SafeBrowsing implementation.
+ void CreateCheckerAndCheck(
+ chrome::mojom::SafeBrowsingUrlCheckerRequest request,
+ const GURL& url,
+ int32_t load_flags,
+ content::ResourceType resource_type,
+ const CreateCheckerAndCheckCallback& callback) override;
+
+ scoped_refptr<SafeBrowsingDatabaseManager> database_manager_;
+ scoped_refptr<SafeBrowsingUIManager> ui_manager_;
+ int render_process_id_ = 0;
jam 2017/05/25 15:45:50 nit: here and below, use MSG_ROUTING_NONE
yzshen1 2017/05/26 20:43:51 Done.
+ int render_frame_id_ = 0;
+
+ DISALLOW_COPY_AND_ASSIGN(SafeBrowsingImpl);
+};
+
+} // namespace safe_browsing
+
+#endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698