microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/cdp-proxy/CDPMessageHandlers/baseCDPMessageHandler.ts
32lines · modeblame
259c018fYuri Skorokhodov5 years ago | 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 { Connection } from "vscode-cdp-proxy"; | |
09f6024fHeniker4 years ago | 5 | import { ICDPMessageHandler, ProcessedCDPMessage } from "./ICDPMessageHandler"; |
259c018fYuri Skorokhodov5 years ago | 6 | |
| 7 | export abstract class BaseCDPMessageHandler implements ICDPMessageHandler { | |
176f99c8ConnorQi013 months ago | 8 | protected debuggerTarget: Connection | null = null; |
| 9 | protected applicationTarget: Connection | null = null; | |
259c018fYuri Skorokhodov5 years ago | 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 | } | |
34472878RedMickey5 years ago | 32 | } |