JavascriptVm
Date: 2012-06-29

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.chromium.sdk
Interface JavascriptVm

All Known Subinterfaces:
  BrowserTab, StandaloneVm, WipJavascriptVm

    public interface JavascriptVm

Abstraction of a remote JavaScript virtual machine. Clients can use it to conduct debugging process.

See Also:
  `Browser.TabConnector.attach(org.chromium.sdk.TabDebugEventListener)`, `BrowserFactory.createStandalone(java.net.SocketAddress, org.chromium.sdk.ConnectionLogger)`, `WipBrowser.WipTabConnector.attach(TabDebugEventListener)`

Nested Class Summary
`static interface` | `JavascriptVm.BreakpointCallback` A callback for breakpoint-related requests.
`static class` | `JavascriptVm.ExceptionCatchMode` Defines when VM will break on exception throw (before stack unwind happened).
`static interface` | `JavascriptVm.ListBreakpointsCallback`
`static interface` | `JavascriptVm.ScriptsCallback` A callback for retrieving scripts.
`static interface` | `JavascriptVm.SuspendCallback` A callback for suspend request.

Method Summary
`boolean` | `detach()` Detaches from the related tab debugger.
`RelayOk` | `enableBreakpoints(java.lang.Boolean enabled, GenericCallback<java.lang.Boolean> callback, SyncCallback syncCallback)` Asynchronously enables or disables all breakpoints on remote.
`BreakpointTypeExtension` | `getBreakpointTypeExtension()`
`FunctionScopeExtension` | `getFunctionScopeExtension()`
`IgnoreCountBreakpointExtension` | `getIgnoreCountBreakpointExtension()`
`RestartFrameExtension` | `getRestartFrameExtension()`
`void` | `getScripts(JavascriptVm.ScriptsCallback callback)` Returns user scripts loaded into the tab.
`Version` | `getVersion()`
`boolean` | `isAttached()`
`RelayOk` | `listBreakpoints(JavascriptVm.ListBreakpointsCallback callback, SyncCallback syncCallback)` Asynchronously reads breakpoints from remote VM.
`RelayOk` | `setBreakOnException(JavascriptVm.ExceptionCatchMode catchMode, GenericCallback<JavascriptVm.ExceptionCatchMode> callback, SyncCallback syncCallback)` Controls whether VM stops on exceptions.
`RelayOk` | `setBreakpoint(Breakpoint.Target target, int line, int column, boolean enabled, java.lang.String condition, JavascriptVm.BreakpointCallback callback, SyncCallback syncCallback)` Sets a breakpoint with the specified parameters.
`void` | `suspend(JavascriptVm.SuspendCallback callback)` Tries to suspend VM.

Method Detail

### detach

    boolean detach()

  Detaches from the related tab debugger.

  Returns:
    whether the operation succeeded

### isAttached

    boolean isAttached()

  Returns:
    whether the tab is currently attached

### getScripts

    void getScripts(JavascriptVm.ScriptsCallback callback)
                    throws MethodIsBlockingException

  Returns user scripts loaded into the tab. May block until scripts are actually loaded.

  Some scripts could be already collected when the method is called. They can be missed in the result list.

  Parameters:
    `callback` - that synchronously receives result, may be `null`
  Throws:
    `MethodIsBlockingException` - because it may need to actually load scripts

### setBreakpoint

    RelayOk setBreakpoint(Breakpoint.Target target,
                          int line,
                          int column,
                          boolean enabled,
                          java.lang.String condition,
                          JavascriptVm.BreakpointCallback callback,
                          SyncCallback syncCallback)

  Sets a breakpoint with the specified parameters.

  Parameters:
    `target` - of the breakpoint
    `line` - in the script or function (1-based). If none, use `Breakpoint.EMPTY_VALUE`
    `column` - of the target start within the line (1-based). If none, use `Breakpoint.EMPTY_VALUE`
    `enabled` - whether the breakpoint is enabled initially
    `condition` - nullable string with breakpoint condition
    `callback` - to invoke when the evaluation result is ready, may be `null`

### suspend

    void suspend(JavascriptVm.SuspendCallback callback)

  Tries to suspend VM. If successful, `DebugEventListener.suspended(DebugContext)` will be called.

  Parameters:
    `callback` - to invoke once the operation result is available, may be `null`

### listBreakpoints

    RelayOk listBreakpoints(JavascriptVm.ListBreakpointsCallback callback,
                            SyncCallback syncCallback)

  Asynchronously reads breakpoints from remote VM. The now-effective collection of breakpoints is returned to callback. Already existing `Breakpoint` instances are preserved.

### enableBreakpoints

    RelayOk enableBreakpoints(java.lang.Boolean enabled,
                              GenericCallback<java.lang.Boolean> callback,
                              SyncCallback syncCallback)

  Asynchronously enables or disables all breakpoints on remote. 'Enabled' means that breakpoints behave as normal, 'disabled' means that VM doesn't stop on breakpoints. It doesn't update individual properties of `Breakpoint`s. Method call with a null value and not null callback simply returns current value.

  Parameters:
    `enabled` - new value to set or null
    `callback` - receives current value if succeed or error message

### setBreakOnException

    RelayOk setBreakOnException(JavascriptVm.ExceptionCatchMode catchMode,
                                GenericCallback<JavascriptVm.ExceptionCatchMode> callback,
                                SyncCallback syncCallback)

  Controls whether VM stops on exceptions. 3 catch modes are supported.

  Parameters:
    `catchMode` - new mode or null to keep the current mode
    `callback` - gets invoked when operation is finished and receives current mode as a value (may receive null if actual mode doesn't fit into `JavascriptVm.ExceptionCatchMode` type)

### getVersion

    Version getVersion()

  Returns:
    version of JavaScript VM or null if not available

### getBreakpointTypeExtension

    BreakpointTypeExtension getBreakpointTypeExtension()

  Returns:
    extension to standard breakpoint target types

### getIgnoreCountBreakpointExtension

    IgnoreCountBreakpointExtension getIgnoreCountBreakpointExtension()

  Returns:
    extension that supports ignore count property of breakpoint or null if unsupported by VM

### getFunctionScopeExtension

    FunctionScopeExtension getFunctionScopeExtension()

  Returns:
    extension that returns function hidden scopes or null if unsupported by VM

### getRestartFrameExtension

    RestartFrameExtension getRestartFrameExtension()

  Returns:
    extension that restarts frame or null if unsupported by VM

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD