|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Library General Public |
|
7 License as published by the Free Software Foundation; either |
|
8 version 2 of the License, or (at your option) any later version. |
|
9 |
|
10 This library is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 Library General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU Library General Public License |
|
16 along with this library; see the file COPYING.LIB. If not, write to |
|
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #include "config.h" |
|
22 |
|
23 #if ENABLE(INSPECTOR) |
|
24 |
|
25 #include "JSInspectorBackend.h" |
|
26 |
|
27 #include "InspectorBackend.h" |
|
28 #include <runtime/Error.h> |
|
29 #include <wtf/GetPtr.h> |
|
30 |
|
31 using namespace JSC; |
|
32 |
|
33 namespace WebCore { |
|
34 |
|
35 ASSERT_CLASS_FITS_IN_CELL(JSInspectorBackend); |
|
36 |
|
37 /* Hash table */ |
|
38 #if ENABLE(JIT) |
|
39 #define THUNK_GENERATOR(generator) , generator |
|
40 #else |
|
41 #define THUNK_GENERATOR(generator) |
|
42 #endif |
|
43 |
|
44 static const HashTableValue JSInspectorBackendTableValues[2] = |
|
45 { |
|
46 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsInspectorBackendConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
48 }; |
|
49 |
|
50 #undef THUNK_GENERATOR |
|
51 static JSC_CONST_HASHTABLE HashTable JSInspectorBackendTable = { 2, 1, JSInspectorBackendTableValues, 0 }; |
|
52 /* Hash table for constructor */ |
|
53 #if ENABLE(JIT) |
|
54 #define THUNK_GENERATOR(generator) , generator |
|
55 #else |
|
56 #define THUNK_GENERATOR(generator) |
|
57 #endif |
|
58 |
|
59 static const HashTableValue JSInspectorBackendConstructorTableValues[1] = |
|
60 { |
|
61 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
62 }; |
|
63 |
|
64 #undef THUNK_GENERATOR |
|
65 static JSC_CONST_HASHTABLE HashTable JSInspectorBackendConstructorTable = { 1, 0, JSInspectorBackendConstructorTableValues, 0 }; |
|
66 class JSInspectorBackendConstructor : public DOMConstructorObject { |
|
67 public: |
|
68 JSInspectorBackendConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
69 |
|
70 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
71 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
72 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
73 static const JSC::ClassInfo s_info; |
|
74 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
75 { |
|
76 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
77 } |
|
78 protected: |
|
79 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
80 }; |
|
81 |
|
82 const ClassInfo JSInspectorBackendConstructor::s_info = { "InspectorBackendConstructor", 0, &JSInspectorBackendConstructorTable, 0 }; |
|
83 |
|
84 JSInspectorBackendConstructor::JSInspectorBackendConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
85 : DOMConstructorObject(JSInspectorBackendConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
86 { |
|
87 putDirect(exec->propertyNames().prototype, JSInspectorBackendPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
88 } |
|
89 |
|
90 bool JSInspectorBackendConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
91 { |
|
92 return getStaticValueSlot<JSInspectorBackendConstructor, DOMObject>(exec, &JSInspectorBackendConstructorTable, this, propertyName, slot); |
|
93 } |
|
94 |
|
95 bool JSInspectorBackendConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
96 { |
|
97 return getStaticValueDescriptor<JSInspectorBackendConstructor, DOMObject>(exec, &JSInspectorBackendConstructorTable, this, propertyName, descriptor); |
|
98 } |
|
99 |
|
100 /* Hash table for prototype */ |
|
101 #if ENABLE(JIT) |
|
102 #define THUNK_GENERATOR(generator) , generator |
|
103 #else |
|
104 #define THUNK_GENERATOR(generator) |
|
105 #endif |
|
106 |
|
107 static const HashTableValue JSInspectorBackendPrototypeTableValues[79] = |
|
108 { |
|
109 { "storeLastActivePanel", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionStoreLastActivePanel), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
110 { "saveApplicationSettings", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSaveApplicationSettings), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
111 { "saveSessionSettings", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSaveSessionSettings), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
112 { "enableSearchingForNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionEnableSearchingForNode), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
113 { "disableSearchingForNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionDisableSearchingForNode), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
114 { "enableMonitoringXHR", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionEnableMonitoringXHR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
115 { "disableMonitoringXHR", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionDisableMonitoringXHR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
116 { "enableResourceTracking", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionEnableResourceTracking), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
117 { "disableResourceTracking", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionDisableResourceTracking), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
118 { "getResourceContent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetResourceContent), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
119 { "reloadPage", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionReloadPage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
120 { "startTimelineProfiler", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionStartTimelineProfiler), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
121 { "stopTimelineProfiler", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionStopTimelineProfiler), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
122 { "enableDebugger", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionEnableDebugger), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
123 { "disableDebugger", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionDisableDebugger), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
124 { "setBreakpoint", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetBreakpoint), (intptr_t)5 THUNK_GENERATOR(0) }, |
|
125 { "removeBreakpoint", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionRemoveBreakpoint), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
126 { "activateBreakpoints", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionActivateBreakpoints), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
127 { "deactivateBreakpoints", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionDeactivateBreakpoints), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
128 { "pause", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionPause), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
129 { "resume", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionResume), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
130 { "stepOverStatement", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionStepOverStatement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
131 { "stepIntoStatement", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionStepIntoStatement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
132 { "stepOutOfFunction", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionStepOutOfFunction), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
133 { "setPauseOnExceptionsState", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetPauseOnExceptionsState), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
134 { "editScriptSource", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionEditScriptSource), (intptr_t)3 THUNK_GENERATOR(0) }, |
|
135 { "getScriptSource", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetScriptSource), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
136 { "enableProfiler", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionEnableProfiler), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
137 { "disableProfiler", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionDisableProfiler), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
138 { "startProfiling", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionStartProfiling), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
139 { "stopProfiling", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionStopProfiling), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
140 { "getProfileHeaders", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetProfileHeaders), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
141 { "getProfile", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetProfile), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
142 { "removeProfile", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionRemoveProfile), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
143 { "clearProfiles", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionClearProfiles), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
144 { "takeHeapSnapshot", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionTakeHeapSnapshot), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
145 { "setInjectedScriptSource", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetInjectedScriptSource), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
146 { "dispatchOnInjectedScript", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionDispatchOnInjectedScript), (intptr_t)5 THUNK_GENERATOR(0) }, |
|
147 { "addScriptToEvaluateOnLoad", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionAddScriptToEvaluateOnLoad), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
148 { "removeAllScriptsToEvaluateOnLoad", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionRemoveAllScriptsToEvaluateOnLoad), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
149 { "getChildNodes", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetChildNodes), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
150 { "setAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetAttribute), (intptr_t)4 THUNK_GENERATOR(0) }, |
|
151 { "removeAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionRemoveAttribute), (intptr_t)3 THUNK_GENERATOR(0) }, |
|
152 { "setTextNodeValue", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetTextNodeValue), (intptr_t)3 THUNK_GENERATOR(0) }, |
|
153 { "getEventListenersForNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetEventListenersForNode), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
154 { "copyNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionCopyNode), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
155 { "removeNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionRemoveNode), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
156 { "changeTagName", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionChangeTagName), (intptr_t)3 THUNK_GENERATOR(0) }, |
|
157 { "getOuterHTML", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetOuterHTML), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
158 { "setOuterHTML", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetOuterHTML), (intptr_t)3 THUNK_GENERATOR(0) }, |
|
159 { "addInspectedNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionAddInspectedNode), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
160 { "performSearch", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionPerformSearch), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
161 { "searchCanceled", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSearchCanceled), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
162 { "pushNodeByPathToFrontend", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionPushNodeByPathToFrontend), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
163 { "clearConsoleMessages", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionClearConsoleMessages), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
164 { "highlightDOMNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionHighlightDOMNode), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
165 { "hideDOMNodeHighlight", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionHideDOMNodeHighlight), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
166 { "getStyles", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetStyles), (intptr_t)3 THUNK_GENERATOR(0) }, |
|
167 { "getAllStyles", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetAllStyles), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
168 { "getInlineStyle", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetInlineStyle), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
169 { "getComputedStyle", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetComputedStyle), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
170 { "getStyleSheet", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetStyleSheet), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
171 { "getRuleRangesForStyleSheetId", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetRuleRangesForStyleSheetId), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
172 { "applyStyleText", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionApplyStyleText), (intptr_t)4 THUNK_GENERATOR(0) }, |
|
173 { "setStyleText", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetStyleText), (intptr_t)3 THUNK_GENERATOR(0) }, |
|
174 { "setStyleProperty", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetStyleProperty), (intptr_t)4 THUNK_GENERATOR(0) }, |
|
175 { "toggleStyleEnabled", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionToggleStyleEnabled), (intptr_t)4 THUNK_GENERATOR(0) }, |
|
176 { "setRuleSelector", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetRuleSelector), (intptr_t)4 THUNK_GENERATOR(0) }, |
|
177 { "addRule", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionAddRule), (intptr_t)3 THUNK_GENERATOR(0) }, |
|
178 { "getCookies", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetCookies), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
179 { "deleteCookie", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionDeleteCookie), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
180 { "getApplicationCaches", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetApplicationCaches), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
181 { "releaseWrapperObjectGroup", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionReleaseWrapperObjectGroup), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
182 { "didEvaluateForTestInFrontend", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionDidEvaluateForTestInFrontend), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
183 { "getDatabaseTableNames", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetDatabaseTableNames), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
184 { "getDOMStorageEntries", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionGetDOMStorageEntries), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
185 { "setDOMStorageItem", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionSetDOMStorageItem), (intptr_t)4 THUNK_GENERATOR(0) }, |
|
186 { "removeDOMStorageItem", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsInspectorBackendPrototypeFunctionRemoveDOMStorageItem), (intptr_t)3 THUNK_GENERATOR(0) }, |
|
187 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
188 }; |
|
189 |
|
190 #undef THUNK_GENERATOR |
|
191 static JSC_CONST_HASHTABLE HashTable JSInspectorBackendPrototypeTable = { 263, 255, JSInspectorBackendPrototypeTableValues, 0 }; |
|
192 const ClassInfo JSInspectorBackendPrototype::s_info = { "InspectorBackendPrototype", 0, &JSInspectorBackendPrototypeTable, 0 }; |
|
193 |
|
194 JSObject* JSInspectorBackendPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
195 { |
|
196 return getDOMPrototype<JSInspectorBackend>(exec, globalObject); |
|
197 } |
|
198 |
|
199 bool JSInspectorBackendPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
200 { |
|
201 return getStaticFunctionSlot<JSObject>(exec, &JSInspectorBackendPrototypeTable, this, propertyName, slot); |
|
202 } |
|
203 |
|
204 bool JSInspectorBackendPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
205 { |
|
206 return getStaticFunctionDescriptor<JSObject>(exec, &JSInspectorBackendPrototypeTable, this, propertyName, descriptor); |
|
207 } |
|
208 |
|
209 const ClassInfo JSInspectorBackend::s_info = { "InspectorBackend", 0, &JSInspectorBackendTable, 0 }; |
|
210 |
|
211 JSInspectorBackend::JSInspectorBackend(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<InspectorBackend> impl) |
|
212 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
213 , m_impl(impl) |
|
214 { |
|
215 } |
|
216 |
|
217 JSInspectorBackend::~JSInspectorBackend() |
|
218 { |
|
219 forgetDOMObject(this, impl()); |
|
220 } |
|
221 |
|
222 JSObject* JSInspectorBackend::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
223 { |
|
224 return new (exec) JSInspectorBackendPrototype(globalObject, JSInspectorBackendPrototype::createStructure(globalObject->objectPrototype())); |
|
225 } |
|
226 |
|
227 bool JSInspectorBackend::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
228 { |
|
229 return getStaticValueSlot<JSInspectorBackend, Base>(exec, &JSInspectorBackendTable, this, propertyName, slot); |
|
230 } |
|
231 |
|
232 bool JSInspectorBackend::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
233 { |
|
234 return getStaticValueDescriptor<JSInspectorBackend, Base>(exec, &JSInspectorBackendTable, this, propertyName, descriptor); |
|
235 } |
|
236 |
|
237 JSValue jsInspectorBackendConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
238 { |
|
239 JSInspectorBackend* domObject = static_cast<JSInspectorBackend*>(asObject(slotBase)); |
|
240 return JSInspectorBackend::getConstructor(exec, domObject->globalObject()); |
|
241 } |
|
242 JSValue JSInspectorBackend::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
243 { |
|
244 return getDOMConstructor<JSInspectorBackendConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
245 } |
|
246 |
|
247 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionStoreLastActivePanel(ExecState* exec) |
|
248 { |
|
249 JSValue thisValue = exec->hostThisValue(); |
|
250 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
251 return throwVMTypeError(exec); |
|
252 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
253 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
254 const String& panelName = ustringToString(exec->argument(0).toString(exec)); |
|
255 |
|
256 imp->storeLastActivePanel(panelName); |
|
257 return JSValue::encode(jsUndefined()); |
|
258 } |
|
259 |
|
260 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSaveApplicationSettings(ExecState* exec) |
|
261 { |
|
262 JSValue thisValue = exec->hostThisValue(); |
|
263 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
264 return throwVMTypeError(exec); |
|
265 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
266 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
267 const String& settings = ustringToString(exec->argument(0).toString(exec)); |
|
268 |
|
269 imp->saveApplicationSettings(settings); |
|
270 return JSValue::encode(jsUndefined()); |
|
271 } |
|
272 |
|
273 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSaveSessionSettings(ExecState* exec) |
|
274 { |
|
275 JSValue thisValue = exec->hostThisValue(); |
|
276 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
277 return throwVMTypeError(exec); |
|
278 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
279 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
280 const String& settings = ustringToString(exec->argument(0).toString(exec)); |
|
281 |
|
282 imp->saveSessionSettings(settings); |
|
283 return JSValue::encode(jsUndefined()); |
|
284 } |
|
285 |
|
286 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionEnableSearchingForNode(ExecState* exec) |
|
287 { |
|
288 JSValue thisValue = exec->hostThisValue(); |
|
289 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
290 return throwVMTypeError(exec); |
|
291 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
292 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
293 |
|
294 imp->enableSearchingForNode(); |
|
295 return JSValue::encode(jsUndefined()); |
|
296 } |
|
297 |
|
298 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionDisableSearchingForNode(ExecState* exec) |
|
299 { |
|
300 JSValue thisValue = exec->hostThisValue(); |
|
301 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
302 return throwVMTypeError(exec); |
|
303 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
304 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
305 |
|
306 imp->disableSearchingForNode(); |
|
307 return JSValue::encode(jsUndefined()); |
|
308 } |
|
309 |
|
310 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionEnableMonitoringXHR(ExecState* exec) |
|
311 { |
|
312 JSValue thisValue = exec->hostThisValue(); |
|
313 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
314 return throwVMTypeError(exec); |
|
315 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
316 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
317 |
|
318 imp->enableMonitoringXHR(); |
|
319 return JSValue::encode(jsUndefined()); |
|
320 } |
|
321 |
|
322 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionDisableMonitoringXHR(ExecState* exec) |
|
323 { |
|
324 JSValue thisValue = exec->hostThisValue(); |
|
325 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
326 return throwVMTypeError(exec); |
|
327 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
328 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
329 |
|
330 imp->disableMonitoringXHR(); |
|
331 return JSValue::encode(jsUndefined()); |
|
332 } |
|
333 |
|
334 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionEnableResourceTracking(ExecState* exec) |
|
335 { |
|
336 JSValue thisValue = exec->hostThisValue(); |
|
337 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
338 return throwVMTypeError(exec); |
|
339 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
340 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
341 bool always = exec->argument(0).toBoolean(exec); |
|
342 |
|
343 imp->enableResourceTracking(always); |
|
344 return JSValue::encode(jsUndefined()); |
|
345 } |
|
346 |
|
347 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionDisableResourceTracking(ExecState* exec) |
|
348 { |
|
349 JSValue thisValue = exec->hostThisValue(); |
|
350 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
351 return throwVMTypeError(exec); |
|
352 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
353 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
354 bool always = exec->argument(0).toBoolean(exec); |
|
355 |
|
356 imp->disableResourceTracking(always); |
|
357 return JSValue::encode(jsUndefined()); |
|
358 } |
|
359 |
|
360 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetResourceContent(ExecState* exec) |
|
361 { |
|
362 JSValue thisValue = exec->hostThisValue(); |
|
363 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
364 return throwVMTypeError(exec); |
|
365 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
366 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
367 int callId = exec->argument(0).toInt32(exec); |
|
368 unsigned identifier = exec->argument(1).toInt32(exec); |
|
369 |
|
370 imp->getResourceContent(callId, identifier); |
|
371 return JSValue::encode(jsUndefined()); |
|
372 } |
|
373 |
|
374 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionReloadPage(ExecState* exec) |
|
375 { |
|
376 JSValue thisValue = exec->hostThisValue(); |
|
377 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
378 return throwVMTypeError(exec); |
|
379 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
380 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
381 |
|
382 imp->reloadPage(); |
|
383 return JSValue::encode(jsUndefined()); |
|
384 } |
|
385 |
|
386 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionStartTimelineProfiler(ExecState* exec) |
|
387 { |
|
388 JSValue thisValue = exec->hostThisValue(); |
|
389 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
390 return throwVMTypeError(exec); |
|
391 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
392 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
393 |
|
394 imp->startTimelineProfiler(); |
|
395 return JSValue::encode(jsUndefined()); |
|
396 } |
|
397 |
|
398 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionStopTimelineProfiler(ExecState* exec) |
|
399 { |
|
400 JSValue thisValue = exec->hostThisValue(); |
|
401 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
402 return throwVMTypeError(exec); |
|
403 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
404 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
405 |
|
406 imp->stopTimelineProfiler(); |
|
407 return JSValue::encode(jsUndefined()); |
|
408 } |
|
409 |
|
410 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionEnableDebugger(ExecState* exec) |
|
411 { |
|
412 JSValue thisValue = exec->hostThisValue(); |
|
413 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
414 return throwVMTypeError(exec); |
|
415 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
416 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
417 bool always = exec->argument(0).toBoolean(exec); |
|
418 |
|
419 imp->enableDebugger(always); |
|
420 return JSValue::encode(jsUndefined()); |
|
421 } |
|
422 |
|
423 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionDisableDebugger(ExecState* exec) |
|
424 { |
|
425 JSValue thisValue = exec->hostThisValue(); |
|
426 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
427 return throwVMTypeError(exec); |
|
428 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
429 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
430 bool always = exec->argument(0).toBoolean(exec); |
|
431 |
|
432 imp->disableDebugger(always); |
|
433 return JSValue::encode(jsUndefined()); |
|
434 } |
|
435 |
|
436 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetBreakpoint(ExecState* exec) |
|
437 { |
|
438 JSValue thisValue = exec->hostThisValue(); |
|
439 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
440 return throwVMTypeError(exec); |
|
441 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
442 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
443 int callId = exec->argument(0).toInt32(exec); |
|
444 const String& sourceID = ustringToString(exec->argument(1).toString(exec)); |
|
445 unsigned lineNumber = exec->argument(2).toInt32(exec); |
|
446 bool enabled = exec->argument(3).toBoolean(exec); |
|
447 const String& condition = ustringToString(exec->argument(4).toString(exec)); |
|
448 |
|
449 imp->setBreakpoint(callId, sourceID, lineNumber, enabled, condition); |
|
450 return JSValue::encode(jsUndefined()); |
|
451 } |
|
452 |
|
453 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionRemoveBreakpoint(ExecState* exec) |
|
454 { |
|
455 JSValue thisValue = exec->hostThisValue(); |
|
456 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
457 return throwVMTypeError(exec); |
|
458 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
459 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
460 const String& sourceID = ustringToString(exec->argument(0).toString(exec)); |
|
461 unsigned lineNumber = exec->argument(1).toInt32(exec); |
|
462 |
|
463 imp->removeBreakpoint(sourceID, lineNumber); |
|
464 return JSValue::encode(jsUndefined()); |
|
465 } |
|
466 |
|
467 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionActivateBreakpoints(ExecState* exec) |
|
468 { |
|
469 JSValue thisValue = exec->hostThisValue(); |
|
470 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
471 return throwVMTypeError(exec); |
|
472 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
473 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
474 |
|
475 imp->activateBreakpoints(); |
|
476 return JSValue::encode(jsUndefined()); |
|
477 } |
|
478 |
|
479 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionDeactivateBreakpoints(ExecState* exec) |
|
480 { |
|
481 JSValue thisValue = exec->hostThisValue(); |
|
482 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
483 return throwVMTypeError(exec); |
|
484 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
485 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
486 |
|
487 imp->deactivateBreakpoints(); |
|
488 return JSValue::encode(jsUndefined()); |
|
489 } |
|
490 |
|
491 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionPause(ExecState* exec) |
|
492 { |
|
493 JSValue thisValue = exec->hostThisValue(); |
|
494 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
495 return throwVMTypeError(exec); |
|
496 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
497 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
498 |
|
499 imp->pause(); |
|
500 return JSValue::encode(jsUndefined()); |
|
501 } |
|
502 |
|
503 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionResume(ExecState* exec) |
|
504 { |
|
505 JSValue thisValue = exec->hostThisValue(); |
|
506 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
507 return throwVMTypeError(exec); |
|
508 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
509 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
510 |
|
511 imp->resume(); |
|
512 return JSValue::encode(jsUndefined()); |
|
513 } |
|
514 |
|
515 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionStepOverStatement(ExecState* exec) |
|
516 { |
|
517 JSValue thisValue = exec->hostThisValue(); |
|
518 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
519 return throwVMTypeError(exec); |
|
520 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
521 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
522 |
|
523 imp->stepOverStatement(); |
|
524 return JSValue::encode(jsUndefined()); |
|
525 } |
|
526 |
|
527 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionStepIntoStatement(ExecState* exec) |
|
528 { |
|
529 JSValue thisValue = exec->hostThisValue(); |
|
530 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
531 return throwVMTypeError(exec); |
|
532 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
533 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
534 |
|
535 imp->stepIntoStatement(); |
|
536 return JSValue::encode(jsUndefined()); |
|
537 } |
|
538 |
|
539 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionStepOutOfFunction(ExecState* exec) |
|
540 { |
|
541 JSValue thisValue = exec->hostThisValue(); |
|
542 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
543 return throwVMTypeError(exec); |
|
544 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
545 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
546 |
|
547 imp->stepOutOfFunction(); |
|
548 return JSValue::encode(jsUndefined()); |
|
549 } |
|
550 |
|
551 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetPauseOnExceptionsState(ExecState* exec) |
|
552 { |
|
553 JSValue thisValue = exec->hostThisValue(); |
|
554 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
555 return throwVMTypeError(exec); |
|
556 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
557 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
558 int pauseOnExceptionsState = exec->argument(0).toInt32(exec); |
|
559 |
|
560 imp->setPauseOnExceptionsState(pauseOnExceptionsState); |
|
561 return JSValue::encode(jsUndefined()); |
|
562 } |
|
563 |
|
564 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionEditScriptSource(ExecState* exec) |
|
565 { |
|
566 JSValue thisValue = exec->hostThisValue(); |
|
567 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
568 return throwVMTypeError(exec); |
|
569 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
570 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
571 int callId = exec->argument(0).toInt32(exec); |
|
572 const String& sourceID = ustringToString(exec->argument(1).toString(exec)); |
|
573 const String& newContent = ustringToString(exec->argument(2).toString(exec)); |
|
574 |
|
575 imp->editScriptSource(callId, sourceID, newContent); |
|
576 return JSValue::encode(jsUndefined()); |
|
577 } |
|
578 |
|
579 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetScriptSource(ExecState* exec) |
|
580 { |
|
581 JSValue thisValue = exec->hostThisValue(); |
|
582 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
583 return throwVMTypeError(exec); |
|
584 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
585 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
586 int callId = exec->argument(0).toInt32(exec); |
|
587 const String& sourceID = ustringToString(exec->argument(1).toString(exec)); |
|
588 |
|
589 imp->getScriptSource(callId, sourceID); |
|
590 return JSValue::encode(jsUndefined()); |
|
591 } |
|
592 |
|
593 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionEnableProfiler(ExecState* exec) |
|
594 { |
|
595 JSValue thisValue = exec->hostThisValue(); |
|
596 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
597 return throwVMTypeError(exec); |
|
598 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
599 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
600 bool always = exec->argument(0).toBoolean(exec); |
|
601 |
|
602 imp->enableProfiler(always); |
|
603 return JSValue::encode(jsUndefined()); |
|
604 } |
|
605 |
|
606 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionDisableProfiler(ExecState* exec) |
|
607 { |
|
608 JSValue thisValue = exec->hostThisValue(); |
|
609 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
610 return throwVMTypeError(exec); |
|
611 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
612 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
613 bool always = exec->argument(0).toBoolean(exec); |
|
614 |
|
615 imp->disableProfiler(always); |
|
616 return JSValue::encode(jsUndefined()); |
|
617 } |
|
618 |
|
619 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionStartProfiling(ExecState* exec) |
|
620 { |
|
621 JSValue thisValue = exec->hostThisValue(); |
|
622 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
623 return throwVMTypeError(exec); |
|
624 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
625 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
626 |
|
627 imp->startProfiling(); |
|
628 return JSValue::encode(jsUndefined()); |
|
629 } |
|
630 |
|
631 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionStopProfiling(ExecState* exec) |
|
632 { |
|
633 JSValue thisValue = exec->hostThisValue(); |
|
634 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
635 return throwVMTypeError(exec); |
|
636 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
637 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
638 |
|
639 imp->stopProfiling(); |
|
640 return JSValue::encode(jsUndefined()); |
|
641 } |
|
642 |
|
643 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetProfileHeaders(ExecState* exec) |
|
644 { |
|
645 JSValue thisValue = exec->hostThisValue(); |
|
646 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
647 return throwVMTypeError(exec); |
|
648 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
649 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
650 int callId = exec->argument(0).toInt32(exec); |
|
651 |
|
652 imp->getProfileHeaders(callId); |
|
653 return JSValue::encode(jsUndefined()); |
|
654 } |
|
655 |
|
656 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetProfile(ExecState* exec) |
|
657 { |
|
658 JSValue thisValue = exec->hostThisValue(); |
|
659 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
660 return throwVMTypeError(exec); |
|
661 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
662 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
663 int callId = exec->argument(0).toInt32(exec); |
|
664 unsigned uid = exec->argument(1).toInt32(exec); |
|
665 |
|
666 imp->getProfile(callId, uid); |
|
667 return JSValue::encode(jsUndefined()); |
|
668 } |
|
669 |
|
670 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionRemoveProfile(ExecState* exec) |
|
671 { |
|
672 JSValue thisValue = exec->hostThisValue(); |
|
673 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
674 return throwVMTypeError(exec); |
|
675 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
676 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
677 unsigned uid = exec->argument(0).toInt32(exec); |
|
678 |
|
679 imp->removeProfile(uid); |
|
680 return JSValue::encode(jsUndefined()); |
|
681 } |
|
682 |
|
683 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionClearProfiles(ExecState* exec) |
|
684 { |
|
685 JSValue thisValue = exec->hostThisValue(); |
|
686 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
687 return throwVMTypeError(exec); |
|
688 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
689 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
690 |
|
691 imp->clearProfiles(); |
|
692 return JSValue::encode(jsUndefined()); |
|
693 } |
|
694 |
|
695 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionTakeHeapSnapshot(ExecState* exec) |
|
696 { |
|
697 JSValue thisValue = exec->hostThisValue(); |
|
698 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
699 return throwVMTypeError(exec); |
|
700 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
701 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
702 |
|
703 imp->takeHeapSnapshot(); |
|
704 return JSValue::encode(jsUndefined()); |
|
705 } |
|
706 |
|
707 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetInjectedScriptSource(ExecState* exec) |
|
708 { |
|
709 JSValue thisValue = exec->hostThisValue(); |
|
710 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
711 return throwVMTypeError(exec); |
|
712 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
713 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
714 const String& scriptSource = ustringToString(exec->argument(0).toString(exec)); |
|
715 |
|
716 imp->setInjectedScriptSource(scriptSource); |
|
717 return JSValue::encode(jsUndefined()); |
|
718 } |
|
719 |
|
720 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionDispatchOnInjectedScript(ExecState* exec) |
|
721 { |
|
722 JSValue thisValue = exec->hostThisValue(); |
|
723 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
724 return throwVMTypeError(exec); |
|
725 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
726 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
727 int callId = exec->argument(0).toInt32(exec); |
|
728 int injectedScriptId = exec->argument(1).toInt32(exec); |
|
729 const String& methodName = ustringToString(exec->argument(2).toString(exec)); |
|
730 const String& arguments = ustringToString(exec->argument(3).toString(exec)); |
|
731 bool async = exec->argument(4).toBoolean(exec); |
|
732 |
|
733 imp->dispatchOnInjectedScript(callId, injectedScriptId, methodName, arguments, async); |
|
734 return JSValue::encode(jsUndefined()); |
|
735 } |
|
736 |
|
737 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionAddScriptToEvaluateOnLoad(ExecState* exec) |
|
738 { |
|
739 JSValue thisValue = exec->hostThisValue(); |
|
740 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
741 return throwVMTypeError(exec); |
|
742 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
743 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
744 const String& scriptSource = ustringToString(exec->argument(0).toString(exec)); |
|
745 |
|
746 imp->addScriptToEvaluateOnLoad(scriptSource); |
|
747 return JSValue::encode(jsUndefined()); |
|
748 } |
|
749 |
|
750 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionRemoveAllScriptsToEvaluateOnLoad(ExecState* exec) |
|
751 { |
|
752 JSValue thisValue = exec->hostThisValue(); |
|
753 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
754 return throwVMTypeError(exec); |
|
755 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
756 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
757 |
|
758 imp->removeAllScriptsToEvaluateOnLoad(); |
|
759 return JSValue::encode(jsUndefined()); |
|
760 } |
|
761 |
|
762 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetChildNodes(ExecState* exec) |
|
763 { |
|
764 JSValue thisValue = exec->hostThisValue(); |
|
765 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
766 return throwVMTypeError(exec); |
|
767 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
768 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
769 int callId = exec->argument(0).toInt32(exec); |
|
770 int nodeId = exec->argument(1).toInt32(exec); |
|
771 |
|
772 imp->getChildNodes(callId, nodeId); |
|
773 return JSValue::encode(jsUndefined()); |
|
774 } |
|
775 |
|
776 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetAttribute(ExecState* exec) |
|
777 { |
|
778 JSValue thisValue = exec->hostThisValue(); |
|
779 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
780 return throwVMTypeError(exec); |
|
781 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
782 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
783 int callId = exec->argument(0).toInt32(exec); |
|
784 int elementId = exec->argument(1).toInt32(exec); |
|
785 const String& name = ustringToString(exec->argument(2).toString(exec)); |
|
786 const String& value = ustringToString(exec->argument(3).toString(exec)); |
|
787 |
|
788 imp->setAttribute(callId, elementId, name, value); |
|
789 return JSValue::encode(jsUndefined()); |
|
790 } |
|
791 |
|
792 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionRemoveAttribute(ExecState* exec) |
|
793 { |
|
794 JSValue thisValue = exec->hostThisValue(); |
|
795 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
796 return throwVMTypeError(exec); |
|
797 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
798 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
799 int callId = exec->argument(0).toInt32(exec); |
|
800 int elementId = exec->argument(1).toInt32(exec); |
|
801 const String& name = ustringToString(exec->argument(2).toString(exec)); |
|
802 |
|
803 imp->removeAttribute(callId, elementId, name); |
|
804 return JSValue::encode(jsUndefined()); |
|
805 } |
|
806 |
|
807 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetTextNodeValue(ExecState* exec) |
|
808 { |
|
809 JSValue thisValue = exec->hostThisValue(); |
|
810 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
811 return throwVMTypeError(exec); |
|
812 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
813 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
814 int callId = exec->argument(0).toInt32(exec); |
|
815 int nodeId = exec->argument(1).toInt32(exec); |
|
816 const String& value = ustringToString(exec->argument(2).toString(exec)); |
|
817 |
|
818 imp->setTextNodeValue(callId, nodeId, value); |
|
819 return JSValue::encode(jsUndefined()); |
|
820 } |
|
821 |
|
822 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetEventListenersForNode(ExecState* exec) |
|
823 { |
|
824 JSValue thisValue = exec->hostThisValue(); |
|
825 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
826 return throwVMTypeError(exec); |
|
827 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
828 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
829 int callId = exec->argument(0).toInt32(exec); |
|
830 int nodeId = exec->argument(1).toInt32(exec); |
|
831 |
|
832 imp->getEventListenersForNode(callId, nodeId); |
|
833 return JSValue::encode(jsUndefined()); |
|
834 } |
|
835 |
|
836 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionCopyNode(ExecState* exec) |
|
837 { |
|
838 JSValue thisValue = exec->hostThisValue(); |
|
839 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
840 return throwVMTypeError(exec); |
|
841 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
842 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
843 int nodeId = exec->argument(0).toInt32(exec); |
|
844 |
|
845 imp->copyNode(nodeId); |
|
846 return JSValue::encode(jsUndefined()); |
|
847 } |
|
848 |
|
849 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionRemoveNode(ExecState* exec) |
|
850 { |
|
851 JSValue thisValue = exec->hostThisValue(); |
|
852 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
853 return throwVMTypeError(exec); |
|
854 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
855 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
856 int callId = exec->argument(0).toInt32(exec); |
|
857 int nodeId = exec->argument(1).toInt32(exec); |
|
858 |
|
859 imp->removeNode(callId, nodeId); |
|
860 return JSValue::encode(jsUndefined()); |
|
861 } |
|
862 |
|
863 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionChangeTagName(ExecState* exec) |
|
864 { |
|
865 JSValue thisValue = exec->hostThisValue(); |
|
866 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
867 return throwVMTypeError(exec); |
|
868 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
869 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
870 int callId = exec->argument(0).toInt32(exec); |
|
871 int nodeId = exec->argument(1).toInt32(exec); |
|
872 const String& newTagName = ustringToString(exec->argument(2).toString(exec)); |
|
873 |
|
874 imp->changeTagName(callId, nodeId, newTagName); |
|
875 return JSValue::encode(jsUndefined()); |
|
876 } |
|
877 |
|
878 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetOuterHTML(ExecState* exec) |
|
879 { |
|
880 JSValue thisValue = exec->hostThisValue(); |
|
881 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
882 return throwVMTypeError(exec); |
|
883 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
884 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
885 int callId = exec->argument(0).toInt32(exec); |
|
886 int nodeId = exec->argument(1).toInt32(exec); |
|
887 |
|
888 imp->getOuterHTML(callId, nodeId); |
|
889 return JSValue::encode(jsUndefined()); |
|
890 } |
|
891 |
|
892 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetOuterHTML(ExecState* exec) |
|
893 { |
|
894 JSValue thisValue = exec->hostThisValue(); |
|
895 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
896 return throwVMTypeError(exec); |
|
897 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
898 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
899 int callId = exec->argument(0).toInt32(exec); |
|
900 int nodeId = exec->argument(1).toInt32(exec); |
|
901 const String& outerHTML = ustringToString(exec->argument(2).toString(exec)); |
|
902 |
|
903 imp->setOuterHTML(callId, nodeId, outerHTML); |
|
904 return JSValue::encode(jsUndefined()); |
|
905 } |
|
906 |
|
907 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionAddInspectedNode(ExecState* exec) |
|
908 { |
|
909 JSValue thisValue = exec->hostThisValue(); |
|
910 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
911 return throwVMTypeError(exec); |
|
912 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
913 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
914 int nodeId = exec->argument(0).toInt32(exec); |
|
915 |
|
916 imp->addInspectedNode(nodeId); |
|
917 return JSValue::encode(jsUndefined()); |
|
918 } |
|
919 |
|
920 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionPerformSearch(ExecState* exec) |
|
921 { |
|
922 JSValue thisValue = exec->hostThisValue(); |
|
923 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
924 return throwVMTypeError(exec); |
|
925 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
926 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
927 const String& query = ustringToString(exec->argument(0).toString(exec)); |
|
928 bool runSynchronously = exec->argument(1).toBoolean(exec); |
|
929 |
|
930 imp->performSearch(query, runSynchronously); |
|
931 return JSValue::encode(jsUndefined()); |
|
932 } |
|
933 |
|
934 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSearchCanceled(ExecState* exec) |
|
935 { |
|
936 JSValue thisValue = exec->hostThisValue(); |
|
937 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
938 return throwVMTypeError(exec); |
|
939 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
940 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
941 |
|
942 imp->searchCanceled(); |
|
943 return JSValue::encode(jsUndefined()); |
|
944 } |
|
945 |
|
946 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionPushNodeByPathToFrontend(ExecState* exec) |
|
947 { |
|
948 JSValue thisValue = exec->hostThisValue(); |
|
949 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
950 return throwVMTypeError(exec); |
|
951 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
952 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
953 int callId = exec->argument(0).toInt32(exec); |
|
954 const String& path = ustringToString(exec->argument(1).toString(exec)); |
|
955 |
|
956 imp->pushNodeByPathToFrontend(callId, path); |
|
957 return JSValue::encode(jsUndefined()); |
|
958 } |
|
959 |
|
960 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionClearConsoleMessages(ExecState* exec) |
|
961 { |
|
962 JSValue thisValue = exec->hostThisValue(); |
|
963 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
964 return throwVMTypeError(exec); |
|
965 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
966 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
967 |
|
968 imp->clearConsoleMessages(); |
|
969 return JSValue::encode(jsUndefined()); |
|
970 } |
|
971 |
|
972 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionHighlightDOMNode(ExecState* exec) |
|
973 { |
|
974 JSValue thisValue = exec->hostThisValue(); |
|
975 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
976 return throwVMTypeError(exec); |
|
977 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
978 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
979 int nodeId = exec->argument(0).toInt32(exec); |
|
980 |
|
981 imp->highlightDOMNode(nodeId); |
|
982 return JSValue::encode(jsUndefined()); |
|
983 } |
|
984 |
|
985 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionHideDOMNodeHighlight(ExecState* exec) |
|
986 { |
|
987 JSValue thisValue = exec->hostThisValue(); |
|
988 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
989 return throwVMTypeError(exec); |
|
990 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
991 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
992 |
|
993 imp->hideDOMNodeHighlight(); |
|
994 return JSValue::encode(jsUndefined()); |
|
995 } |
|
996 |
|
997 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetStyles(ExecState* exec) |
|
998 { |
|
999 JSValue thisValue = exec->hostThisValue(); |
|
1000 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1001 return throwVMTypeError(exec); |
|
1002 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1003 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1004 int callId = exec->argument(0).toInt32(exec); |
|
1005 int nodeId = exec->argument(1).toInt32(exec); |
|
1006 bool authOnly = exec->argument(2).toBoolean(exec); |
|
1007 |
|
1008 imp->getStyles(callId, nodeId, authOnly); |
|
1009 return JSValue::encode(jsUndefined()); |
|
1010 } |
|
1011 |
|
1012 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetAllStyles(ExecState* exec) |
|
1013 { |
|
1014 JSValue thisValue = exec->hostThisValue(); |
|
1015 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1016 return throwVMTypeError(exec); |
|
1017 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1018 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1019 int callId = exec->argument(0).toInt32(exec); |
|
1020 |
|
1021 imp->getAllStyles(callId); |
|
1022 return JSValue::encode(jsUndefined()); |
|
1023 } |
|
1024 |
|
1025 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetInlineStyle(ExecState* exec) |
|
1026 { |
|
1027 JSValue thisValue = exec->hostThisValue(); |
|
1028 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1029 return throwVMTypeError(exec); |
|
1030 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1031 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1032 int callId = exec->argument(0).toInt32(exec); |
|
1033 int nodeId = exec->argument(1).toInt32(exec); |
|
1034 |
|
1035 imp->getInlineStyle(callId, nodeId); |
|
1036 return JSValue::encode(jsUndefined()); |
|
1037 } |
|
1038 |
|
1039 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetComputedStyle(ExecState* exec) |
|
1040 { |
|
1041 JSValue thisValue = exec->hostThisValue(); |
|
1042 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1043 return throwVMTypeError(exec); |
|
1044 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1045 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1046 int callId = exec->argument(0).toInt32(exec); |
|
1047 int nodeId = exec->argument(1).toInt32(exec); |
|
1048 |
|
1049 imp->getComputedStyle(callId, nodeId); |
|
1050 return JSValue::encode(jsUndefined()); |
|
1051 } |
|
1052 |
|
1053 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetStyleSheet(ExecState* exec) |
|
1054 { |
|
1055 JSValue thisValue = exec->hostThisValue(); |
|
1056 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1057 return throwVMTypeError(exec); |
|
1058 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1059 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1060 int callId = exec->argument(0).toInt32(exec); |
|
1061 int styleSheetId = exec->argument(1).toInt32(exec); |
|
1062 |
|
1063 imp->getStyleSheet(callId, styleSheetId); |
|
1064 return JSValue::encode(jsUndefined()); |
|
1065 } |
|
1066 |
|
1067 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetRuleRangesForStyleSheetId(ExecState* exec) |
|
1068 { |
|
1069 JSValue thisValue = exec->hostThisValue(); |
|
1070 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1071 return throwVMTypeError(exec); |
|
1072 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1073 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1074 int callId = exec->argument(0).toInt32(exec); |
|
1075 int styleSheetId = exec->argument(1).toInt32(exec); |
|
1076 |
|
1077 imp->getRuleRangesForStyleSheetId(callId, styleSheetId); |
|
1078 return JSValue::encode(jsUndefined()); |
|
1079 } |
|
1080 |
|
1081 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionApplyStyleText(ExecState* exec) |
|
1082 { |
|
1083 JSValue thisValue = exec->hostThisValue(); |
|
1084 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1085 return throwVMTypeError(exec); |
|
1086 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1087 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1088 int callId = exec->argument(0).toInt32(exec); |
|
1089 int styleId = exec->argument(1).toInt32(exec); |
|
1090 const String& styleText = ustringToString(exec->argument(2).toString(exec)); |
|
1091 const String& propertyName = ustringToString(exec->argument(3).toString(exec)); |
|
1092 |
|
1093 imp->applyStyleText(callId, styleId, styleText, propertyName); |
|
1094 return JSValue::encode(jsUndefined()); |
|
1095 } |
|
1096 |
|
1097 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetStyleText(ExecState* exec) |
|
1098 { |
|
1099 JSValue thisValue = exec->hostThisValue(); |
|
1100 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1101 return throwVMTypeError(exec); |
|
1102 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1103 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1104 int callId = exec->argument(0).toInt32(exec); |
|
1105 int styleId = exec->argument(1).toInt32(exec); |
|
1106 const String& styleText = ustringToString(exec->argument(2).toString(exec)); |
|
1107 |
|
1108 imp->setStyleText(callId, styleId, styleText); |
|
1109 return JSValue::encode(jsUndefined()); |
|
1110 } |
|
1111 |
|
1112 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetStyleProperty(ExecState* exec) |
|
1113 { |
|
1114 JSValue thisValue = exec->hostThisValue(); |
|
1115 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1116 return throwVMTypeError(exec); |
|
1117 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1118 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1119 int callId = exec->argument(0).toInt32(exec); |
|
1120 int styleId = exec->argument(1).toInt32(exec); |
|
1121 const String& name = ustringToString(exec->argument(2).toString(exec)); |
|
1122 const String& value = ustringToString(exec->argument(3).toString(exec)); |
|
1123 |
|
1124 imp->setStyleProperty(callId, styleId, name, value); |
|
1125 return JSValue::encode(jsUndefined()); |
|
1126 } |
|
1127 |
|
1128 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionToggleStyleEnabled(ExecState* exec) |
|
1129 { |
|
1130 JSValue thisValue = exec->hostThisValue(); |
|
1131 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1132 return throwVMTypeError(exec); |
|
1133 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1134 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1135 int callId = exec->argument(0).toInt32(exec); |
|
1136 int styleId = exec->argument(1).toInt32(exec); |
|
1137 const String& propertyName = ustringToString(exec->argument(2).toString(exec)); |
|
1138 bool disabled = exec->argument(3).toBoolean(exec); |
|
1139 |
|
1140 imp->toggleStyleEnabled(callId, styleId, propertyName, disabled); |
|
1141 return JSValue::encode(jsUndefined()); |
|
1142 } |
|
1143 |
|
1144 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetRuleSelector(ExecState* exec) |
|
1145 { |
|
1146 JSValue thisValue = exec->hostThisValue(); |
|
1147 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1148 return throwVMTypeError(exec); |
|
1149 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1150 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1151 int callId = exec->argument(0).toInt32(exec); |
|
1152 int ruleId = exec->argument(1).toInt32(exec); |
|
1153 const String& selector = ustringToString(exec->argument(2).toString(exec)); |
|
1154 int selectedNodeId = exec->argument(3).toInt32(exec); |
|
1155 |
|
1156 imp->setRuleSelector(callId, ruleId, selector, selectedNodeId); |
|
1157 return JSValue::encode(jsUndefined()); |
|
1158 } |
|
1159 |
|
1160 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionAddRule(ExecState* exec) |
|
1161 { |
|
1162 JSValue thisValue = exec->hostThisValue(); |
|
1163 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1164 return throwVMTypeError(exec); |
|
1165 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1166 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1167 int callId = exec->argument(0).toInt32(exec); |
|
1168 const String& selector = ustringToString(exec->argument(1).toString(exec)); |
|
1169 int selectedNodeId = exec->argument(2).toInt32(exec); |
|
1170 |
|
1171 imp->addRule(callId, selector, selectedNodeId); |
|
1172 return JSValue::encode(jsUndefined()); |
|
1173 } |
|
1174 |
|
1175 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetCookies(ExecState* exec) |
|
1176 { |
|
1177 JSValue thisValue = exec->hostThisValue(); |
|
1178 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1179 return throwVMTypeError(exec); |
|
1180 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1181 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1182 int callId = exec->argument(0).toInt32(exec); |
|
1183 |
|
1184 imp->getCookies(callId); |
|
1185 return JSValue::encode(jsUndefined()); |
|
1186 } |
|
1187 |
|
1188 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionDeleteCookie(ExecState* exec) |
|
1189 { |
|
1190 JSValue thisValue = exec->hostThisValue(); |
|
1191 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1192 return throwVMTypeError(exec); |
|
1193 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1194 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1195 const String& cookieName = ustringToString(exec->argument(0).toString(exec)); |
|
1196 const String& domain = ustringToString(exec->argument(1).toString(exec)); |
|
1197 |
|
1198 imp->deleteCookie(cookieName, domain); |
|
1199 return JSValue::encode(jsUndefined()); |
|
1200 } |
|
1201 |
|
1202 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetApplicationCaches(ExecState* exec) |
|
1203 { |
|
1204 JSValue thisValue = exec->hostThisValue(); |
|
1205 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1206 return throwVMTypeError(exec); |
|
1207 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1208 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1209 int callId = exec->argument(0).toInt32(exec); |
|
1210 |
|
1211 imp->getApplicationCaches(callId); |
|
1212 return JSValue::encode(jsUndefined()); |
|
1213 } |
|
1214 |
|
1215 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionReleaseWrapperObjectGroup(ExecState* exec) |
|
1216 { |
|
1217 JSValue thisValue = exec->hostThisValue(); |
|
1218 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1219 return throwVMTypeError(exec); |
|
1220 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1221 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1222 int injectedScriptId = exec->argument(0).toInt32(exec); |
|
1223 const String& objectGroup = ustringToString(exec->argument(1).toString(exec)); |
|
1224 |
|
1225 imp->releaseWrapperObjectGroup(injectedScriptId, objectGroup); |
|
1226 return JSValue::encode(jsUndefined()); |
|
1227 } |
|
1228 |
|
1229 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionDidEvaluateForTestInFrontend(ExecState* exec) |
|
1230 { |
|
1231 JSValue thisValue = exec->hostThisValue(); |
|
1232 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1233 return throwVMTypeError(exec); |
|
1234 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1235 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1236 int callId = exec->argument(0).toInt32(exec); |
|
1237 const String& jsonResult = ustringToString(exec->argument(1).toString(exec)); |
|
1238 |
|
1239 imp->didEvaluateForTestInFrontend(callId, jsonResult); |
|
1240 return JSValue::encode(jsUndefined()); |
|
1241 } |
|
1242 |
|
1243 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetDatabaseTableNames(ExecState* exec) |
|
1244 { |
|
1245 JSValue thisValue = exec->hostThisValue(); |
|
1246 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1247 return throwVMTypeError(exec); |
|
1248 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1249 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1250 int callId = exec->argument(0).toInt32(exec); |
|
1251 int databaseId = exec->argument(1).toInt32(exec); |
|
1252 |
|
1253 imp->getDatabaseTableNames(callId, databaseId); |
|
1254 return JSValue::encode(jsUndefined()); |
|
1255 } |
|
1256 |
|
1257 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionGetDOMStorageEntries(ExecState* exec) |
|
1258 { |
|
1259 JSValue thisValue = exec->hostThisValue(); |
|
1260 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1261 return throwVMTypeError(exec); |
|
1262 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1263 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1264 int callId = exec->argument(0).toInt32(exec); |
|
1265 int storageId = exec->argument(1).toInt32(exec); |
|
1266 |
|
1267 imp->getDOMStorageEntries(callId, storageId); |
|
1268 return JSValue::encode(jsUndefined()); |
|
1269 } |
|
1270 |
|
1271 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionSetDOMStorageItem(ExecState* exec) |
|
1272 { |
|
1273 JSValue thisValue = exec->hostThisValue(); |
|
1274 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1275 return throwVMTypeError(exec); |
|
1276 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1277 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1278 int callId = exec->argument(0).toInt32(exec); |
|
1279 int storageId = exec->argument(1).toInt32(exec); |
|
1280 const String& key = ustringToString(exec->argument(2).toString(exec)); |
|
1281 const String& value = ustringToString(exec->argument(3).toString(exec)); |
|
1282 |
|
1283 imp->setDOMStorageItem(callId, storageId, key, value); |
|
1284 return JSValue::encode(jsUndefined()); |
|
1285 } |
|
1286 |
|
1287 EncodedJSValue JSC_HOST_CALL jsInspectorBackendPrototypeFunctionRemoveDOMStorageItem(ExecState* exec) |
|
1288 { |
|
1289 JSValue thisValue = exec->hostThisValue(); |
|
1290 if (!thisValue.inherits(&JSInspectorBackend::s_info)) |
|
1291 return throwVMTypeError(exec); |
|
1292 JSInspectorBackend* castedThis = static_cast<JSInspectorBackend*>(asObject(thisValue)); |
|
1293 InspectorBackend* imp = static_cast<InspectorBackend*>(castedThis->impl()); |
|
1294 int callId = exec->argument(0).toInt32(exec); |
|
1295 int storageId = exec->argument(1).toInt32(exec); |
|
1296 const String& key = ustringToString(exec->argument(2).toString(exec)); |
|
1297 |
|
1298 imp->removeDOMStorageItem(callId, storageId, key); |
|
1299 return JSValue::encode(jsUndefined()); |
|
1300 } |
|
1301 |
|
1302 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, InspectorBackend* object) |
|
1303 { |
|
1304 return getDOMObjectWrapper<JSInspectorBackend>(exec, globalObject, object); |
|
1305 } |
|
1306 InspectorBackend* toInspectorBackend(JSC::JSValue value) |
|
1307 { |
|
1308 return value.inherits(&JSInspectorBackend::s_info) ? static_cast<JSInspectorBackend*>(asObject(value))->impl() : 0; |
|
1309 } |
|
1310 |
|
1311 } |
|
1312 |
|
1313 #endif // ENABLE(INSPECTOR) |