chore(webkit): remove url from Connection (#199)

This commit is contained in:
Yury Semikhatsky 2019-12-10 14:11:55 -07:00 committed by Dmitry Gozman
parent c61c5b056f
commit c9bc103a00
2 changed files with 2 additions and 8 deletions

View File

@ -30,7 +30,6 @@ export const ConnectionEvents = {
};
export class Connection extends EventEmitter {
private _url: string;
_lastId = 0;
private _callbacks = new Map<number, {resolve:(o: any) => void, reject: (e: Error) => void, error: Error, method: string}>();
private _delay: number;
@ -38,9 +37,8 @@ export class Connection extends EventEmitter {
private _sessions = new Map<string, TargetSession>();
_closed = false;
constructor(url: string, transport: ConnectionTransport, delay: number | undefined = 0) {
constructor(transport: ConnectionTransport, delay: number | undefined = 0) {
super();
this._url = url;
this._delay = delay;
this._transport = transport;
@ -52,10 +50,6 @@ export class Connection extends EventEmitter {
return session._connection;
}
url(): string {
return this._url;
}
send<T extends keyof Protocol.CommandParameters>(
method: T,
params?: Protocol.CommandParameters[T]

View File

@ -129,7 +129,7 @@ export class Launcher {
let connection: Connection | null = null;
try {
const transport = new PipeTransport(webkitProcess.stdio[3] as NodeJS.WritableStream, webkitProcess.stdio[4] as NodeJS.ReadableStream);
connection = new Connection('', transport, slowMo);
connection = new Connection(transport, slowMo);
const browser = new Browser(connection, defaultViewport, webkitProcess, gracefullyCloseWebkit);
await browser._waitForTarget(t => t._type === 'page');
return browser;