Chromium Code Reviews| 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 DTLSIdentityObserver { | |
|
Ami GONE FROM CHROMIUM
2013/06/06 18:28:51
Comment this is here only temporarily until it mov
jiayl
2013/06/06 21:00:08
Done.
jiayl
2013/06/06 21:00:08
Done.
| |
| 18 public: | |
| 19 virtual ~DTLSIdentityObserver() {} | |
| 20 virtual void OnCompleted(const std::string& certificate, | |
| 21 const std::string& private_key) = 0; | |
| 22 }; | |
| 23 | |
| 24 // This class handles DTLS identity requests by sending IPC messages to the | |
| 25 // browser process. | |
| 26 // TODO: implement webrtc::DTLSIdentityServiceInterface from Libjingle. | |
| 27 class DTLSIdentityService : public RenderProcessObserver { | |
|
Ami GONE FROM CHROMIUM
2013/06/06 18:28:51
How is this working without calling RenderThread()
jiayl
2013/06/06 21:00:08
Oops, added these calls. I'm not sure how to test
| |
| 28 public: | |
| 29 // |observer| is owned by DTLSIdentityService. | |
|
Ami GONE FROM CHROMIUM
2013/06/06 18:28:51
Passing by scoped_ptr would allow the compiler to
jiayl
2013/06/06 21:00:08
Done.
jiayl
2013/06/06 21:00:08
Done.
| |
| 30 DTLSIdentityService(const GURL& origin, | |
| 31 DTLSIdentityObserver* observer); | |
| 32 virtual ~DTLSIdentityService(); | |
| 33 | |
| 34 // Get the DTLS identity or generate a new one if not existent. | |
| 35 // |identity_name| is used to identity an identity within an origin. | |
| 36 // |common_name| is the common name used to generated the certificate. | |
| 37 virtual void GetOrGenerateIdentity(const std::string& identity_name, | |
|
Ami GONE FROM CHROMIUM
2013/06/06 18:28:51
nit: name & comment still sound synchronous.
s/Get
jiayl
2013/06/06 21:00:08
Done.
jiayl
2013/06/06 21:00:08
Done.
| |
| 38 const std::string& common_name); | |
| 39 | |
| 40 private: | |
| 41 // RenderProcessObserver implementation. | |
| 42 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 43 | |
| 44 void OnIdentityReady(const std::string& certificate, | |
| 45 const std::string& private_key); | |
| 46 | |
| 47 // The origin of the PeerConnection which owns this DTLSIdentityService. | |
| 48 GURL origin_; | |
| 49 scoped_ptr<DTLSIdentityObserver> observer_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(DTLSIdentityService); | |
| 52 }; | |
| 53 | |
| 54 } // namespace content | |
| 55 | |
| 56 #endif // CONTENT_RENDERER_MEDIA_DTLS_IDENTITY_SERVICE_H_ | |
| OLD | NEW |