OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_TCP_SERVER_SOCKET_EVENT_DISPAT
CHER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_TCP_SERVER_SOCKET_EVENT_DISPAT
CHER_H_ |
6 #define EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_TCP_SERVER_SOCKET_EVENT_DISPAT
CHER_H_ | 6 #define EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_TCP_SERVER_SOCKET_EVENT_DISPAT
CHER_H_ |
7 | 7 |
8 #include "extensions/browser/api/api_resource_manager.h" | 8 #include "extensions/browser/api/api_resource_manager.h" |
9 #include "extensions/browser/api/sockets_tcp/sockets_tcp_api.h" | 9 #include "extensions/browser/api/sockets_tcp/sockets_tcp_api.h" |
10 #include "extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h" | 10 #include "extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 class BrowserContext; | 13 class BrowserContext; |
14 } | 14 } |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 struct Event; | 17 struct Event; |
18 class ResumableTCPSocket; | 18 class ResumableTCPSocket; |
19 } | 19 } |
20 | 20 |
21 namespace extensions { | 21 namespace extensions { |
22 namespace core_api { | 22 namespace api { |
23 | 23 |
24 // Dispatch events related to "sockets.tcp" sockets from callback on native | 24 // Dispatch events related to "sockets.tcp" sockets from callback on native |
25 // socket instances. There is one instance per profile. | 25 // socket instances. There is one instance per profile. |
26 class TCPServerSocketEventDispatcher | 26 class TCPServerSocketEventDispatcher |
27 : public BrowserContextKeyedAPI, | 27 : public BrowserContextKeyedAPI, |
28 public base::SupportsWeakPtr<TCPServerSocketEventDispatcher> { | 28 public base::SupportsWeakPtr<TCPServerSocketEventDispatcher> { |
29 public: | 29 public: |
30 explicit TCPServerSocketEventDispatcher(content::BrowserContext* context); | 30 explicit TCPServerSocketEventDispatcher(content::BrowserContext* context); |
31 ~TCPServerSocketEventDispatcher() override; | 31 ~TCPServerSocketEventDispatcher() override; |
32 | 32 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 const std::string& extension_id, | 87 const std::string& extension_id, |
88 scoped_ptr<Event> event); | 88 scoped_ptr<Event> event); |
89 | 89 |
90 // Usually IO thread (except for unit testing). | 90 // Usually IO thread (except for unit testing). |
91 content::BrowserThread::ID thread_id_; | 91 content::BrowserThread::ID thread_id_; |
92 content::BrowserContext* const browser_context_; | 92 content::BrowserContext* const browser_context_; |
93 scoped_refptr<ServerSocketData> server_sockets_; | 93 scoped_refptr<ServerSocketData> server_sockets_; |
94 scoped_refptr<ClientSocketData> client_sockets_; | 94 scoped_refptr<ClientSocketData> client_sockets_; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace core_api | 97 } // namespace api |
98 } // namespace extensions | 98 } // namespace extensions |
99 | 99 |
100 #endif // EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_TCP_SERVER_SOCKET_EVENT_DIS
PATCHER_H_ | 100 #endif // EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_TCP_SERVER_SOCKET_EVENT_DIS
PATCHER_H_ |
OLD | NEW |