Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: extensions/browser/api/serial/serial_connection.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/api/runtime/runtime_api.cc ('k') | extensions/browser/api/serial/serial_event_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698