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 #include "content/renderer/media/dtls_identity_service.h" | |
6 | |
7 #include "content/common/media/dtls_identity_messages.h" | |
8 #include "content/renderer/render_thread_impl.h" | |
9 | |
10 namespace content { | |
11 | |
12 DTLSIdentityService::DTLSIdentityService( | |
13 const GURL& origin, | |
14 DTLSIdentityObserver* observer) | |
15 : origin_(origin) { | |
16 DCHECK(observer); | |
17 observer_.reset(observer); | |
18 } | |
19 | |
20 DTLSIdentityService::~DTLSIdentityService() {} | |
21 | |
22 void DTLSIdentityService::GetOrGenerateIdentity( | |
23 const std::string& identity_name, | |
24 const std::string& common_name) { | |
25 RenderThreadImpl::current()->Send( | |
26 new DTLSIdentityMsg_GetOrGenerate(origin_, identity_name, common_name)); | |
27 } | |
28 | |
29 bool DTLSIdentityService::OnControlMessageReceived( | |
30 const IPC::Message& message) { | |
31 bool handled = true; | |
32 IPC_BEGIN_MESSAGE_MAP(DTLSIdentityService, message) | |
33 IPC_MESSAGE_HANDLER(DTLSIdentityHostMsg_IdentityReady, OnIdentityReady) | |
34 IPC_MESSAGE_UNHANDLED(handled = false) | |
35 IPC_END_MESSAGE_MAP() | |
36 return handled; | |
37 } | |
38 | |
39 void DTLSIdentityService::OnIdentityReady(const std::string& certificate, | |
Ami GONE FROM CHROMIUM
2013/06/06 18:28:51
Is it ok that libjingle will ask for the identity
jiayl
2013/06/06 21:00:08
The callback is always called on the render thread
| |
40 const std::string& private_key) { | |
41 observer_->OnCompleted(certificate, private_key); | |
42 } | |
43 | |
44 } // namespace content | |
OLD | NEW |