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

Side by Side Diff: chrome/common/extensions/media_parser_struct_traits.h

Issue 2615423002: Convert utility process ParseMediaMetadata IPC to mojo (Closed)
Patch Set: Security review comments. Created 3 years, 11 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_MEDIA_PARSER_STRUCT_TRAITS_H_
6 #define CHROME_COMMON_EXTENSIONS_MEDIA_PARSER_STRUCT_TRAITS_H_
7
8 #include <string>
9
10 #include "chrome/common/extensions/media_parser.mojom.h"
11 #include "chrome/common/media_galleries/metadata_types.h"
12 #include "mojo/public/cpp/bindings/array_traits_carray.h"
13
14 namespace mojo {
15
16 template <>
17 struct StructTraits<extensions::mojom::AttachedImageDataView,
18 ::metadata::AttachedImage> {
19 static const std::string& type(const ::metadata::AttachedImage& image) {
20 return image.type;
21 }
22
23 static ConstCArray<uint8_t> data(const ::metadata::AttachedImage& image) {
24 // TODO(dcheng): perhaps metadata::AttachedImage should consider passing the
25 // image data around in a std::vector<uint8_t>.
26 return ConstCArray<uint8_t>(
27 image.data.size(), reinterpret_cast<const uint8_t*>(image.data.data()));
28 }
29
30 static bool Read(extensions::mojom::AttachedImageDataView view,
31 ::metadata::AttachedImage* out);
32 };
33
34 } // namespace mojo
35
36 #endif // CHROME_COMMON_EXTENSIONS_MEDIA_PARSER_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/media_parser.typemap ('k') | chrome/common/extensions/media_parser_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698