Chromium Code Reviews| Index: content/renderer/media/dtls_identity_service.h |
| diff --git a/content/renderer/media/dtls_identity_service.h b/content/renderer/media/dtls_identity_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a6e13534d797533d30eb907c65e155e7ea3f65bc |
| --- /dev/null |
| +++ b/content/renderer/media/dtls_identity_service.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_MEDIA_DTLS_IDENTITY_SERVICE_H_ |
| +#define CONTENT_RENDERER_MEDIA_DTLS_IDENTITY_SERVICE_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "content/public/renderer/render_process_observer.h" |
| +#include "googleurl/src/gurl.h" |
| + |
| +namespace content { |
| + |
| +class RenderThread; |
| + |
| +// TODO (jiayl): Move it to Libjingle and implement it there. |
|
Ryan Sleevi
2013/06/06 23:57:37
It seems like these should happen before continuin
|
| +class DTLSIdentityObserver { |
| + public: |
| + virtual ~DTLSIdentityObserver() {} |
| + virtual void OnCompleted(const std::string& certificate, |
| + const std::string& private_key) = 0; |
| +}; |
| + |
| +// This class handles DTLS identity requests by sending IPC messages to the |
| +// browser process. |
| +// TODO: implement webrtc::DTLSIdentityServiceInterface from Libjingle. |
| +class DTLSIdentityService : public RenderProcessObserver { |
| + public: |
| + DTLSIdentityService(const GURL& origin, |
| + scoped_ptr<DTLSIdentityObserver>& observer); |
|
Ryan Sleevi
2013/06/06 23:57:37
BUG: Do not pass this as a non-const reference. Us
|
| + virtual ~DTLSIdentityService(); |
| + |
| + // Request a DTLS identity. A new one will be gernerated if not existent. |
| + // |identity_name| is used to identity an identity within an origin. |
|
Ryan Sleevi
2013/06/06 23:57:37
s/identity an identity/identify an identity/
jiayl
2013/06/13 21:50:45
Done.
|
| + // |common_name| is the common name used to generated the certificate. |
| + virtual void RequestIdentity(const std::string& identity_name, |
|
Ryan Sleevi
2013/06/06 23:57:37
COMMENT: Please expand on what these mean within t
jiayl
2013/06/13 21:50:45
Done.
|
| + const std::string& common_name); |
| + |
| + private: |
| + // RenderProcessObserver implementation. |
| + virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| + |
| + void OnIdentityReady(const std::string& certificate, |
| + const std::string& private_key); |
| + |
| + // The origin of the PeerConnection which owns this DTLSIdentityService. |
| + GURL origin_; |
| + scoped_ptr<DTLSIdentityObserver> observer_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DTLSIdentityService); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_MEDIA_DTLS_IDENTITY_SERVICE_H_ |