microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/cdp-proxy/CDPMessageHandlers/baseCDPMessageHandler.ts
32lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
| 3 | |
| 4 | import { ICDPMessageHandler, ProcessedCDPMessage } from "./ICDPMessageHandler"; |
| 5 | import { Connection } from "vscode-cdp-proxy"; |
| 6 | |
| 7 | export abstract class BaseCDPMessageHandler implements ICDPMessageHandler { |
| 8 | protected debuggerTarget: Connection | null; |
| 9 | protected applicationTarget: Connection | null; |
| 10 | |
| 11 | public processDebuggerCDPMessage(event: any): ProcessedCDPMessage { |
| 12 | return { |
| 13 | event, |
| 14 | sendBack: false, |
| 15 | }; |
| 16 | } |
| 17 | |
| 18 | public processApplicationCDPMessage(event: any): ProcessedCDPMessage { |
| 19 | return { |
| 20 | event, |
| 21 | sendBack: false, |
| 22 | }; |
| 23 | } |
| 24 | |
| 25 | public setDebuggerTarget(debuggerTarget: Connection | null): void { |
| 26 | this.debuggerTarget = debuggerTarget; |
| 27 | } |
| 28 | |
| 29 | public setApplicationTarget(applicationTarget: Connection | null): void { |
| 30 | this.applicationTarget = applicationTarget; |
| 31 | } |
| 32 | } |
| 33 | |