summaryrefslogtreecommitdiff
path: root/chromium/components/chrome_cleaner/public/typemaps/chrome_prompt_struct_traits.h
blob: 5d064a201c440cdf3096ea2ed2e411b8bdc17bff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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 COMPONENTS_CHROME_CLEANER_PUBLIC_TYPEMAPS_CHROME_CLEANER_STRUCT_TRAITS_H_
#define COMPONENTS_CHROME_CLEANER_PUBLIC_TYPEMAPS_CHROME_CLEANER_STRUCT_TRAITS_H_

#include "base/containers/span.h"
#include "base/files/file_path.h"
#include "base/strings/string16.h"
#include "components/chrome_cleaner/public/interfaces/chrome_prompt.mojom.h"

namespace mojo {

template <>
struct StructTraits<chrome_cleaner::mojom::FilePathDataView, base::FilePath> {
  static base::span<const uint16_t> value(const base::FilePath& file_path);
  static bool Read(chrome_cleaner::mojom::FilePathDataView path_view,
                   base::FilePath* out);
};

template <>
struct StructTraits<chrome_cleaner::mojom::RegistryKeyDataView,
                    base::string16> {
  static base::span<const uint16_t> value(const base::string16& registry_key);
  static bool Read(chrome_cleaner::mojom::RegistryKeyDataView registry_key_view,
                   base::string16* out);
};

}  // namespace mojo

#endif  // COMPONENTS_CHROME_CLEANER_PUBLIC_TYPEMAPS_CHROME_CLEANER_STRUCT_TRAITS_H_