public void disconnect() throws DebugException { if (!canDisconnect()) { return; } workspaceRelations.beforeDetach(); if (!vmEmbedder.getJavascriptVm().detach()) { ChromiumDebugPlugin.logWarning(Messages.DebugTargetImpl_BadResultWhileDisconnecting); } // This is a duplicated call to disconnected(). // The primary one comes from V8DebuggerToolHandler#onDebuggerDetached // but we want to make sure the target becomes disconnected even if // there is a browser failure and it does not respond. debugEventListener.disconnected(); }
private void initWorkspaceRelations() { ConnectedTargetData.this.workspaceRelations = debugTargetImpl .getWorkspaceBridgeFactory() .attachedToVm(ConnectedTargetData.this, vmEmbedder.getJavascriptVm()); // We'd like to know when launch is removed to remove our project. DebugPlugin.getDefault() .getLaunchManager() .addLaunchListener( new ILaunchListener() { public void launchAdded(ILaunch launch) {} public void launchChanged(ILaunch launch) {} // TODO(peter.rybin): maybe have one instance of listener for all targets? public void launchRemoved(ILaunch launch) { if (launch != debugTargetImpl.getLaunch()) { return; } DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this); workspaceRelations.launchRemoved(); } }); }