Browse Source

* Corrections in used detection : treat partials

Michaël Van Canneyt 1 year ago
parent
commit
cc1403e4db
2 changed files with 65 additions and 39 deletions
  1. 1 0
      packages/webidl/src/webidlparser.pp
  2. 64 39
      packages/webidl/src/webidltopas.pp

+ 1 - 0
packages/webidl/src/webidlparser.pp

@@ -2156,6 +2156,7 @@ begin
     Raise EWebIDLParser.CreateFmt('Callback Interface %s member %s is not a function',[aDef.Name,aDef.Members[0].Name]);
     Raise EWebIDLParser.CreateFmt('Callback Interface %s member %s is not a function',[aDef.Name,aDef.Members[0].Name]);
   Result:=TIDLCallBackDefinition(FDefinitions.Add(TIDLCallBackDefinition,aDef.Name,aDef.SrcFile,aDef.Line,aDef.Column));
   Result:=TIDLCallBackDefinition(FDefinitions.Add(TIDLCallBackDefinition,aDef.Name,aDef.SrcFile,aDef.Line,aDef.Column));
   Result.FunctionDef:=TIDLFunctionDefinition(aDef.Members.Extract(aDef.Member[0]));
   Result.FunctionDef:=TIDLFunctionDefinition(aDef.Members.Extract(aDef.Member[0]));
+  Result.FunctionDef.Parent:=Result;
 end;
 end;
 
 
 procedure TWebIDLContext.ResolveCallbackInterfaces;
 procedure TWebIDLContext.ResolveCallbackInterfaces;

+ 64 - 39
packages/webidl/src/webidltopas.pp

@@ -724,8 +724,6 @@ begin
   Result:=True;
   Result:=True;
   if aDict=nil then ;
   if aDict=nil then ;
   N:=GetPasName(aField);
   N:=GetPasName(aField);
-  if aDict.Name='PromiseRejectionEventInit' then
-    Writeln('here');
   TN:=GetPasName(aField.MemberType);
   TN:=GetPasName(aField.MemberType);
   if TN='record' then
   if TN='record' then
     TN:='TJSObject';
     TN:='TJSObject';
@@ -746,9 +744,6 @@ Var
 
 
 begin
 begin
   Indent;
   Indent;
-  if aDict.Name='PromiseRejectionEventInit' then
-    Writeln('here');
-
   Result:=0;
   Result:=0;
   For D in aList do
   For D in aList do
     if D is TIDLDictionaryMemberDefinition then
     if D is TIDLDictionaryMemberDefinition then
@@ -915,7 +910,8 @@ begin
   if Result then
   if Result then
     begin
     begin
     FAutoTypes.Add(TN);
     FAutoTypes.Add(TN);
-    DoLog('Automatically adding %s sequence definition for %s.',[TN,GetDefPos(ST)]);
+    if Verbose then
+      DoLog('Automatically adding %s sequence definition for %s.',[TN,GetDefPos(ST)]);
     WriteSequenceDef(ST);
     WriteSequenceDef(ST);
     end;
     end;
 end;
 end;
@@ -928,7 +924,8 @@ begin
   if Result then
   if Result then
     begin
     begin
     FAutoTypes.Add(TN);
     FAutoTypes.Add(TN);
-    DoLog('Automatically adding %s sequence definition for %s.',[TN,GetDefPos(UT)]);
+    if Verbose then
+      DoLog('Automatically adding %s sequence definition for %s.',[TN,GetDefPos(UT)]);
     WriteUnionDef(UT);
     WriteUnionDef(UT);
     end;
     end;
 end;
 end;
@@ -989,7 +986,8 @@ Var
     if (BaseName<>NewName) then
     if (BaseName<>NewName) then
       begin
       begin
       BaseName:=GetPasName(Def);
       BaseName:=GetPasName(Def);
-      DoLog('Renaming duplicate identifier (%s) %s at %s to %s, other at %s',[Def.ClassName,BaseName,GetDefPos(Def),OrigName,GetDefPos(ConflictDef)]);
+      if Verbose then
+        DoLog('Renaming duplicate identifier (%s) %s at %s to %s, other at %s',[Def.ClassName,BaseName,GetDefPos(Def),OrigName,GetDefPos(ConflictDef)]);
       // Original TPasName is in list, will be freed automatically
       // Original TPasName is in list, will be freed automatically
       Def.Data:=CreatePasData(OrigName,OrigType,Def,False);
       Def.Data:=CreatePasData(OrigName,OrigType,Def,False);
       end;
       end;
@@ -1246,7 +1244,8 @@ Var
 begin
 begin
   FGeneratingImplementation:=True;
   FGeneratingImplementation:=True;
   Msg:='';
   Msg:='';
-  DoLog('Writing implementation section');
+  if Verbose then
+    DoLog('Writing implementation section');
   Addln('');
   Addln('');
   For S in FIncludeImplementationCode do
   For S in FIncludeImplementationCode do
     Addln(S);
     Addln(S);
@@ -1266,7 +1265,8 @@ begin
   finally
   finally
     if not OK then
     if not OK then
       Msg:=SErrBeforeException;
       Msg:=SErrBeforeException;
-    DoLog('Wrote %d of %d definitions%s',[Cnt,Context.Definitions.Count,Msg]);
+    if Verbose then
+      DoLog('Wrote %d of %d definitions%s',[Cnt,Context.Definitions.Count,Msg]);
   end;
   end;
   FGeneratingImplementation:=False;
   FGeneratingImplementation:=False;
 end;
 end;
@@ -1834,7 +1834,10 @@ begin
         aType:=TPasData(CD.ArgumentType.Data).NativeType;
         aType:=TPasData(CD.ArgumentType.Data).NativeType;
         end
         end
       else
       else
-        DoLog('Unknown native type for overload %s (%s -> %s)',[aName,aTypeName,aPasName]);
+        begin
+        if verbose then
+          DoLog('Unknown native type for overload %s (%s -> %s)',[aName,aTypeName,aPasName]);
+        end;
       DL.Add(CD);
       DL.Add(CD);
 
 
       CD.Data:=CreatePasData(aPasName,aType,CD,false);
       CD.Data:=CreatePasData(aPasName,aType,CD,false);
@@ -1941,12 +1944,12 @@ begin
   Result:=Arg.Clone(nil);
   Result:=Arg.Clone(nil);
   if Arg.Data<>nil then
   if Arg.Data<>nil then
     Result.Data:=ClonePasData(TPasData(Arg.Data),Result)
     Result.Data:=ClonePasData(TPasData(Arg.Data),Result)
-  else
+  else if verbose then
     DoLog('Warning : cloning argument "%s" without associated data',[Arg.GetNamePath]);
     DoLog('Warning : cloning argument "%s" without associated data',[Arg.GetNamePath]);
   Result.ArgumentType:=Arg.ArgumentType.Clone(Result);
   Result.ArgumentType:=Arg.ArgumentType.Clone(Result);
   if Arg.ArgumentType.Data<>nil then
   if Arg.ArgumentType.Data<>nil then
     Result.ArgumentType.Data:=ClonePasData(TPasData(Arg.ArgumentType.Data),Result)
     Result.ArgumentType.Data:=ClonePasData(TPasData(Arg.ArgumentType.Data),Result)
-  else
+  else if verbose then
     DoLog('Warning : cloning argument "%s" type "%s" without associated data',[Arg.GetNamePath,Arg.ArgumentType.GetNamePath]);
     DoLog('Warning : cloning argument "%s" type "%s" without associated data',[Arg.GetNamePath,Arg.ArgumentType.GetNamePath]);
 //  if Assigned(Result.ArgumentType)
 //  if Assigned(Result.ArgumentType)
 end;
 end;
@@ -2066,7 +2069,8 @@ begin
   finally
   finally
     if not OK then
     if not OK then
       Msg:=SErrBeforeException;
       Msg:=SErrBeforeException;
-    DoLog('Wrote %d out of %d interface definitions%s.',[Result,Total,Msg]);
+    if verbose then
+      DoLog('Wrote %d out of %d interface definitions%s.',[Result,Total,Msg]);
   end;
   end;
 end;
 end;
 
 
@@ -2574,7 +2578,8 @@ begin
       Result:=TPascalNativeType(I)
       Result:=TPascalNativeType(I)
     else
     else
       begin
       begin
-      DoLog('Warning: unknown native type in alias %s: %s',[S,NT]);
+      if Verbose then
+        DoLog('Warning: unknown native type in alias %s: %s',[S,NT]);
       SetLength(S,P-1);
       SetLength(S,P-1);
       end;
       end;
     end;
     end;
@@ -2714,7 +2719,8 @@ begin
       CN:='<anonymous>';
       CN:='<anonymous>';
     if (ParentName<>'') then
     if (ParentName<>'') then
       CN:=ParentName+'.'+CN;
       CN:=ParentName+'.'+CN;
-    DoLog('Renamed %s to %s at %s',[CN,Result.PasName,GetPasDataPos(Result)]);
+    if Verbose then
+      DoLog('Renamed %s to %s at %s',[CN,Result.PasName,GetPasDataPos(Result)]);
     end;
     end;
 end;
 end;
 
 
@@ -3074,7 +3080,8 @@ var
   I,Idx,Count : Integer;
   I,Idx,Count : Integer;
 
 
 begin
 begin
-  DoLog('Converting callback interface %s to callback',[aDef.Name]);
+  if Verbose then
+    DoLog('Converting callback interface %s to callback',[aDef.Name]);
   Count:=0;
   Count:=0;
   For I:=0 to aDef.Members.Count-1 do
   For I:=0 to aDef.Members.Count-1 do
     if (aDef.Member[I] is TIDLFunctionDefinition) then
     if (aDef.Member[I] is TIDLFunctionDefinition) then
@@ -3089,6 +3096,7 @@ begin
   Result:=TIDLCallBackDefinition(FContext.Add(TIDLCallBackDefinition,aDef.Name,aDef.SrcFile,aDef.Line,aDef.Column));
   Result:=TIDLCallBackDefinition(FContext.Add(TIDLCallBackDefinition,aDef.Name,aDef.SrcFile,aDef.Line,aDef.Column));
   Result.FunctionDef:=TIDLFunctionDefinition(aDef.Members.Extract(aDef.Member[Idx]));
   Result.FunctionDef:=TIDLFunctionDefinition(aDef.Members.Extract(aDef.Member[Idx]));
   Result.FunctionDef.Name:=Result.Name;
   Result.FunctionDef.Name:=Result.Name;
+  Result.FunctionDef.Parent:=Result;
 end;
 end;
 
 
 procedure TBaseWebIDLToPas.ResolveCallbackInterfaces;
 procedure TBaseWebIDLToPas.ResolveCallbackInterfaces;
@@ -3127,15 +3135,17 @@ function TBaseWebIDLToPas.MarkUsed(D: TIDLDefinition; ParentIsUsed : Boolean) :
 
 
   begin
   begin
     Result:=False;
     Result:=False;
-    if D.Data=nil then
+    if (D.Data=nil) and not (D is TIDLTypeDefDefinition) then
       begin
       begin
-      DoLog('[202406021006] type "'+D.ClassName+'" of "'+D.Name+'" has no pascal name assigned, cannot check used');
+      if Verbose then
+        DoLog('[202406021006] type "'+D.ClassName+'" of "'+D.Name+'" has no pascal name assigned, cannot check used');
       Exit;
       Exit;
       end;
       end;
     if GetUsed(D) then
     if GetUsed(D) then
       exit;
       exit;
     if ParentIsUsed or InUsedList(D) then
     if ParentIsUsed or InUsedList(D) then
       begin
       begin
+      // Writeln('Marking ',D.GetNamePath,' as used');
       TPasData(D.Data).Used:=True;
       TPasData(D.Data).Used:=True;
       Result:=True;
       Result:=True;
       end;
       end;
@@ -3156,21 +3166,32 @@ var
   IT: TIDLIterableDefinition;
   IT: TIDLIterableDefinition;
   SerializerD: TIDLSerializerDefinition;
   SerializerD: TIDLSerializerDefinition;
   FD: TIDLFunctionDefinition;
   FD: TIDLFunctionDefinition;
+  P : TIDLInterfaceDefinition;
+  I : Integer;
+
 begin
 begin
   Result:=False;
   Result:=False;
   if D=nil then exit;
   if D=nil then exit;
+  // Writeln('Checking ',D.GetNamePath,' for used');
   if not DoMark then
   if not DoMark then
     exit;
     exit;
   // Mark sub-classes as used
   // Mark sub-classes as used
   if D Is TIDLInterfaceDefinition then
   if D Is TIDLInterfaceDefinition then
     begin
     begin
     MarkUsedDefinitions(TIDLInterfaceDefinition(D).Members,True);
     MarkUsedDefinitions(TIDLInterfaceDefinition(D).Members,True);
-    MarkUsed(TIDLInterfaceDefinition(D).ParentInterface,True);
+    P:=TIDLInterfaceDefinition(D).ParentInterface;
+    While Assigned(P) do
+      begin
+      MarkUsed(P,True);
+      P:=P.ParentInterface;
+      end;
+    P:=TIDLInterfaceDefinition(D);
+    For I:=0 to P.Partials.Count-1 do
+      MarkUsed(P.Partial[i],True);
     end
     end
   else if D Is TIDLNamespaceDefinition then
   else if D Is TIDLNamespaceDefinition then
     begin
     begin
     MarkUsedDefinitions(TIDLNamespaceDefinition(D).Members,True);
     MarkUsedDefinitions(TIDLNamespaceDefinition(D).Members,True);
-    MarkUsed(D.Parent,True);
     end
     end
   else if D Is TIDLDictionaryDefinition then
   else if D Is TIDLDictionaryDefinition then
     begin
     begin
@@ -3178,7 +3199,9 @@ begin
     MarkUsed(TIDLDictionaryDefinition(D).ParentDictionary,True);
     MarkUsed(TIDLDictionaryDefinition(D).ParentDictionary,True);
     end
     end
   else if D is TIDLIncludesDefinition then
   else if D is TIDLIncludesDefinition then
+    begin
     //
     //
+    end
   else if D Is TIDLFunctionDefinition then
   else if D Is TIDLFunctionDefinition then
     begin
     begin
     FD:=TIDLFunctionDefinition(D);
     FD:=TIDLFunctionDefinition(D);
@@ -3218,7 +3241,7 @@ begin
     begin
     begin
     DMD:=TIDLDictionaryMemberDefinition(D);
     DMD:=TIDLDictionaryMemberDefinition(D);
     MarkUsed(DMD.MemberType,True);
     MarkUsed(DMD.MemberType,True);
-    MarkUsed(DMD.DefaultValue,True);
+    // MarkUsed(DMD.DefaultValue,True);
     end
     end
   else if D is TIDLEnumDefinition then
   else if D is TIDLEnumDefinition then
     //
     //
@@ -3246,7 +3269,9 @@ var
 
 
 begin
 begin
   For D In aList do
   For D In aList do
+    begin
     MarkUsed(D,ParentIsUsed);
     MarkUsed(D,ParentIsUsed);
+    end;
 end;
 end;
 
 
 Function TBaseWebIDLToPas.CheckChromeOnly(D : TIDLDefinition) : Boolean;
 Function TBaseWebIDLToPas.CheckChromeOnly(D : TIDLDefinition) : Boolean;
@@ -3305,26 +3330,26 @@ begin
   else if D is TIDLArgumentDefinition then
   else if D is TIDLArgumentDefinition then
     begin
     begin
     IsChrome:=CheckChromeOnly(TIDLArgumentDefinition(D).ArgumentType);
     IsChrome:=CheckChromeOnly(TIDLArgumentDefinition(D).ArgumentType);
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking argument %s as "ChromeOnly" because the argument type is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking argument %s as "ChromeOnly" because the argument type is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if D is TIDLSequenceTypeDefDefinition then
   else if D is TIDLSequenceTypeDefDefinition then
     begin
     begin
     IsChrome:=CheckChromeOnly(TIDLSequenceTypeDefDefinition(D).ElementType);
     IsChrome:=CheckChromeOnly(TIDLSequenceTypeDefDefinition(D).ElementType);
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking sequence %s as "ChromeOnly" because the element type is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking sequence %s as "ChromeOnly" because the element type is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if D is TIDLPromiseTypeDefDefinition then
   else if D is TIDLPromiseTypeDefDefinition then
     begin
     begin
     IsChrome:=CheckChromeOnly(TIDLPromiseTypeDefDefinition(D).ReturnType);
     IsChrome:=CheckChromeOnly(TIDLPromiseTypeDefDefinition(D).ReturnType);
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking map %s as "ChromeOnly" because the promise result type is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking map %s as "ChromeOnly" because the promise result type is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if D is TIDLMapLikeDefinition then
   else if D is TIDLMapLikeDefinition then
     begin
     begin
     isChrome:=CheckChromeOnly(TIDLMapLikeDefinition(D).KeyType);
     isChrome:=CheckChromeOnly(TIDLMapLikeDefinition(D).KeyType);
     isChrome:=CheckChromeOnly(TIDLMapLikeDefinition(D).ValueType) or IsChrome;
     isChrome:=CheckChromeOnly(TIDLMapLikeDefinition(D).ValueType) or IsChrome;
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking map %s as "ChromeOnly" because the map key or value type is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking map %s as "ChromeOnly" because the map key or value type is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if D is TIDLTypeDefDefinition then
   else if D is TIDLTypeDefDefinition then
@@ -3335,14 +3360,14 @@ begin
     begin
     begin
     if TIDLConstDefinition(D).TypeName<>'' then
     if TIDLConstDefinition(D).TypeName<>'' then
       IsChrome:=CheckAlias(TIDLConstDefinition(D).TypeName);
       IsChrome:=CheckAlias(TIDLConstDefinition(D).TypeName);
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking const %s as "ChromeOnly" because the const type is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking const %s as "ChromeOnly" because the const type is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if D is TIDLSerializerDefinition then
   else if D is TIDLSerializerDefinition then
     begin
     begin
     SerializerD:=TIDLSerializerDefinition(D);
     SerializerD:=TIDLSerializerDefinition(D);
     IsChrome:=CheckChromeOnly(SerializerD.SerializerFunction);
     IsChrome:=CheckChromeOnly(SerializerD.SerializerFunction);
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking serializer %s as "ChromeOnly" because the function type is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking serializer %s as "ChromeOnly" because the function type is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if D is TIDLDictionaryMemberDefinition then
   else if D is TIDLDictionaryMemberDefinition then
@@ -3350,7 +3375,7 @@ begin
     DMD:=TIDLDictionaryMemberDefinition(D);
     DMD:=TIDLDictionaryMemberDefinition(D);
     IsChrome:=CheckChromeOnly(DMD.MemberType);
     IsChrome:=CheckChromeOnly(DMD.MemberType);
     IsChrome:=CheckChromeOnly(DMD.DefaultValue) or IsChrome;
     IsChrome:=CheckChromeOnly(DMD.DefaultValue) or IsChrome;
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking dictionary member %s as "ChromeOnly" because the member type or the default value is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking dictionary member %s as "ChromeOnly" because the member type or the default value is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if D is TIDLEnumDefinition then
   else if D is TIDLEnumDefinition then
@@ -3358,13 +3383,13 @@ begin
   else if D is TIDLCallBackDefinition then
   else if D is TIDLCallBackDefinition then
     begin
     begin
     IsChrome:=CheckChromeOnly(TIDLCallBackDefinition(D).FunctionDef);
     IsChrome:=CheckChromeOnly(TIDLCallBackDefinition(D).FunctionDef);
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking callback definition %s as "ChromeOnly" because the function type is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking callback definition %s as "ChromeOnly" because the function type is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if D is TIDLSetlikeDefinition then
   else if D is TIDLSetlikeDefinition then
     begin
     begin
     IsChrome:=CheckChromeOnly(TIDLSetlikeDefinition(D).ElementType);
     IsChrome:=CheckChromeOnly(TIDLSetlikeDefinition(D).ElementType);
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking set %s as "ChromeOnly" because the member type is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking set %s as "ChromeOnly" because the member type is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if D is TIDLImplementsOrIncludesDefinition then
   else if D is TIDLImplementsOrIncludesDefinition then
@@ -3374,7 +3399,7 @@ begin
     IT:=TIDLIterableDefinition(D);
     IT:=TIDLIterableDefinition(D);
     IsChrome:=CheckChromeOnly(IT.ValueType);
     IsChrome:=CheckChromeOnly(IT.ValueType);
     IsChrome:=CheckChromeOnly(IT.KeyType) or IsChrome;
     IsChrome:=CheckChromeOnly(IT.KeyType) or IsChrome;
-    if IsChrome then
+    if IsChrome and Verbose then
       DoLog('Marking iterable %s as "ChromeOnly" because the key or value type is marked "ChromeOnly"',[D.Name]);
       DoLog('Marking iterable %s as "ChromeOnly" because the key or value type is marked "ChromeOnly"',[D.Name]);
     end
     end
   else if (D is TIDLAttributeDefinition) and Assigned(AD.AttributeType) then
   else if (D is TIDLAttributeDefinition) and Assigned(AD.AttributeType) then
@@ -3382,11 +3407,9 @@ begin
 
 
     ResolveTypeDef(AD.AttributeType);
     ResolveTypeDef(AD.AttributeType);
     RT:=GetResolvedType(AD.AttributeType,ANT,N,RN);
     RT:=GetResolvedType(AD.AttributeType,ANT,N,RN);
-    if RT.Name='PrintCallback' then
-      Writeln('hiero');
 
 
     isChrome:=CheckChromeOnly(RT);
     isChrome:=CheckChromeOnly(RT);
-    if isChrome then
+    if isChrome and Verbose then
       DoLog('Marking attribute %s as "ChromeOnly" because attribute type "%s" is marked "ChromeOnly"',[D.Name,N{AD.AttributeType.Name}]);
       DoLog('Marking attribute %s as "ChromeOnly" because attribute type "%s" is marked "ChromeOnly"',[D.Name,N{AD.AttributeType.Name}]);
     end
     end
   else if (D is TIDLFunctionDefinition) then
   else if (D is TIDLFunctionDefinition) then
@@ -3394,7 +3417,7 @@ begin
     FD:=TIDLFunctionDefinition(D);
     FD:=TIDLFunctionDefinition(D);
     RT:=GetResolvedType(FD.ReturnType,ANT,N,RN);
     RT:=GetResolvedType(FD.ReturnType,ANT,N,RN);
     isChrome:=CheckChromeOnly(RT);
     isChrome:=CheckChromeOnly(RT);
-    if isChrome then
+    if isChrome and Verbose then
       DoLog('Marking function %s as "ChromeOnly" because return type %s is marked "ChromeOnly"',[D.Name, RT.Name]);
       DoLog('Marking function %s as "ChromeOnly" because return type %s is marked "ChromeOnly"',[D.Name, RT.Name]);
     For A in FD.Arguments do
     For A in FD.Arguments do
       begin
       begin
@@ -3403,7 +3426,8 @@ begin
       if CheckChromeOnly(RT) then
       if CheckChromeOnly(RT) then
         begin
         begin
         IsChrome:=True;
         IsChrome:=True;
-        DoLog('Marking function "%s" as "ChromeOnly" because argument "%s" (type "%s") is marked "ChromeOnly"',[D.Name,A.Name, RT.Name]);
+        if Verbose then
+          DoLog('Marking function "%s" as "ChromeOnly" because argument "%s" (type "%s") is marked "ChromeOnly"',[D.Name,A.Name, RT.Name]);
         end;
         end;
       end;
       end;
     end
     end
@@ -3412,7 +3436,7 @@ begin
     FD:=TIDLCallbackDefinition(D).FunctionDef;
     FD:=TIDLCallbackDefinition(D).FunctionDef;
     RT:=GetResolvedType(FD.ReturnType,ANT,N,RN);
     RT:=GetResolvedType(FD.ReturnType,ANT,N,RN);
     isChrome:=CheckChromeOnly(RT);
     isChrome:=CheckChromeOnly(RT);
-    if isChrome then
+    if isChrome and Verbose then
       DoLog('Marking callback function %s as "ChromeOnly" because return type %s is marked "ChromeOnly"',[D.Name, RT.Name]);
       DoLog('Marking callback function %s as "ChromeOnly" because return type %s is marked "ChromeOnly"',[D.Name, RT.Name]);
     For A in FD.Arguments do
     For A in FD.Arguments do
       begin
       begin
@@ -3421,7 +3445,8 @@ begin
       if CheckChromeOnly(RT) then
       if CheckChromeOnly(RT) then
         begin
         begin
         IsChrome:=True;
         IsChrome:=True;
-        DoLog('Marking callback function %s as "ChromeOnly" because argument "%s" (type "%s") is marked "ChromeOnly"',[D.Name,A.Name, RT.Name]);
+        if Verbose then
+          DoLog('Marking callback function %s as "ChromeOnly" because argument "%s" (type "%s") is marked "ChromeOnly"',[D.Name,A.Name, RT.Name]);
         end;
         end;
       end;
       end;
     end;
     end;