Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: content/renderer/media/dtls_identity_service.h

Issue 15969025: Generates the DTLS identity in browser process and returns it to render process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 "content/public/renderer/render_process_observer.h"
12 #include "googleurl/src/gurl.h"
13 #include "third_party/libjingle/source/talk/base/scoped_ptr.h"
Ami GONE FROM CHROMIUM 2013/06/06 21:33:04 unnecessary see below
jiayl 2013/06/06 22:53:39 Done.
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() {}
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 talk_base::scoped_ptr<DTLSIdentityObserver>& observer);
Ami GONE FROM CHROMIUM 2013/06/06 21:33:04 the ctor is not part of the interface, so can be p
jiayl 2013/06/06 22:53:39 Done.
34 virtual ~DTLSIdentityService();
35
36 void Initialize();
37
38 // Request a DTLS identity. A new one will be gernerated if not existent.
39 // |identity_name| is used to identity an identity within an origin.
40 // |common_name| is the common name used to generated the certificate.
41 virtual void RequestIdentity(const std::string& identity_name,
42 const std::string& common_name);
43
44 protected:
45 virtual RenderThread* GetRenderThread();
Ami GONE FROM CHROMIUM 2013/06/06 21:33:04 Comment this is protected for testing.
jiayl 2013/06/06 22:53:39 removed.
46
47 private:
48 // RenderProcessObserver implementation.
49 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
50
51 void OnIdentityReady(const std::string& certificate,
52 const std::string& private_key);
53
54 // The origin of the PeerConnection which owns this DTLSIdentityService.
55 GURL origin_;
56 talk_base::scoped_ptr<DTLSIdentityObserver> observer_;
Ami GONE FROM CHROMIUM 2013/06/06 21:33:04 ditto above
jiayl 2013/06/06 22:53:39 Done.
57 RenderThread* render_thread_;
Ami GONE FROM CHROMIUM 2013/06/06 21:33:04 unused
jiayl 2013/06/06 22:53:39 removed
58
59 DISALLOW_COPY_AND_ASSIGN(DTLSIdentityService);
60 };
61
62 } // namespace content
63
64 #endif // CONTENT_RENDERER_MEDIA_DTLS_IDENTITY_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698