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

Side by Side Diff: components/arc/file_system/file_system_struct_traits.cc

Issue 2727113002: mediaview: Add a typemap for arc::mojom::ChangeType. (Closed)
Patch Set: Rebased to ToT. Created 3 years, 9 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 "components/arc/file_system/file_system_struct_traits.h"
6
7 #include "base/logging.h"
8 #include "components/arc/common/file_system.mojom.h"
9
10 namespace mojo {
11
12 // static
13 arc::mojom::ChangeType
14 EnumTraits<arc::mojom::ChangeType, storage::WatcherManager::ChangeType>::
15 ToMojom(storage::WatcherManager::ChangeType type) {
16 switch (type) {
17 case storage::WatcherManager::CHANGED:
18 return arc::mojom::ChangeType::CHANGED;
19 case storage::WatcherManager::DELETED:
20 return arc::mojom::ChangeType::DELETED;
21 }
22 NOTREACHED();
23 return arc::mojom::ChangeType::CHANGED;
24 }
25
26 // static
27 bool EnumTraits<arc::mojom::ChangeType, storage::WatcherManager::ChangeType>::
28 FromMojom(arc::mojom::ChangeType mojom_type,
29 storage::WatcherManager::ChangeType* type) {
30 switch (mojom_type) {
31 case arc::mojom::ChangeType::CHANGED:
32 *type = storage::WatcherManager::CHANGED;
33 return true;
34 case arc::mojom::ChangeType::DELETED:
35 *type = storage::WatcherManager::DELETED;
36 return true;
37 }
38 NOTREACHED();
39 return false;
40 }
41
42 } // namespace mojo
OLDNEW
« no previous file with comments | « components/arc/file_system/file_system_struct_traits.h ('k') | components/arc/test/fake_file_system_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698