• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 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 "mojo/public/cpp/base/file_info_mojom_traits.h"
6 
7 #include "base/logging.h"
8 #include "mojo/public/cpp/base/time_mojom_traits.h"
9 
10 namespace mojo {
11 
12 // static
Read(mojo_base::mojom::FileInfoDataView data,base::File::Info * out)13 bool StructTraits<mojo_base::mojom::FileInfoDataView, base::File::Info>::Read(
14     mojo_base::mojom::FileInfoDataView data,
15     base::File::Info* out) {
16   if (!data.ReadLastModified(&out->last_modified))
17     return false;
18   if (!data.ReadLastAccessed(&out->last_accessed))
19     return false;
20   if (!data.ReadCreationTime(&out->creation_time))
21     return false;
22   out->size = data.size();
23   out->is_directory = data.is_directory();
24   out->is_symbolic_link = data.is_symbolic_link();
25   return true;
26 }
27 
28 }  // namespace mojo
29