first commit
This commit is contained in:
25
node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/cdp/CdpProcessor.d.ts
generated
vendored
Normal file
25
node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/cdp/CdpProcessor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { Cdp } from '../../../protocol/protocol.js';
|
||||
import type { CdpClient, CdpConnection } from '../../BidiMapper.js';
|
||||
import type { BrowsingContextStorage } from '../context/BrowsingContextStorage.js';
|
||||
export declare class CdpProcessor {
|
||||
#private;
|
||||
constructor(browsingContextStorage: BrowsingContextStorage, cdpConnection: CdpConnection, browserCdpClient: CdpClient);
|
||||
getSession(params: Cdp.GetSessionParameters): Cdp.GetSessionResult;
|
||||
sendCommand(params: Cdp.SendCommandParameters): Promise<Cdp.SendCommandResult>;
|
||||
}
|
||||
49
node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/cdp/CdpProcessor.js
generated
vendored
Normal file
49
node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/cdp/CdpProcessor.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CdpProcessor = void 0;
|
||||
class CdpProcessor {
|
||||
#browsingContextStorage;
|
||||
#cdpConnection;
|
||||
#browserCdpClient;
|
||||
constructor(browsingContextStorage, cdpConnection, browserCdpClient) {
|
||||
this.#browsingContextStorage = browsingContextStorage;
|
||||
this.#cdpConnection = cdpConnection;
|
||||
this.#browserCdpClient = browserCdpClient;
|
||||
}
|
||||
getSession(params) {
|
||||
const context = params.context;
|
||||
const sessionId = this.#browsingContextStorage.getContext(context).cdpTarget.cdpSessionId;
|
||||
if (sessionId === undefined) {
|
||||
return {};
|
||||
}
|
||||
return { session: sessionId };
|
||||
}
|
||||
async sendCommand(params) {
|
||||
const client = params.session
|
||||
? this.#cdpConnection.getCdpClient(params.session)
|
||||
: this.#browserCdpClient;
|
||||
const result = await client.sendCommand(params.method, params.params);
|
||||
return {
|
||||
result,
|
||||
session: params.session,
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.CdpProcessor = CdpProcessor;
|
||||
//# sourceMappingURL=CdpProcessor.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/cdp/CdpProcessor.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/cdp/CdpProcessor.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CdpProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/cdp/CdpProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAMH,MAAa,YAAY;IACd,uBAAuB,CAAyB;IAChD,cAAc,CAAgB;IAC9B,iBAAiB,CAAY;IAEtC,YACE,sBAA8C,EAC9C,aAA4B,EAC5B,gBAA2B;QAE3B,IAAI,CAAC,uBAAuB,GAAG,sBAAsB,CAAC;QACtD,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,UAAU,CAAC,MAAgC;QACzC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,MAAM,SAAS,GACb,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;QAC1E,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,WAAW,CACf,MAAiC;QAEjC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO;YAC3B,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;YAClD,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACtE,OAAO;YACL,MAAM;YACN,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;IACJ,CAAC;CACF;AArCD,oCAqCC"}
|
||||
Reference in New Issue
Block a user