2
|
1 |
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
|
2 |
// Use of this source code is governed by a BSD-style license that can be
|
|
3 |
// found in the LICENSE file.
|
|
4 |
|
|
5 |
package org.chromium.sdk;
|
|
6 |
|
|
7 |
/**
|
|
8 |
* A breakpoint in the browser JavaScript virtual machine. The {@code set*}
|
|
9 |
* method invocations will not take effect until
|
|
10 |
* {@link #flush(org.chromium.sdk.BrowserTab.BreakpointCallback)} is called.
|
|
11 |
*/
|
|
12 |
public interface Breakpoint {
|
|
13 |
|
|
14 |
/**
|
|
15 |
* Known breakpoint types.
|
|
16 |
*/
|
|
17 |
enum Type {
|
|
18 |
FUNCTION,
|
|
19 |
SCRIPT_NAME,
|
|
20 |
SCRIPT_ID
|
|
21 |
}
|
|
22 |
|
|
23 |
/**
|
|
24 |
* This value is used when the corresponding parameter is absent.
|
|
25 |
*
|
|
26 |
* @see #getIgnoreCount()
|
|
27 |
* @see #setIgnoreCount(int)
|
|
28 |
* @see BrowserTab#setBreakpoint(Type, String, int, int, boolean, String, int, org.chromium.sdk.BrowserTab.BreakpointCallback)
|
|
29 |
*/
|
|
30 |
int EMPTY_VALUE = -1;
|
|
31 |
|
|
32 |
/**
|
|
33 |
* A breakpoint has this ID if it does not reflect an actual breakpoint in a
|
|
34 |
* JavaScript VM debugger.
|
|
35 |
*/
|
|
36 |
long INVALID_ID = -1;
|
|
37 |
|
|
38 |
/**
|
|
39 |
* @return the breakpoint type
|
|
40 |
*/
|
|
41 |
Type getType();
|
|
42 |
|
|
43 |
/**
|
|
44 |
* @return the breakpoint ID as reported by the JavaScript VM debugger
|
|
45 |
*/
|
|
46 |
long getId();
|
|
47 |
|
|
48 |
/**
|
|
49 |
* @return whether this breakpoint is enabled
|
|
50 |
*/
|
|
51 |
boolean isEnabled();
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Sets whether this breakpoint is enabled.
|
|
55 |
*
|
|
56 |
* @param enabled whether the breakpoint should be enabled
|
|
57 |
*/
|
|
58 |
void setEnabled(boolean enabled);
|
|
59 |
|
|
60 |
/**
|
|
61 |
* @return ignore count for this breakpoint or {@code EMPTY_VALUE} if none
|
|
62 |
*/
|
|
63 |
int getIgnoreCount();
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Sets the ignore count for this breakpoint ({@code EMPTY_VALUE} to clear).
|
|
67 |
*
|
|
68 |
* @param ignoreCount the new ignored hits count to set
|
|
69 |
*/
|
|
70 |
void setIgnoreCount(int ignoreCount);
|
|
71 |
|
|
72 |
/**
|
|
73 |
* @return breakpoint condition as plain JavaScript or {@code null} if none
|
|
74 |
*/
|
|
75 |
String getCondition();
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Sets the breakpoint condition as plain JavaScript ({@code null} to clear).
|
|
79 |
*
|
|
80 |
* @param condition the new breakpoint condition
|
|
81 |
*/
|
|
82 |
void setCondition(String condition);
|
|
83 |
|
|
84 |
/**
|
|
85 |
* Removes the breakpoint from the JS debugger and invokes the
|
|
86 |
* callback once the operation has finished. This operation does not require
|
|
87 |
* a flush() invocation.
|
|
88 |
*
|
|
89 |
* @param callback to invoke once the operation result is available
|
|
90 |
*/
|
|
91 |
void clear(BrowserTab.BreakpointCallback callback);
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Flushes the breakpoint parameter changes (set* methods) into the browser
|
|
95 |
* and invokes the callback once the operation has finished. This method must
|
|
96 |
* be called for the set* method invocations to take effect.
|
|
97 |
*
|
|
98 |
* @param callback to invoke once the operation result is available
|
|
99 |
*/
|
|
100 |
void flush(BrowserTab.BreakpointCallback callback);
|
|
101 |
}
|