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

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

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 #include "chrome/common/extensions/media_parser_struct_traits.h"
6 #include "mojo/public/cpp/bindings/array_data_view.h"
7
8 namespace {
9
10 using TypeImageDataView = extensions::mojom::AttachedImageDataView;
11 using TypeImage = ::metadata::AttachedImage;
12
13 } // namespace
14
15 namespace mojo {
16
17 // static
18 bool StructTraits<TypeImageDataView, TypeImage>::Read(TypeImageDataView view,
19 TypeImage* out) {
20 if (!view.ReadType(&out->type))
21 return false;
22
23 ArrayDataView<uint8_t> data;
24 view.GetDataDataView(&data);
25
26 out->data.assign(reinterpret_cast<const char*>(data.data()), data.size());
27 return true;
28 }
29
30 } // namespace mojo
OLDNEW
« no previous file with comments | « chrome/common/extensions/media_parser_struct_traits.h ('k') | chrome/common/extensions/typemaps.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698