author | Eugene Ostroukhov <eugeneo@symbian.org> |
Thu, 02 Sep 2010 16:34:16 -0700 | |
changeset 486 | f0031abe2cd6 |
parent 470 | d4809db37847 |
permissions | -rw-r--r-- |
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 |
|
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
10 |
* {@link #flush(org.chromium.sdk.JavascriptVm.BreakpointCallback)} is called. |
2 | 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) |
|
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
28 |
* @see JavascriptVm#setBreakpoint |
2 | 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 |
/** |
|
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
49 |
* @return scriptName as reported by the JavaScript VM debugger; may be null |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
50 |
*/ |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
51 |
String getScriptName(); |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
52 |
|
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
53 |
/** |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
54 |
* @return scriptId as reported by the JavaScript VM debugger; may be null |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
55 |
*/ |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
56 |
Long getScriptId(); |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
57 |
|
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
58 |
/** |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
59 |
* Returns line number of the breakpoint. As source is changed (typically with LiveEdit feature, |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
60 |
* and particularly by calling {@link UpdatableScript#setSourceOnRemote}) this value |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
61 |
* may become stale. It gets updated when {@link JavascriptVm#listBreakpoints} asynchronous |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
62 |
* method completes. |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
63 |
* |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
64 |
* @return 1-based line number in script source |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
65 |
*/ |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
66 |
long getLineNumber(); |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
67 |
|
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
68 |
/** |
2 | 69 |
* @return whether this breakpoint is enabled |
70 |
*/ |
|
71 |
boolean isEnabled(); |
|
72 |
||
73 |
/** |
|
74 |
* Sets whether this breakpoint is enabled. |
|
75 |
* |
|
76 |
* @param enabled whether the breakpoint should be enabled |
|
77 |
*/ |
|
78 |
void setEnabled(boolean enabled); |
|
79 |
||
80 |
/** |
|
81 |
* @return ignore count for this breakpoint or {@code EMPTY_VALUE} if none |
|
82 |
*/ |
|
83 |
int getIgnoreCount(); |
|
84 |
||
85 |
/** |
|
86 |
* Sets the ignore count for this breakpoint ({@code EMPTY_VALUE} to clear). |
|
87 |
* |
|
88 |
* @param ignoreCount the new ignored hits count to set |
|
89 |
*/ |
|
90 |
void setIgnoreCount(int ignoreCount); |
|
91 |
||
92 |
/** |
|
93 |
* @return breakpoint condition as plain JavaScript or {@code null} if none |
|
94 |
*/ |
|
95 |
String getCondition(); |
|
96 |
||
97 |
/** |
|
98 |
* Sets the breakpoint condition as plain JavaScript ({@code null} to clear). |
|
99 |
* |
|
100 |
* @param condition the new breakpoint condition |
|
101 |
*/ |
|
102 |
void setCondition(String condition); |
|
103 |
||
104 |
/** |
|
105 |
* Removes the breakpoint from the JS debugger and invokes the |
|
106 |
* callback once the operation has finished. This operation does not require |
|
107 |
* a flush() invocation. |
|
108 |
* |
|
109 |
* @param callback to invoke once the operation result is available |
|
110 |
*/ |
|
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
111 |
void clear(JavascriptVm.BreakpointCallback callback, SyncCallback syncCallback); |
2 | 112 |
|
113 |
/** |
|
114 |
* Flushes the breakpoint parameter changes (set* methods) into the browser |
|
115 |
* and invokes the callback once the operation has finished. This method must |
|
116 |
* be called for the set* method invocations to take effect. |
|
117 |
* |
|
118 |
* @param callback to invoke once the operation result is available |
|
119 |
*/ |
|
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
120 |
void flush(JavascriptVm.BreakpointCallback callback, SyncCallback syncCallback); |
2 | 121 |
} |