chore(wk): make _connection private to session (#357)

This commit is contained in:
Yury Semikhatsky 2020-01-02 17:04:51 -08:00 committed by GitHub
parent 84e9ef08b1
commit ebd11fe380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,10 +45,6 @@ export class WKConnection extends EventEmitter {
this._transport.onclose = this._onClose.bind(this); this._transport.onclose = this._onClose.bind(this);
} }
static fromSession(session: WKTargetSession): WKConnection {
return session._connection;
}
send<T extends keyof Protocol.CommandParameters>( send<T extends keyof Protocol.CommandParameters>(
method: T, method: T,
params?: Protocol.CommandParameters[T] params?: Protocol.CommandParameters[T]
@ -150,7 +146,7 @@ export const WKTargetSessionEvents = {
}; };
export class WKTargetSession extends EventEmitter { export class WKTargetSession extends EventEmitter {
_connection: WKConnection; private _connection: WKConnection;
private _callbacks = new Map<number, {resolve:(o: any) => void, reject: (e: Error) => void, error: Error, method: string}>(); private _callbacks = new Map<number, {resolve:(o: any) => void, reject: (e: Error) => void, error: Error, method: string}>();
private _targetType: string; private _targetType: string;
_sessionId: string; _sessionId: string;