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_SERIAL_SERIAL_EVENT_DISPATCHER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_ |
6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_ | 6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
9 | 10 |
10 #include "extensions/browser/api/api_resource_manager.h" | 11 #include "extensions/browser/api/api_resource_manager.h" |
11 #include "extensions/common/api/serial.h" | 12 #include "extensions/common/api/serial.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 class BrowserContext; | 15 class BrowserContext; |
15 } | 16 } |
16 | 17 |
17 namespace extensions { | 18 namespace extensions { |
18 | 19 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 content::BrowserThread::ID thread_id; | 53 content::BrowserThread::ID thread_id; |
53 void* browser_context_id; | 54 void* browser_context_id; |
54 std::string extension_id; | 55 std::string extension_id; |
55 scoped_refptr<ConnectionData> connections; | 56 scoped_refptr<ConnectionData> connections; |
56 int connection_id; | 57 int connection_id; |
57 }; | 58 }; |
58 | 59 |
59 static void StartReceive(const ReceiveParams& params); | 60 static void StartReceive(const ReceiveParams& params); |
60 | 61 |
61 static void ReceiveCallback(const ReceiveParams& params, | 62 static void ReceiveCallback(const ReceiveParams& params, |
62 const std::string& data, | 63 const std::vector<char>& data, |
63 serial::ReceiveError error); | 64 serial::ReceiveError error); |
64 | 65 |
65 static void PostEvent(const ReceiveParams& params, | 66 static void PostEvent(const ReceiveParams& params, |
66 scoped_ptr<extensions::Event> event); | 67 scoped_ptr<extensions::Event> event); |
67 | 68 |
68 static void DispatchEvent(void* browser_context_id, | 69 static void DispatchEvent(void* browser_context_id, |
69 const std::string& extension_id, | 70 const std::string& extension_id, |
70 scoped_ptr<extensions::Event> event); | 71 scoped_ptr<extensions::Event> event); |
71 | 72 |
72 content::BrowserThread::ID thread_id_; | 73 content::BrowserThread::ID thread_id_; |
73 content::BrowserContext* const context_; | 74 content::BrowserContext* const context_; |
74 scoped_refptr<ConnectionData> connections_; | 75 scoped_refptr<ConnectionData> connections_; |
75 }; | 76 }; |
76 | 77 |
77 } // namespace core_api | 78 } // namespace core_api |
78 | 79 |
79 } // namespace extensions | 80 } // namespace extensions |
80 | 81 |
81 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_ | 82 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_ |
OLD | NEW |