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

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

Issue 2727113002: mediaview: Add a typemap for arc::mojom::ChangeType. (Closed)
Patch Set: Add a missing source in //storage/browser. 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
« no previous file with comments | « components/arc/file_system/OWNERS ('k') | components/arc/test/fake_file_system_instance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 COMPONENTS_ARC_FILE_SYSTEM_FILE_SYSTEM_STRUCT_TRAITS_H_
6 #define COMPONENTS_ARC_FILE_SYSTEM_FILE_SYSTEM_STRUCT_TRAITS_H_
7
8 #include "base/logging.h"
9 #include "components/arc/common/file_system.mojom.h"
10 #include "storage/browser/fileapi/watcher_manager.h"
11
12 namespace mojo {
13
14 template <>
15 struct EnumTraits<arc::mojom::ChangeType, storage::WatcherManager::ChangeType> {
16 static arc::mojom::ChangeType ToMojom(
17 storage::WatcherManager::ChangeType type) {
18 switch (type) {
19 case storage::WatcherManager::CHANGED:
20 return arc::mojom::ChangeType::CHANGED;
21 case storage::WatcherManager::DELETED:
22 return arc::mojom::ChangeType::DELETED;
dcheng 2017/03/02 07:26:36 In general, we prefer to out-of-line not-obviously
Shuhei Takahashi 2017/03/02 07:45:44 Hmm, OK, please let me move this definition to out
23 }
24 NOTREACHED();
25 return arc::mojom::ChangeType::CHANGED;
26 }
27
28 static bool 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
43 } // namespace mojo
44
45 #endif // COMPONENTS_ARC_FILE_SYSTEM_FILE_SYSTEM_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « components/arc/file_system/OWNERS ('k') | components/arc/test/fake_file_system_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698