| 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_connection.h" | 5 #include "extensions/browser/api/serial/serial_connection.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 case api::serial::STOP_BITS_ONE: | 139 case api::serial::STOP_BITS_ONE: |
| 140 return device::serial::StopBits::ONE; | 140 return device::serial::StopBits::ONE; |
| 141 case api::serial::STOP_BITS_TWO: | 141 case api::serial::STOP_BITS_TWO: |
| 142 return device::serial::StopBits::TWO; | 142 return device::serial::StopBits::TWO; |
| 143 } | 143 } |
| 144 return device::serial::StopBits::NONE; | 144 return device::serial::StopBits::NONE; |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace | 147 } // namespace |
| 148 | 148 |
| 149 static base::LazyInstance< | 149 static base::LazyInstance<BrowserContextKeyedAPIFactory< |
| 150 BrowserContextKeyedAPIFactory<ApiResourceManager<SerialConnection> > > | 150 ApiResourceManager<SerialConnection>>>::DestructorAtExit g_factory = |
| 151 g_factory = LAZY_INSTANCE_INITIALIZER; | 151 LAZY_INSTANCE_INITIALIZER; |
| 152 | 152 |
| 153 // static | 153 // static |
| 154 template <> | 154 template <> |
| 155 BrowserContextKeyedAPIFactory<ApiResourceManager<SerialConnection> >* | 155 BrowserContextKeyedAPIFactory<ApiResourceManager<SerialConnection> >* |
| 156 ApiResourceManager<SerialConnection>::GetFactoryInstance() { | 156 ApiResourceManager<SerialConnection>::GetFactoryInstance() { |
| 157 return g_factory.Pointer(); | 157 return g_factory.Pointer(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 SerialConnection::SerialConnection(const std::string& port, | 160 SerialConnection::SerialConnection(const std::string& port, |
| 161 const std::string& owner_extension_id) | 161 const std::string& owner_extension_id) |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); | 413 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); |
| 414 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); | 414 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); |
| 415 if (input.cts_flow_control.get()) { | 415 if (input.cts_flow_control.get()) { |
| 416 output->has_cts_flow_control = true; | 416 output->has_cts_flow_control = true; |
| 417 output->cts_flow_control = *input.cts_flow_control; | 417 output->cts_flow_control = *input.cts_flow_control; |
| 418 } | 418 } |
| 419 return output; | 419 return output; |
| 420 } | 420 } |
| 421 | 421 |
| 422 } // namespace mojo | 422 } // namespace mojo |
| OLD | NEW |