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

Side by Side Diff: extensions/browser/api/serial/serial_api.h

Issue 1128943005: Implement break signal for serial api. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: histogram, VLOG Created 5 years, 6 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
« no previous file with comments | « device/serial/test_serial_io_handler.cc ('k') | extensions/browser/api/serial/serial_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef EXTENSIONS_BROWSER_API_SERIAL_SERIAL_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_SERIAL_SERIAL_API_H_
6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_API_H_ 6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_API_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "device/serial/serial.mojom.h" 10 #include "device/serial/serial.mojom.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 ~SerialSetControlSignalsFunction() override; 232 ~SerialSetControlSignalsFunction() override;
233 233
234 // AsyncApiFunction: 234 // AsyncApiFunction:
235 bool Prepare() override; 235 bool Prepare() override;
236 void Work() override; 236 void Work() override;
237 237
238 private: 238 private:
239 scoped_ptr<serial::SetControlSignals::Params> params_; 239 scoped_ptr<serial::SetControlSignals::Params> params_;
240 }; 240 };
241 241
242 class SerialSetBreakFunction : public SerialAsyncApiFunction {
243 public:
244 DECLARE_EXTENSION_FUNCTION("serial.setBreak", SERIAL_SETBREAK)
245 SerialSetBreakFunction();
246
247 protected:
248 ~SerialSetBreakFunction() override;
249
250 // AsyncApiFunction:
251 bool Prepare() override;
252 void Work() override;
253
254 private:
255 scoped_ptr<serial::SetBreak::Params> params_;
256 };
257
258 class SerialClearBreakFunction : public SerialAsyncApiFunction {
259 public:
260 DECLARE_EXTENSION_FUNCTION("serial.clearBreak", SERIAL_CLEARBREAK)
261 SerialClearBreakFunction();
262
263 protected:
264 ~SerialClearBreakFunction() override;
265
266 // AsyncApiFunction:
267 bool Prepare() override;
268 void Work() override;
269
270 private:
271 scoped_ptr<serial::ClearBreak::Params> params_;
272 };
273
242 } // namespace core_api 274 } // namespace core_api
243 275
244 } // namespace extensions 276 } // namespace extensions
245 277
246 namespace mojo { 278 namespace mojo {
247 279
248 template <> 280 template <>
249 struct TypeConverter<linked_ptr<extensions::core_api::serial::DeviceInfo>, 281 struct TypeConverter<linked_ptr<extensions::core_api::serial::DeviceInfo>,
250 device::serial::DeviceInfoPtr> { 282 device::serial::DeviceInfoPtr> {
251 static linked_ptr<extensions::core_api::serial::DeviceInfo> Convert( 283 static linked_ptr<extensions::core_api::serial::DeviceInfo> Convert(
252 const device::serial::DeviceInfoPtr& input); 284 const device::serial::DeviceInfoPtr& input);
253 }; 285 };
254 286
255 } // namespace mojo 287 } // namespace mojo
256 288
257 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_API_H_ 289 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_API_H_
OLDNEW
« no previous file with comments | « device/serial/test_serial_io_handler.cc ('k') | extensions/browser/api/serial/serial_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698