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

Unified 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, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/arc/file_system/file_system_struct_traits.cc
diff --git a/components/arc/file_system/file_system_struct_traits.cc b/components/arc/file_system/file_system_struct_traits.cc
new file mode 100644
index 0000000000000000000000000000000000000000..df97e6bb62192c9bac69b21f55c09bbaba626063
--- /dev/null
+++ b/components/arc/file_system/file_system_struct_traits.cc
@@ -0,0 +1,42 @@
+// 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.
+
+#include "components/arc/file_system/file_system_struct_traits.h"
+
+#include "base/logging.h"
+#include "components/arc/common/file_system.mojom.h"
+
+namespace mojo {
+
+// static
+arc::mojom::ChangeType
+EnumTraits<arc::mojom::ChangeType, storage::WatcherManager::ChangeType>::
+ ToMojom(storage::WatcherManager::ChangeType type) {
+ switch (type) {
+ case storage::WatcherManager::CHANGED:
+ return arc::mojom::ChangeType::CHANGED;
+ case storage::WatcherManager::DELETED:
+ return arc::mojom::ChangeType::DELETED;
+ }
+ NOTREACHED();
+ return arc::mojom::ChangeType::CHANGED;
+}
+
+// static
+bool EnumTraits<arc::mojom::ChangeType, storage::WatcherManager::ChangeType>::
+ FromMojom(arc::mojom::ChangeType mojom_type,
+ storage::WatcherManager::ChangeType* type) {
+ switch (mojom_type) {
+ case arc::mojom::ChangeType::CHANGED:
+ *type = storage::WatcherManager::CHANGED;
+ return true;
+ case arc::mojom::ChangeType::DELETED:
+ *type = storage::WatcherManager::DELETED;
+ return true;
+ }
+ NOTREACHED();
+ return false;
+}
+
+} // namespace mojo
« 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