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 #include "extensions/browser/api/serial/serial_event_dispatcher.h" | 5 #include "extensions/browser/api/serial/serial_event_dispatcher.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "extensions/browser/api/serial/serial_connection.h" | 10 #include "extensions/browser/api/serial/serial_connection.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 error == serial::RECEIVE_ERROR_DISCONNECTED || | 23 error == serial::RECEIVE_ERROR_DISCONNECTED || |
24 error == serial::RECEIVE_ERROR_BREAK || | 24 error == serial::RECEIVE_ERROR_BREAK || |
25 error == serial::RECEIVE_ERROR_FRAME_ERROR || | 25 error == serial::RECEIVE_ERROR_FRAME_ERROR || |
26 error == serial::RECEIVE_ERROR_OVERRUN || | 26 error == serial::RECEIVE_ERROR_OVERRUN || |
27 error == serial::RECEIVE_ERROR_BUFFER_OVERFLOW || | 27 error == serial::RECEIVE_ERROR_BUFFER_OVERFLOW || |
28 error == serial::RECEIVE_ERROR_PARITY_ERROR; | 28 error == serial::RECEIVE_ERROR_PARITY_ERROR; |
29 } | 29 } |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 static base::LazyInstance<BrowserContextKeyedAPIFactory<SerialEventDispatcher> > | 33 static base::LazyInstance< |
| 34 BrowserContextKeyedAPIFactory<SerialEventDispatcher>>::DestructorAtExit |
34 g_factory = LAZY_INSTANCE_INITIALIZER; | 35 g_factory = LAZY_INSTANCE_INITIALIZER; |
35 | 36 |
36 // static | 37 // static |
37 BrowserContextKeyedAPIFactory<SerialEventDispatcher>* | 38 BrowserContextKeyedAPIFactory<SerialEventDispatcher>* |
38 SerialEventDispatcher::GetFactoryInstance() { | 39 SerialEventDispatcher::GetFactoryInstance() { |
39 return g_factory.Pointer(); | 40 return g_factory.Pointer(); |
40 } | 41 } |
41 | 42 |
42 // static | 43 // static |
43 SerialEventDispatcher* SerialEventDispatcher::Get( | 44 SerialEventDispatcher* SerialEventDispatcher::Get( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return; | 164 return; |
164 | 165 |
165 EventRouter* router = EventRouter::Get(context); | 166 EventRouter* router = EventRouter::Get(context); |
166 if (router) | 167 if (router) |
167 router->DispatchEventToExtension(extension_id, std::move(event)); | 168 router->DispatchEventToExtension(extension_id, std::move(event)); |
168 } | 169 } |
169 | 170 |
170 } // namespace api | 171 } // namespace api |
171 | 172 |
172 } // namespace extensions | 173 } // namespace extensions |
OLD | NEW |