Skip to content

Commit

Permalink
Bug 1881863 - Part 1: Standardize on boolean over bool in xpidl, r=xp…
Browse files Browse the repository at this point in the history
…com-reviewers,necko-reviewers,valentin,extension-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,search-reviewers,anti-tracking-reviewers,places-reviewers,nalexander,emilio,zombie,sgalich,karlt,lina,Standard8

Previously the `boolean` type was also declared using a `bool` typedef in
xpidl, meaning that both were used in various places. This patch standardizes
on the built-in `boolean` type, removing the typedef.

Differential Revision: https://phabricator.services.mozilla.com/D206382
  • Loading branch information
mystor committed Apr 4, 2024
1 parent f5cae1e commit a48079c
Show file tree
Hide file tree
Showing 116 changed files with 261 additions and 262 deletions.
4 changes: 2 additions & 2 deletions accessible/interfaces/nsIAccessibleCaretMoveEvent.idl
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ interface nsIAccessibleCaretMoveEvent: nsIAccessibleEvent
/**
* Return true if there is no selection.
*/
readonly attribute bool isSelectionCollapsed;
readonly attribute boolean isSelectionCollapsed;

/**
* Return true if the caret is at the end of a line.
*/
readonly attribute bool isAtEndOfLine;
readonly attribute boolean isAtEndOfLine;

/**
* Return caret move granularity.
Expand Down
2 changes: 1 addition & 1 deletion accessible/interfaces/nsIAccessibleMacInterface.idl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ interface nsIAccessibleMacInterface : nsISupports
* Returns true if the given attribute is settable on the object.
* Emulates `AXUIElementIsAttributeSettable`.
**/
bool isAttributeSettable(in AString attributeName);
boolean isAttributeSettable(in AString attributeName);

/**
* Sets the given attribute with the given value on the object.
Expand Down
12 changes: 6 additions & 6 deletions browser/components/shell/nsIWindowsShellService.idl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ interface nsIWindowsShellService : nsISupports
* successful or rejects with an nserror.
*/
[implicit_jscontext]
Promise pinCurrentAppToTaskbarAsync(in bool aPrivateBrowsing);
Promise pinCurrentAppToTaskbarAsync(in boolean aPrivateBrowsing);

/*
* Do a dry run of pinCurrentAppToTaskbar().
Expand All @@ -128,7 +128,7 @@ interface nsIWindowsShellService : nsISupports
* @returns same as pinCurrentAppToTaskbarAsync()
*/
[implicit_jscontext]
Promise checkPinCurrentAppToTaskbarAsync(in bool aPrivateBrowsing);
Promise checkPinCurrentAppToTaskbarAsync(in boolean aPrivateBrowsing);

/*
* Search for the current executable among taskbar pins
Expand Down Expand Up @@ -247,7 +247,7 @@ interface nsIWindowsShellService : nsISupports
AString classifyShortcut(in AString aPath);

[implicit_jscontext]
Promise hasMatchingShortcut(in AString aAUMID, in bool aPrivateBrowsing);
Promise hasMatchingShortcut(in AString aAUMID, in boolean aPrivateBrowsing);

/*
* Check if setDefaultBrowserUserChoice() is expected to succeed.
Expand All @@ -257,16 +257,16 @@ interface nsIWindowsShellService : nsISupports
*
* @return true if the check succeeds, false otherwise.
*/
bool canSetDefaultBrowserUserChoice();
boolean canSetDefaultBrowserUserChoice();

/*
* checkAllProgIDsExist() and checkBrowserUserChoiceHashes() are components
* of canSetDefaultBrowserUserChoice(), broken out for telemetry purposes.
*
* @return true if the check succeeds, false otherwise.
*/
bool checkAllProgIDsExist();
bool checkBrowserUserChoiceHashes();
boolean checkAllProgIDsExist();
boolean checkBrowserUserChoiceHashes();

/*
* Determines whether or not Firefox is the "Default Handler", i.e.,
Expand Down
4 changes: 2 additions & 2 deletions caps/nsIDomainPolicy.idl
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ interface nsIDomainSet : nsISupports
/*
* Returns true if a given domain is in the set.
*/
bool contains(in nsIURI aDomain);
boolean contains(in nsIURI aDomain);

/*
* Returns true if a given domain is a subdomain of one of the entries in
* the set.
*/
bool containsSuperDomain(in nsIURI aDomain);
boolean containsSuperDomain(in nsIURI aDomain);
};
8 changes: 4 additions & 4 deletions caps/nsIPrincipal.idl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ interface nsIPrincipal : nsISupports
* May be called from any thread.
*/

boolean equalsForPermission(in nsIPrincipal other, in bool aExactHost);
boolean equalsForPermission(in nsIPrincipal other, in boolean aExactHost);

/**
* Like equals, but takes document.domain changes into account.
Expand Down Expand Up @@ -424,7 +424,7 @@ interface nsIPrincipal : nsISupports
*
* May be called from any thread.
*/
bool allowsRelaxStrictFileOriginPolicy(in nsIURI aURI);
boolean allowsRelaxStrictFileOriginPolicy(in nsIURI aURI);


/*
Expand All @@ -433,7 +433,7 @@ interface nsIPrincipal : nsISupports
* May be called from any thread.
*/
[noscript]
ACString getPrefLightCacheKey(in nsIURI aURI ,in bool aWithCredentials,
ACString getPrefLightCacheKey(in nsIURI aURI ,in boolean aWithCredentials,
in const_OriginAttributes aOriginAttributes);


Expand All @@ -444,7 +444,7 @@ interface nsIPrincipal : nsISupports
*
* NOTE: Main-Thread Only.
*/
bool hasFirstpartyStorageAccess(in mozIDOMWindow aWindow, out uint32_t rejectedReason);
boolean hasFirstpartyStorageAccess(in mozIDOMWindow aWindow, out uint32_t rejectedReason);


/*
Expand Down
4 changes: 2 additions & 2 deletions caps/nsIScriptSecurityManager.idl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ interface nsIScriptSecurityManager : nsISupports
* prefs to be allowed to use file:// URIs.
* @param aUri the URI to be tested
*/
bool inFileURIAllowlist(in nsIURI aUri);
boolean inFileURIAllowlist(in nsIURI aUri);

///////////////// Principals ///////////////////////

Expand Down Expand Up @@ -331,7 +331,7 @@ interface nsIScriptSecurityManager : nsISupports
* of javascript.enabled. Otherwise, it returns the same value, but taking
* the various blocklist/allowlist exceptions into account.
*/
bool policyAllowsScript(in nsIURI aDomain);
boolean policyAllowsScript(in nsIURI aDomain);
};

%{C++
Expand Down
12 changes: 6 additions & 6 deletions docshell/base/nsIDocShell.idl
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ interface nsIDocShell : nsIDocShellTreeItem
* next element in the parent should be returned. Returns true if focus was
* successfully taken by the tree owner.
*/
bool tabToTreeOwner(in boolean forward, in boolean forDocumentNavigation);
boolean tabToTreeOwner(in boolean forward, in boolean forDocumentNavigation);

/**
* Current busy state for DocShell
Expand Down Expand Up @@ -522,7 +522,7 @@ interface nsIDocShell : nsIDocShellTreeItem
* @param end timestamp when reflow ended, in milliseconds since
* navigationStart (accurate to 1/1000 of a ms)
*/
[noscript] void notifyReflowObservers(in bool interruptible,
[noscript] void notifyReflowObservers(in boolean interruptible,
in DOMHighResTimeStamp start,
in DOMHighResTimeStamp end);

Expand Down Expand Up @@ -553,7 +553,7 @@ interface nsIDocShell : nsIDocShellTreeItem
* True iff asynchronous panning and zooming is enabled for this
* docshell.
*/
readonly attribute bool asyncPanZoomEnabled;
readonly attribute boolean asyncPanZoomEnabled;

/**
* Indicates whether the UI may enable the character encoding menu. The UI
Expand Down Expand Up @@ -595,8 +595,8 @@ interface nsIDocShell : nsIDocShellTreeItem
* without any actual visual representation. They have to be marked
* at construction time, to avoid any painting activity.
*/
[noscript, notxpcom] bool IsInvisible();
[noscript, notxpcom] void SetInvisible(in bool aIsInvisibleDocshell);
[noscript, notxpcom] boolean IsInvisible();
[noscript, notxpcom] void SetInvisible(in boolean aIsInvisibleDocshell);

/**
* Get the script global for the document in this docshell.
Expand Down Expand Up @@ -679,7 +679,7 @@ interface nsIDocShell : nsIDocShellTreeItem
* Returns true if the current load is a forced reload,
* e.g. started by holding shift whilst triggering reload.
*/
readonly attribute bool isForceReloading;
readonly attribute boolean isForceReloading;

Array<float> getColorMatrix();

Expand Down
2 changes: 1 addition & 1 deletion docshell/base/nsIDocShellTreeOwner.idl
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ interface nsIDocShellTreeOwner : nsISupports
Returns true if there is a primary content shell or a primary
remote tab.
*/
readonly attribute bool hasPrimaryContent;
readonly attribute boolean hasPrimaryContent;
};
2 changes: 1 addition & 1 deletion docshell/base/nsIPrivacyTransitionObserver.idl
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
[scriptable, function, uuid(b4b1449d-0ef0-47f5-b62e-adc57fd49702)]
interface nsIPrivacyTransitionObserver : nsISupports
{
void privateModeChanged(in bool enabled);
void privateModeChanged(in boolean enabled);
};
2 changes: 1 addition & 1 deletion docshell/base/nsIURIFixup.idl
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,5 @@ interface nsIURIFixup : nsISupports
*
* @param aDomain A domain name to query.
*/
bool isDomainKnown(in AUTF8String aDomain);
boolean isDomainKnown(in AUTF8String aDomain);
};
12 changes: 6 additions & 6 deletions docshell/shistory/nsISHEntry.idl
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,14 @@ interface nsISHEntry : nsISupports
in nsIURI originalURI,
in nsIURI resultPrincipalURI,
in nsIURI unstrippedURI,
in bool loadReplace,
in boolean loadReplace,
in nsIReferrerInfo referrerInfo,
in AString srcdoc,
in bool srcdocEntry,
in boolean srcdocEntry,
in nsIURI baseURI,
in bool saveLayoutState,
in bool expired,
in bool userActivation);
in boolean saveLayoutState,
in boolean expired,
in boolean userActivation);

nsISHEntry clone();

Expand Down Expand Up @@ -413,7 +413,7 @@ interface nsISHEntry : nsISupports
* Add a new child SHEntry. If offset is -1 adds to the end of the list.
*/
void AddChild(in nsISHEntry aChild, in long aOffset,
[optional,default(false)] in bool aUseRemoteSubframes);
[optional,default(false)] in boolean aUseRemoteSubframes);

/**
* Remove a child SHEntry.
Expand Down
8 changes: 4 additions & 4 deletions docshell/shistory/nsISHistory.idl
Original file line number Diff line number Diff line change
Expand Up @@ -273,19 +273,19 @@ interface nsISHistory: nsISupports

[notxpcom] void EnsureCorrectEntryAtCurrIndex(in nsISHEntry aEntry);

[notxpcom] void EvictDocumentViewersOrReplaceEntry(in nsISHEntry aNewSHEntry, in bool aReplace);
[notxpcom] void EvictDocumentViewersOrReplaceEntry(in nsISHEntry aNewSHEntry, in boolean aReplace);

nsISHEntry createEntry();

[noscript] void AddToRootSessionHistory(in bool aCloneChildren, in nsISHEntry aOSHE,
[noscript] void AddToRootSessionHistory(in boolean aCloneChildren, in nsISHEntry aOSHE,
in BrowsingContext aRootBC, in nsISHEntry aEntry,
in unsigned long aLoadType,
in bool aShouldPersist,
in boolean aShouldPersist,
out MaybeInt32 aPreviousEntryIndex,
out MaybeInt32 aLoadedEntryIndex);

[noscript] void AddChildSHEntryHelper(in nsISHEntry aCloneRef, in nsISHEntry aNewEntry,
in BrowsingContext aRootBC, in bool aCloneChildren);
in BrowsingContext aRootBC, in boolean aCloneChildren);

[noscript, notxpcom] boolean isEmptyOrHasEntriesForSingleTopLevelPage();
};
4 changes: 2 additions & 2 deletions dom/audiochannel/nsIAudioChannelAgent.idl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface nsIAudioChannelAgentCallback : nsISupports
/**
* Notified when the window volume/mute is changed
*/
void windowVolumeChanged(in float aVolume, in bool aMuted);
void windowVolumeChanged(in float aVolume, in boolean aMuted);

/**
* Notified when the window needs to be suspended or resumed.
Expand All @@ -46,7 +46,7 @@ interface nsIAudioChannelAgentCallback : nsISupports
/**
* Notified when the capture state is changed.
*/
void windowAudioCaptureChanged(in bool aCapture);
void windowAudioCaptureChanged(in boolean aCapture);
};

/**
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsIEventSourceEventService.idl
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ interface nsIEventSourceEventService : nsISupports
[must_use] void removeListener(in unsigned long long aInnerWindowID,
in nsIEventSourceEventListener aListener);

[must_use] bool hasListenerFor(in unsigned long long aInnerWindowID);
[must_use] boolean hasListenerFor(in unsigned long long aInnerWindowID);
};
2 changes: 1 addition & 1 deletion dom/base/nsIScriptableContentIterator.idl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ interface nsIScriptableContentIterator : nsISupports
readonly attribute Node currentNode;

// See ContentIteratorBase::IsDone()
readonly attribute bool isDone;
readonly attribute boolean isDone;

// See ContentIteratorBase::PositionAt(nsINode*)
void positionAt(in Node aNode);
Expand Down
12 changes: 6 additions & 6 deletions dom/bindings/nsIScriptError.idl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ interface nsIScriptError : nsIConsoleMessage
// Error created from a Promise rejection.
readonly attribute boolean isPromiseRejection;

[noscript] void initIsPromiseRejection(in bool isPromiseRejection);
[noscript] void initIsPromiseRejection(in boolean isPromiseRejection);

// The "exception" value generated when an uncaught exception is thrown
// by JavaScript. This can be any value, e.g.
Expand Down Expand Up @@ -135,8 +135,8 @@ interface nsIScriptError : nsIConsoleMessage
in uint32_t columnNumber,
in uint32_t flags,
in ACString category,
[optional] in bool fromPrivateWindow,
[optional] in bool fromChromeContext);
[optional] in boolean fromPrivateWindow,
[optional] in boolean fromChromeContext);

/* This should be called instead of nsIScriptError.init to
* initialize with a window id. The window id should be for the
Expand All @@ -158,7 +158,7 @@ interface nsIScriptError : nsIConsoleMessage
in uint32_t flags,
in ACString category,
in unsigned long long innerWindowID,
[optional] in bool fromChromeContext);
[optional] in boolean fromChromeContext);

/* This is the same function as initWithWindowID, but it expects an already
* sanitized sourceName.
Expand All @@ -172,7 +172,7 @@ interface nsIScriptError : nsIConsoleMessage
in uint32_t flags,
in ACString category,
in unsigned long long innerWindowID,
[optional] in bool fromChromeContext);
[optional] in boolean fromChromeContext);

/* This is the same function as initWithWindowID with an uri as a source parameter.
*/
Expand All @@ -184,7 +184,7 @@ interface nsIScriptError : nsIConsoleMessage
in uint32_t flags,
in ACString category,
in unsigned long long innerWindowID,
[optional] in bool fromChromeContext);
[optional] in boolean fromChromeContext);

/* Initialize the script source ID in a new error. */
void initSourceId(in uint32_t sourceId);
Expand Down
2 changes: 1 addition & 1 deletion dom/interfaces/base/nsIBrowser.idl
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ interface nsIBrowser : nsISupports
* If this method returns `true`, Gecko will assume frontend handled resuming
* the load, and will not attempt to resume the load itself.
*/
bool finishChangeRemoteness(in uint64_t aPendingSwitchId);
boolean finishChangeRemoteness(in uint64_t aPendingSwitchId);
};
Loading

0 comments on commit a48079c

Please sign in to comment.