OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 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 CONTENT_RENDERER_MEDIA_WEBRTC_IDENTITY_SERVICE_H_ | |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_IDENTITY_SERVICE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/memory/scoped_ptr.h" | |
Ryan Sleevi
2013/06/27 18:05:24
Is this actually needed? Doesn't seem like it.
jiayl
2013/06/27 18:29:36
Done.
| |
12 #include "content/public/renderer/render_process_observer.h" | |
13 #include "googleurl/src/gurl.h" | |
14 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h " | |
15 | |
16 namespace content { | |
17 | |
18 // This class handles WebRTC DTLS identity requests by sending IPC messages to | |
19 // the browser process. | |
20 class WebRTCIdentityService : public webrtc::DTLSIdentityServiceInterface, | |
21 public RenderProcessObserver { | |
22 public: | |
23 WebRTCIdentityService(const GURL& origin); | |
24 virtual ~WebRTCIdentityService(); | |
25 | |
26 // WebRTCIdentityServiceInterface implementation. | |
27 virtual bool RequestIdentity(const std::string& identity_name, | |
28 const std::string& common_name, | |
29 webrtc::DTLSIdentityRequestObserver* observer) | |
30 OVERRIDE; | |
31 | |
32 private: | |
33 // RenderProcessObserver implementation. | |
34 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | |
35 | |
36 void OnIdentityReady(int request_id, | |
37 const std::string& certificate, | |
38 const std::string& private_key); | |
39 | |
40 void OnRequestFailed(int request_id, int error); | |
41 | |
42 // The origin of the DTLS connection. | |
43 GURL origin_; | |
44 talk_base::scoped_refptr<webrtc::DTLSIdentityRequestObserver> | |
45 pending_observer_; | |
46 int pending_request_id_; | |
47 DISALLOW_COPY_AND_ASSIGN(WebRTCIdentityService); | |
48 }; | |
49 | |
50 } // namespace content | |
51 | |
52 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_IDENTITY_SERVICE_H_ | |
OLD | NEW |