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

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: fix 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
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/media/dtls_identity_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/media/dtls_identity_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698