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

Unified Diff: mojom/mojom_parser/serialization/serialization.go

Issue 1717583003: Mojom compiler: Move RuntimeTypeInfo from mojom_files.mojom to mojom_types.mojom. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: New sha1s Created 4 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: mojom/mojom_parser/serialization/serialization.go
diff --git a/mojom/mojom_parser/serialization/serialization.go b/mojom/mojom_parser/serialization/serialization.go
index e0ff2d90594bfd96c5071077a9e8acf80bf6de00..d4ddff381d686ebae1af195f87ca6e15234a0153 100644
--- a/mojom/mojom_parser/serialization/serialization.go
+++ b/mojom/mojom_parser/serialization/serialization.go
@@ -129,8 +129,8 @@ func translateMojomFile(f *mojom.MojomFile, fileGraph *mojom_files.MojomFileGrap
// We will populate a RuntimeTypeInfo structure and then serialize it and
// the serialized bytes will form the |serialized_runtime_type_info| field
// of the MojomFile.
- typeInfo := mojom_files.RuntimeTypeInfo{}
- typeInfo.ServicesByName = make(map[string]mojom_files.ServiceTypeInfo)
+ typeInfo := mojom_types.RuntimeTypeInfo{}
+ typeInfo.ServicesByName = make(map[string]mojom_types.ServiceTypeInfo)
typeInfo.TypeMap = make(map[string]mojom_types.UserDefinedType)
// We populate the declared_mojom_objects field
@@ -221,10 +221,10 @@ func translateMojomFile(f *mojom.MojomFile, fileGraph *mojom_files.MojomFileGrap
// addServiceTypeInfo will add a ServiceTypeInfo to the ServicesByName field of |typeInfo| corresponding
// to |intrfc| if |intrfc| is a top-level interface, meaning that it has a non-nil service name. In that
// case this method returns true. Otherwise this method will do nothing and return fals.
-func addServiceTypeInfo(intrfc *mojom.MojomInterface, typeInfo *mojom_files.RuntimeTypeInfo) (isTopLevel bool) {
+func addServiceTypeInfo(intrfc *mojom.MojomInterface, typeInfo *mojom_types.RuntimeTypeInfo) (isTopLevel bool) {
isTopLevel = intrfc.ServiceName != nil
if isTopLevel {
- serviceTypeInfo := mojom_files.ServiceTypeInfo{}
+ serviceTypeInfo := mojom_types.ServiceTypeInfo{}
serviceTypeInfo.TopLevelInterface = intrfc.TypeKey()
serviceTypeInfo.CompleteTypeSet = intrfc.FindReachableTypes()
typeInfo.ServicesByName[*intrfc.ServiceName] = serviceTypeInfo
« no previous file with comments | « mojom/mojom_parser/generated/mojom_types/mojom_types.mojom.go ('k') | mojom/mojom_parser/serialization/serialization_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698