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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
(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_SAFE_BROWSING_IMPL_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_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 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.
22 // browsing URL checks.
23 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
24 public:
25 SafeBrowsingImpl(scoped_refptr<SafeBrowsingDatabaseManager> database_manager,
26 scoped_refptr<SafeBrowsingUIManager> ui_manager,
27 int render_process_id);
28 ~SafeBrowsingImpl() override;
29
30 static void Create(
31 scoped_refptr<SafeBrowsingDatabaseManager> database_manager,
32 scoped_refptr<SafeBrowsingUIManager> ui_manager,
33 int render_process_id,
34 const service_manager::BindSourceInfo& source_info,
35 chrome::mojom::SafeBrowsingRequest request);
36
37 private:
38 // chrome::mojom::SafeBrowsing implementation.
39 void CreateCheckerAndCheck(
40 int32_t render_frame_id,
41 chrome::mojom::SafeBrowsingUrlCheckerRequest request,
42 const GURL& url,
43 int32_t load_flags,
44 content::ResourceType resource_type,
45 CreateCheckerAndCheckCallback callback) override;
46
47 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_;
48 scoped_refptr<SafeBrowsingUIManager> ui_manager_;
49 int render_process_id_ = MSG_ROUTING_NONE;
50
51 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingImpl);
52 };
53
54 } // namespace safe_browsing
55
56 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698