Home | History | Annotate | Download | only in inspector
      1 /*
      2  * Copyright (C) 2012 Google Inc. All rights reserved.
      3  *
      4  * Redistribution and use in source and binary forms, with or without
      5  * modification, are permitted provided that the following conditions are
      6  * met:
      7  *
      8  *     * Redistributions of source code must retain the above copyright
      9  * notice, this list of conditions and the following disclaimer.
     10  *     * Redistributions in binary form must reproduce the above
     11  * copyright notice, this list of conditions and the following disclaimer
     12  * in the documentation and/or other materials provided with the
     13  * distribution.
     14  *     * Neither the name of Google Inc. nor the names of its
     15  * contributors may be used to endorse or promote products derived from
     16  * this software without specific prior written permission.
     17  *
     18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29  */
     30 
     31 // WebKit Web Facing API
     32 var console = { }
     33 /** @param {...*} vararg */
     34 console.log = function(vararg) { }
     35 /** @param {...*} vararg */
     36 console.table = function(vararg) { }
     37 
     38 /**
     39  * @constructor
     40  */
     41 function InjectedScriptHostClass() { }
     42 InjectedScriptHostClass.prototype.storageId = function(object) { }
     43 InjectedScriptHostClass.prototype.getInternalProperties = function(object) { }
     44 /**
     45  * @param {Function} func
     46  */
     47 InjectedScriptHostClass.prototype.functionDetails = function(func) { }
     48 /**
     49  * @param {*} object
     50  */
     51 InjectedScriptHostClass.prototype.isHTMLAllCollection = function(object) { }
     52 /**
     53  * @param {*} object
     54  */
     55 InjectedScriptHostClass.prototype.internalConstructorName = function(object) { }
     56 /**
     57  * @param {*} object
     58  */
     59 InjectedScriptHostClass.prototype.copyText = function(object) { }
     60 InjectedScriptHostClass.prototype.clearConsoleMessages = function() { }
     61 /**
     62  * @param {number} index
     63  */
     64 InjectedScriptHostClass.prototype.inspectedObject = function(index) { }
     65 /**
     66  * @param {*} object
     67  * @return {number}
     68  */
     69 InjectedScriptHostClass.prototype.objectId = function(object) { }
     70 /**
     71  * @param {*} object
     72  */
     73 InjectedScriptHostClass.prototype.releaseObjectId = function(object) { }
     74 /**
     75  * @param {*} object
     76  */
     77 InjectedScriptHostClass.prototype.databaseId = function(object) { }
     78 /**
     79  * @param {*} object
     80  * @param {Object} hints
     81  */
     82 InjectedScriptHostClass.prototype.inspect = function(object, hints) { }
     83 /**
     84  * @param {*} object
     85  */
     86 InjectedScriptHostClass.prototype.type = function(object) { }
     87 /**
     88  * @param {*} object
     89  */
     90 InjectedScriptHostClass.prototype.getEventListeners = function(object) { }
     91 /**
     92  * @param {string} expression
     93  */
     94 InjectedScriptHostClass.prototype.evaluate = function(expression) { }
     95 /**
     96  * @param {*} fn
     97  */
     98 InjectedScriptHostClass.prototype.debugFunction = function(fn) { }
     99 /**
    100  * @param {*} fn
    101  */
    102 InjectedScriptHostClass.prototype.undebugFunction = function(fn) { }
    103 /**
    104  * @param {*} fn
    105  */
    106 InjectedScriptHostClass.prototype.monitorFunction = function(fn) { }
    107 /**
    108  * @param {*} fn
    109  */
    110 InjectedScriptHostClass.prototype.unmonitorFunction = function(fn) { }
    111 
    112 /**
    113  * @param {function(...)} fun
    114  * @param {number} scopeNumber
    115  * @param {string} variableName
    116  * @param {*} newValue
    117  */
    118 InjectedScriptHostClass.prototype.setFunctionVariableValue = function(fun, scopeNumber, variableName, newValue) { }
    119 
    120 /** @type {!InjectedScriptHostClass} */
    121 var InjectedScriptHost;
    122 /** @type {!Window} */
    123 var inspectedWindow;
    124 /** @type {number} */
    125 var injectedScriptId;
    126 
    127 /**
    128  * @constructor
    129  */
    130 function JavaScriptCallFrame()
    131 {
    132     /** @type {number} */
    133     this.sourceID;
    134     /** @type {number} */
    135     this.line;
    136     /** @type {number} */
    137     this.column;
    138     /** @type {*} */
    139     this.thisObject;
    140     /** @type {string} */
    141     this.stepInPositions;
    142 }
    143 
    144 /**
    145  * @param {number} index
    146  */
    147 JavaScriptCallFrame.prototype.scopeType = function(index) { }
    148 
    149 JavaScriptCallFrame.prototype.restart = function() { }
    150 
    151 /**
    152  * @param {number} scopeNumber
    153  * @param {string} variableName
    154  * @param {*} newValue
    155  */
    156 JavaScriptCallFrame.prototype.setVariableValue = function(scopeNumber, variableName, newValue) {}
    157 
    158 /**
    159  * @constructor
    160  */
    161 function JavaScriptFunction()
    162 {
    163     /** @type {Array} */
    164     this.rawScopes;
    165 }
    166 
    167 var InspectorBackend = { };
    168 
    169 // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
    170 /**
    171  * @constructor
    172  */
    173 function CallSite()
    174 {
    175 }
    176 /**
    177  * @return {string}
    178  */
    179 CallSite.prototype.getFileName = function() { }
    180 /**
    181  * @return {number}
    182  */
    183 CallSite.prototype.getLineNumber = function() { }
    184 /**
    185  * @return {number}
    186  */
    187 CallSite.prototype.getColumnNumber = function() { }
    188