Chromium Code Reviews| Index: extensions/browser/api/media_perception_private/conversion_utils.h |
| diff --git a/extensions/browser/api/media_perception_private/conversion_utils.h b/extensions/browser/api/media_perception_private/conversion_utils.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..24108ab9344cbb2b618fb3601ccb462145ce563c |
| --- /dev/null |
| +++ b/extensions/browser/api/media_perception_private/conversion_utils.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_CONVERSION_UTILS_H_ |
| +#define EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_CONVERSION_UTILS_H_ |
| + |
| +#include "chromeos/media_perception/media_perception.pb.h" |
| +#include "extensions/common/api/media_perception_private.h" |
| + |
| +namespace media_perception = extensions::api::media_perception_private; |
|
tbarzic
2017/05/17 21:04:41
Use full namespace in this file.
Luke Sorenson
2017/05/17 23:07:48
Done.
|
| + |
| +namespace extensions { |
| + |
| +// Converts State proto messages to State objects (generated by the |
| +// media_perception_private.idl) to be returned to the JavaScript frontend. |
|
tbarzic
2017/05/17 21:04:41
nit: remove "to be returned ..."
(here and elsewhe
Luke Sorenson
2017/05/17 23:07:48
Done.
|
| +media_perception::State StateProtoToIdl(const mri::State& state); |
|
tbarzic
2017/05/17 21:04:41
nit: maybe wrap these with media_perception namesp
Luke Sorenson
2017/05/17 23:07:48
Done.
|
| + |
| +// Converts State objects (generated by the media_perception_private.idl) to |
| +// State proto messages to be sent over D-Bus. |
| +mri::State StateIdlToProto(const media_perception::State& state); |
| + |
| +// Converts incoming (over D-Bus channel) MediaPerception proto messages |
|
tbarzic
2017/05/17 21:04:41
nit:
Converts MediaPerception proto to ...
Luke Sorenson
2017/05/17 23:07:48
Done.
|
| +// to MediaPerception objects (generated by the |
| +// media_perception_private.idl) to be broadcasted as events to the |
| +// JavaScript frontend. |
| +media_perception::MediaPerception MediaPerceptionProtoToIdl( |
| + const mri::MediaPerception& media_perception); |
| + |
| +// Converts Diagnostics proto messages to Diagnostics objects (generated by the |
| +// media_perception_private.idl) to be returned to the JavaScript frontend as a |
| +// callback. |
| +media_perception::Diagnostics DiagnosticsProtoToIdl( |
| + const mri::Diagnostics& diagnostics); |
| + |
| +} // namespace extensions |
| + |
| +#endif // EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_CONVERSION_UTILS_H_ |