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

Side by Side Diff: components/safe_browsing/renderer/websocket_sb_handshake_throttle.h

Issue 2952583002: SafeBrowsing support for WebSocket (post-network-servicification) (Closed)
Patch Set: Remove useless DCHECKs Created 3 years, 5 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 // Implementation of SafeBrowsing for WebSockets. This code runs inside the
6 // render process, calling the interface defined in safe_browsing.mojom to
7 // communicate with the SafeBrowsing service.
8
9 #ifndef COMPONENTS_SAFE_BROWSING_RENDERER_WEBSOCKET_SB_HANDSHAKE_THROTTLE_H_
10 #define COMPONENTS_SAFE_BROWSING_RENDERER_WEBSOCKET_SB_HANDSHAKE_THROTTLE_H_
11
12 #include <memory>
13
14 #include "base/macros.h"
15 #include "components/safe_browsing/common/safe_browsing.mojom.h"
16 #include "third_party/WebKit/public/platform/WebCallbacks.h"
17 #include "third_party/WebKit/public/platform/WebSocketHandshakeThrottle.h"
18 #include "url/gurl.h"
19
20 namespace safe_browsing {
21
22 class WebSocketSBHandshakeThrottle : public blink::WebSocketHandshakeThrottle {
23 public:
24 explicit WebSocketSBHandshakeThrottle(mojom::SafeBrowsing* safe_browsing);
25 ~WebSocketSBHandshakeThrottle() override;
26
27 void ThrottleHandshake(
28 const blink::WebURL& url,
29 blink::WebLocalFrame* web_local_frame,
30 blink::WebCallbacks<void, const blink::WebString&>* callbacks) override;
31
32 private:
33 void OnCheckResult(bool safe);
34
35 GURL url_;
36 blink::WebCallbacks<void, const blink::WebString&>* callbacks_;
37 mojom::SafeBrowsingUrlCheckerPtr url_checker_;
38 mojom::SafeBrowsing* safe_browsing_;
39
40 base::WeakPtrFactory<WebSocketSBHandshakeThrottle> weak_factory_;
41
42 DISALLOW_COPY_AND_ASSIGN(WebSocketSBHandshakeThrottle);
43 };
44
45 } // namespace safe_browsing
46
47 #endif // COMPONENTS_SAFE_BROWSING_RENDERER_WEBSOCKET_SB_HANDSHAKE_THROTTLE_H_
OLDNEW
« no previous file with comments | « components/safe_browsing/renderer/DEPS ('k') | components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698