 Chromium Code Reviews
 Chromium Code Reviews Issue 2900563002:
  Network service: Safe browsing check for sub-resources from renderer.  (Closed)
    
  
    Issue 2900563002:
  Network service: Safe browsing check for sub-resources from renderer.  (Closed) 
  | 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..b41053e37a7b26d5ab266cb766a7ea36457ad463 | 
| --- /dev/null | 
| +++ b/chrome/browser/safe_browsing/safe_browsing_impl.h | 
| @@ -0,0 +1,56 @@ | 
| +// 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" | 
| +#include "ipc/ipc_message.h" | 
| + | 
| +namespace service_manager { | 
| +struct BindSourceInfo; | 
| +} | 
| + | 
| +namespace safe_browsing { | 
| + | 
| +// This class implements the Mojo interface for renderers to perform safe | 
| 
Nathan Parker
2017/05/31 17:17:06
Will this always be just for renderers, or will ot
 
yzshen1
2017/05/31 23:34:44
The browser side won't use mojo to talk with safe
 
vakh (use Gerrit instead)
2017/05/31 23:53:09
nit: SafeBrowsing
 
yzshen1
2017/06/01 17:45:04
Done.
 | 
| +// browsing URL checks. | 
| +class SafeBrowsingImpl : public chrome::mojom::SafeBrowsing { | 
| 
Nathan Parker
2017/05/31 17:17:06
Nit: This name feels pretty generic (SafeBrowsingI
 
yzshen1
2017/05/31 23:34:44
Agreed. It is the common practice to use FooImpl f
 | 
| + public: | 
| + SafeBrowsingImpl(scoped_refptr<SafeBrowsingDatabaseManager> database_manager, | 
| + scoped_refptr<SafeBrowsingUIManager> ui_manager, | 
| + int render_process_id); | 
| + ~SafeBrowsingImpl() override; | 
| + | 
| + static void Create( | 
| + scoped_refptr<SafeBrowsingDatabaseManager> database_manager, | 
| + scoped_refptr<SafeBrowsingUIManager> ui_manager, | 
| + int render_process_id, | 
| + const service_manager::BindSourceInfo& source_info, | 
| + chrome::mojom::SafeBrowsingRequest request); | 
| + | 
| + private: | 
| + // chrome::mojom::SafeBrowsing implementation. | 
| + void CreateCheckerAndCheck( | 
| + int32_t render_frame_id, | 
| + chrome::mojom::SafeBrowsingUrlCheckerRequest request, | 
| + const GURL& url, | 
| + int32_t load_flags, | 
| + content::ResourceType resource_type, | 
| + CreateCheckerAndCheckCallback callback) override; | 
| + | 
| + scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; | 
| + scoped_refptr<SafeBrowsingUIManager> ui_manager_; | 
| + int render_process_id_ = MSG_ROUTING_NONE; | 
| + | 
| + DISALLOW_COPY_AND_ASSIGN(SafeBrowsingImpl); | 
| +}; | 
| + | 
| +} // namespace safe_browsing | 
| + | 
| +#endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_IMPL_H_ |