OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 COMPONENTS_DEVTOOLS_BRIDGE_SESSION_DEPENDENCY_FACTORY_H_ | |
6 #define COMPONENTS_DEVTOOLS_BRIDGE_SESSION_DEPENDENCY_FACTORY_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "components/devtools_bridge/abstract_peer_connection.h" | |
13 #include "components/devtools_bridge/rtc_configuration.h" | |
14 | |
15 namespace base { | |
16 class TaskRunner; | |
17 } | |
18 | |
19 namespace devtools_bridge { | |
20 | |
21 /** | |
22 * Abstraction layer over WebRTC API used in DevTools Bridge. | |
23 * It helps to isolate ref counting and threading logic needed. | |
24 */ | |
25 class SessionDependencyFactory { | |
26 public: | |
27 SessionDependencyFactory() {} | |
28 virtual ~SessionDependencyFactory() {} | |
29 | |
30 static bool InitializeSSL(); | |
31 static bool CleanupSSL(); | |
32 | |
33 static scoped_ptr<SessionDependencyFactory> CreateInstance( | |
34 const base::Closure& cleanup_on_signaling_thread); | |
35 | |
36 virtual scoped_ptr<AbstractPeerConnection> CreatePeerConnection( | |
37 scoped_ptr<RTCConfiguration> config, | |
38 scoped_ptr<AbstractPeerConnection::Delegate> delegate) = 0; | |
39 | |
40 virtual scoped_refptr<base::TaskRunner> signaling_thread_task_runner() = 0; | |
41 virtual scoped_refptr<base::TaskRunner> io_thread_task_runner() = 0; | |
42 | |
43 private: | |
44 DISALLOW_COPY_AND_ASSIGN(SessionDependencyFactory); | |
45 }; | |
46 | |
47 } // namespace devtools_bridge | |
48 | |
49 #endif // COMPONENTS_DEVTOOLS_BRIDGE_SESSION_DEPENDENCY_FACTORY_H_ | |
OLD | NEW |