Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / content / renderer / media / peer_connection_identity_service.h
blob952e8a5ba7aef46a4643d9c285f1ade7462d78a8
1 // Copyright 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.
5 #ifndef CONTENT_RENDERER_MEDIA_PEER_CONNECTION_IDENTITY_SERVICE_H_
6 #define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_IDENTITY_SERVICE_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/single_thread_task_runner.h"
13 #include "base/threading/thread_checker.h"
14 #include "content/public/renderer/render_process_observer.h"
15 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h"
16 #include "url/gurl.h"
18 namespace content {
20 // This class is associated with a peer connection and handles WebRTC DTLS
21 // identity requests by delegating to the per-renderer WebRTCIdentityProxy.
22 class PeerConnectionIdentityService
23 : public webrtc::DTLSIdentityServiceInterface {
24 public:
25 PeerConnectionIdentityService(const GURL& url,
26 const GURL& first_party_for_cookies);
28 ~PeerConnectionIdentityService() override;
30 // webrtc::DTLSIdentityServiceInterface implementation.
31 bool RequestIdentity(const std::string& identity_name,
32 const std::string& common_name,
33 webrtc::DTLSIdentityRequestObserver* observer) override;
35 private:
36 base::ThreadChecker signaling_thread_;
38 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_;
40 const GURL url_;
42 const GURL first_party_for_cookies_;
44 DISALLOW_COPY_AND_ASSIGN(PeerConnectionIdentityService);
47 } // namespace content
49 #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_IDENTITY_SERVICE_H_