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 |
/**
|
|
9 |
* An objects that holds data for a "script" which is a part of a resource
|
|
10 |
* loaded into the browser, identified by its original document URL, line offset
|
|
11 |
* in the original document, and the line count this script spans.
|
|
12 |
*/
|
|
13 |
public interface Script {
|
|
14 |
|
|
15 |
/**
|
|
16 |
* Denotes a script type.
|
|
17 |
*/
|
|
18 |
enum Type {
|
|
19 |
/** A native, internal JavaScript VM script */
|
|
20 |
NATIVE,
|
|
21 |
|
|
22 |
/** A script supplied by an extension */
|
|
23 |
EXTENSION,
|
|
24 |
|
|
25 |
/** A normal user script */
|
|
26 |
NORMAL
|
|
27 |
}
|
|
28 |
|
|
29 |
/**
|
|
30 |
* @return the script type
|
|
31 |
*/
|
|
32 |
Type getType();
|
|
33 |
|
|
34 |
/**
|
|
35 |
* @return the original document URL for this script known by Chromium.
|
|
36 |
* A null name for eval'd scripts
|
|
37 |
*/
|
|
38 |
String getName();
|
|
39 |
|
|
40 |
/**
|
|
41 |
* @return the script ID as reported by the JavaScript VM debugger
|
|
42 |
*/
|
|
43 |
long getId();
|
|
44 |
|
|
45 |
/**
|
|
46 |
* @return the start line of this script in the original document
|
|
47 |
* (zero-based), inclusive
|
|
48 |
*/
|
|
49 |
int getStartLine();
|
|
50 |
|
|
51 |
/**
|
|
52 |
* @return the end line of this script in the original document (zero-based),
|
|
53 |
* inclusive
|
|
54 |
*/
|
|
55 |
int getEndLine();
|
|
56 |
|
|
57 |
/**
|
|
58 |
* @return the currently set source text of this script
|
|
59 |
*/
|
|
60 |
String getSource();
|
|
61 |
|
|
62 |
/**
|
|
63 |
* @return whether the source for this script is known
|
|
64 |
*/
|
|
65 |
boolean hasSource();
|
|
66 |
|
|
67 |
}
|