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_DTLS_IDENTITY_SERVICE_H_ | |
6 #define CONTENT_RENDERER_MEDIA_DTLS_IDENTITY_SERVICE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "content/public/renderer/render_process_observer.h" | |
13 #include "googleurl/src/gurl.h" | |
14 | |
15 namespace content { | |
16 | |
17 class RenderThread; | |
18 | |
19 // TODO (jiayl): Move it to Libjingle and implement it there. | |
20 class DTLSIdentityObserver { | |
21 public: | |
22 virtual ~DTLSIdentityObserver() {} | |
Ami GONE FROM CHROMIUM
2013/06/06 22:56:46
clang may complain about inlined dtor (move impl t
| |
23 virtual void OnCompleted(const std::string& certificate, | |
24 const std::string& private_key) = 0; | |
25 }; | |
26 | |
27 // This class handles DTLS identity requests by sending IPC messages to the | |
28 // browser process. | |
29 // TODO: implement webrtc::DTLSIdentityServiceInterface from Libjingle. | |
30 class DTLSIdentityService : public RenderProcessObserver { | |
31 public: | |
32 DTLSIdentityService(const GURL& origin, | |
33 scoped_ptr<DTLSIdentityObserver>& observer); | |
34 virtual ~DTLSIdentityService(); | |
35 | |
36 // Request a DTLS identity. A new one will be gernerated if not existent. | |
37 // |identity_name| is used to identity an identity within an origin. | |
38 // |common_name| is the common name used to generated the certificate. | |
39 virtual void RequestIdentity(const std::string& identity_name, | |
40 const std::string& common_name); | |
41 | |
42 private: | |
43 // RenderProcessObserver implementation. | |
44 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | |
45 | |
46 void OnIdentityReady(const std::string& certificate, | |
47 const std::string& private_key); | |
48 | |
49 // The origin of the PeerConnection which owns this DTLSIdentityService. | |
50 GURL origin_; | |
51 scoped_ptr<DTLSIdentityObserver> observer_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(DTLSIdentityService); | |
54 }; | |
55 | |
56 } // namespace content | |
57 | |
58 #endif // CONTENT_RENDERER_MEDIA_DTLS_IDENTITY_SERVICE_H_ | |
OLD | NEW |