|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.browser.field2.debug.BrowserFieldDebugger
public abstract class BrowserFieldDebugger
This abstract class allows a developer to debug web content running within a BrowserField API application.
To use this functionality within your application, extends this class and override any subset of methods
in order to capture various debug information. The default implementation of each method in this class
is empty so overriding a method will have no unintended side-effects to your application. In order to
register your debugger implemenation to recieve notifications, pass it to BrowserField.setDebugger().
Use caution when setting a debugger on your BrowserField instance as it can cause significant performance
degradation.
Please note that if you are using your own implementation of BrowserFieldConnectionManager, then you must
call notifyHttpTraffic() from your class in order for your BrowserFieldDebugger to be notified of HTTP
traffic.
Field Summary | ||
---|---|---|
static int |
CONTENT_ARTWORK
Content type value for image resources being sent to registerContent() method |
|
static int |
CONTENT_CSS
Content type value for CSS resources being sent to registerContent() method |
|
static int |
CONTENT_HTML
Content type value for HTML resources being sent to registerContent() method |
|
static int |
CONTENT_JAVASCRIPT
Content type value for JavaScript resources being sent to registerContent() method |
|
static int |
CONTENT_OBJECT
Content type value for Object resources being sent to registerContent() method |
|
static int |
CONTENT_XHR
Content type value for XMLHttpRequest resources being sent to registerContent() method |
Constructor Summary | ||
---|---|---|
BrowserFieldDebugger()
|
Method Summary | ||
---|---|---|
void |
handleStep(BrowserFieldDebugContext context)
This method is invoked when the JavaScript engine has stepped to another line of code and suspended execution until it is programmatically resumed. |
|
void |
hitBreakpoint(BrowserFieldDebugContext context)
This method is invoked when a breakpoint is hit and the JavaScript engine has suspended execution until it is programmatically resumed. |
|
void |
notifyCompileError(String scriptUrl,
String errorMessage,
String scriptSource,
int lineNumber,
int character,
boolean inEval)
This method will be invoked when a JavaScript compile error occurs. |
|
void |
notifyHttpTraffic(HttpConnection connection,
Hashtable requestHeaders)
This method is invoked for each successful HTTP connection made. |
|
void |
pageCompletedLoading(String pageUrl)
This method is invoked when a page has completed loading |
|
void |
pageRequested(String url)
This method is invoked for each new page that is requested |
|
void |
registerContent(int contentType,
String url,
byte[] content)
This method is invoked when new content for a particular resource is received. |
|
void |
registerInlineScript(BrowserFieldScript script)
This method is invoked for each internal or eval'd script that is successfully compiled |
|
void |
registerScript(BrowserFieldScript script)
This method is invoked for each external script that is successfully loaded and compiled |
|
void |
reportException(BrowserFieldDebugContext context)
This method is invoked when a JavaScript runtime exception occurs. |
|
void |
resourceLoadCompleted(String pageUrl,
int contentType,
String resourceUrl,
long loadStart,
long loadEnd,
long numBytes)
This method is invoked when a resource has completely loaded and will not be receiving new content |
|
void |
xmlHttpRequestAbort(int requestId)
This method is invoked when an XMLHttpRequest (XHR) object request is aborted |
|
void |
xmlHttpRequestRequest(int requestId,
String requestUrl,
HttpHeaders headers,
String method,
String data)
This method is invoked when an XMLHttpRequest (XHR) object request is initiated from JavaScript |
|
void |
xmlHttpRequestResponse(int requestId,
String response,
int statusCode,
HttpHeaders headers)
This method is invoked when a response for an XMLHttpRequest (XHR) object request is received |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CONTENT_HTML
public static final int CONTENT_JAVASCRIPT
public static final int CONTENT_CSS
public static final int CONTENT_ARTWORK
public static final int CONTENT_XHR
public static final int CONTENT_OBJECT
Constructor Detail |
---|
public BrowserFieldDebugger()
Method Detail |
---|
public void notifyCompileError(String scriptUrl, String errorMessage, String scriptSource, int lineNumber, int character, boolean inEval)
scriptUrl
- the URL of the scripterrorMessage
- the compile error messagescriptSource
- the source of the code that failed to compilelineNumber
- the line number from the source where the failure occurredcharacter
- the character number from the source where the failure occurredinEval
- specifies whether or not this compile error occurred in an eval() method callpublic void notifyHttpTraffic(HttpConnection connection, Hashtable requestHeaders)
connection
- the HTTPConnection object containing information about the request/responserequestHeaders
- the HTTP headers used to make the initial request (response headers can
be obtained from the HTTPConnection object)public void pageRequested(String url)
url
- the URL of the newly requested pagepublic void registerScript(BrowserFieldScript script)
script
- the object containing script information and functionality to interact with
that script (e.g. to set breakpoints)public void registerInlineScript(BrowserFieldScript script)
script
- the object containing script information and functionality to interact with
that script (e.g. to set breakpoints)public void registerContent(int contentType, String url, byte[] content)
contentType
- the type of the content being receivedurl
- the url of the resource to which this content belongscontent
- a byte array of newly received contentpublic void resourceLoadCompleted(String pageUrl, int contentType, String resourceUrl, long loadStart, long loadEnd, long numBytes)
pageUrl
- the URL of the page for which this resource belongscontentType
- resourceUrl
- the URL of the resourceloadStart
- a timestamp of when this resource began loadingloadEnd
- a timestamp of when this resource finished loadingnumBytes
- the size of this resource in bytespublic void xmlHttpRequestRequest(int requestId, String requestUrl, HttpHeaders headers, String method, String data)
requestId
- the unique identifier belonging to this requestrequestUrl
- the URL of the requestheaders
- the HTTP headers used to make the initial XHR requestmethod
- the HTTP request method used (GET, POST, PUT ect)data
- the data sent in the body of the requestpublic void xmlHttpRequestAbort(int requestId)
requestId
- the unique identifier belonging to this requestpublic void xmlHttpRequestResponse(int requestId, String response, int statusCode, HttpHeaders headers)
requestId
- the unique identifier belonging to this requestresponse
- the response data recievedstatusCode
- the status of the response (AKA response code where 200 == OK)headers
- the HTTP response headers receivedpublic void pageCompletedLoading(String pageUrl)
url
- the URL of the completed pagepublic void reportException(BrowserFieldDebugContext context)
context
- the object containing information pertaining to the exception and the script
running at the time of the exceptionpublic void hitBreakpoint(BrowserFieldDebugContext context)
public void handleStep(BrowserFieldDebugContext context)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.