Skip to content

Commit

Permalink
refactor: rename contextId
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Jan 29, 2025
1 parent cf38e3f commit 49efdcb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/bidiMapper/modules/session/SubscriptionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class SubscriptionManager {
#isSubscribedTo(
subscription: Subscription,
moduleOrEvent: ChromiumBidi.EventNames,
contextId?: BrowsingContext.BrowsingContext,
browsingContextId?: BrowsingContext.BrowsingContext,
): boolean {
let includesEvent = false;
for (const eventName of subscription.eventNames) {
Expand All @@ -161,11 +161,12 @@ export class SubscriptionManager {

// user context subscription.
if (subscription.userContextIds.size !== 0) {
if (!contextId) {
if (!browsingContextId) {
return false;
}

const context = this.#browsingContextStorage.findContext(contextId);
const context =
this.#browsingContextStorage.findContext(browsingContextId);
if (!context) {
return false;
}
Expand All @@ -174,11 +175,11 @@ export class SubscriptionManager {

// context subscription.
if (subscription.topLevelTraversableIds.size !== 0) {
if (!contextId) {
if (!browsingContextId) {
return false;
}
const topLevelContext =
this.#browsingContextStorage.findTopLevelContextId(contextId);
this.#browsingContextStorage.findTopLevelContextId(browsingContextId);
return (
topLevelContext !== null &&
subscription.topLevelTraversableIds.has(topLevelContext)
Expand Down

0 comments on commit 49efdcb

Please sign in to comment.