| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_MOJO_SAFE_BROWSING_IMPL_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_MOJO_SAFE_BROWSING_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 11 #include "chrome/common/safe_browsing.mojom.h" |
| 12 #include "components/safe_browsing_db/database_manager.h" |
| 13 #include "ipc/ipc_message.h" |
| 14 |
| 15 namespace service_manager { |
| 16 struct BindSourceInfo; |
| 17 } |
| 18 |
| 19 namespace safe_browsing { |
| 20 |
| 21 // This class implements the Mojo interface for renderers to perform |
| 22 // SafeBrowsing URL checks. |
| 23 class MojoSafeBrowsingImpl : public chrome::mojom::SafeBrowsing { |
| 24 public: |
| 25 MojoSafeBrowsingImpl( |
| 26 scoped_refptr<SafeBrowsingDatabaseManager> database_manager, |
| 27 scoped_refptr<SafeBrowsingUIManager> ui_manager, |
| 28 int render_process_id); |
| 29 ~MojoSafeBrowsingImpl() override; |
| 30 |
| 31 static void Create( |
| 32 scoped_refptr<SafeBrowsingDatabaseManager> database_manager, |
| 33 scoped_refptr<SafeBrowsingUIManager> ui_manager, |
| 34 int render_process_id, |
| 35 const service_manager::BindSourceInfo& source_info, |
| 36 chrome::mojom::SafeBrowsingRequest request); |
| 37 |
| 38 private: |
| 39 // chrome::mojom::SafeBrowsing implementation. |
| 40 void CreateCheckerAndCheck( |
| 41 int32_t render_frame_id, |
| 42 chrome::mojom::SafeBrowsingUrlCheckerRequest request, |
| 43 const GURL& url, |
| 44 int32_t load_flags, |
| 45 content::ResourceType resource_type, |
| 46 CreateCheckerAndCheckCallback callback) override; |
| 47 |
| 48 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; |
| 49 scoped_refptr<SafeBrowsingUIManager> ui_manager_; |
| 50 int render_process_id_ = MSG_ROUTING_NONE; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(MojoSafeBrowsingImpl); |
| 53 }; |
| 54 |
| 55 } // namespace safe_browsing |
| 56 |
| 57 #endif // CHROME_BROWSER_SAFE_BROWSING_MOJO_SAFE_BROWSING_IMPL_H_ |
| OLD | NEW |