summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/inspector/Inspector.idl
blob: 6c2cc2e0125bf518d3c960098e27fc4ab5e4e85b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
/*
 * Copyright (C) 2010 Apple Inc. All rights reserved.
 * Copyright (C) 2011 Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

module core {
    interface [Conditional=INSPECTOR] Inspector {

        ///////////////////////////////////////////////////////////////////////
        // generic Inspector's methods
        ///////////////////////////////////////////////////////////////////////

        // HUGE FIXME: we need to expose InjectedScript methods here. Or document InjectedScript capabilities.
        [domain=Inspector] void dispatchOnInjectedScript(in long injectedScriptId, in String methodName, in String arguments, out Value result, out boolean isException);
        [domain=Inspector] void addScriptToEvaluateOnLoad(in String scriptSource);
        [domain=Inspector] void removeAllScriptsToEvaluateOnLoad();
        [domain=Inspector] void releaseWrapperObjectGroup(in long injectedScriptId, in String objectGroup);
        [domain=Inspector] void getInspectorState(out Object state);
        [domain=Inspector] void setMonitoringXHREnabled(in boolean enable, out boolean newState);
        [domain=Inspector] void reloadPage();
        [domain=Inspector] void populateScriptObjects();

        [domain=Inspector] void openInInspectedWindow(in String url);
        [domain=Inspector] void setSearchingForNode(in boolean enabled, out boolean newState);
        [notify, domain=Inspector] void frontendReused();
        [notify, domain=Inspector] void addNodesToSearchResult(out Array nodeIds);
        [notify, domain=Inspector] void bringToFront();
        [notify, domain=Inspector] void disconnectFromBackend();
        [notify, domain=Inspector] void inspectedURLChanged(out String url);
        [notify, domain=Inspector] void domContentEventFired(out double time);
        [notify, domain=Inspector] void loadEventFired(out double time);
        [notify, domain=Inspector] void reset();
        [notify, domain=Inspector] void showPanel(out String panel);

        [notify, domain=Inspector] void evaluateForTestInFrontend(out long testCallId, out String script);
        [domain=Inspector] void didEvaluateForTestInFrontend(in long testCallId, in String jsonResult);

        [domain=Inspector] void highlightDOMNode(in long nodeId);
        [domain=Inspector] void hideDOMNodeHighlight();
        [domain=Inspector] void highlightFrame(in unsigned long frameId);
        [domain=Inspector] void hideFrameHighlight();
        [notify, domain=Inspector] void updateFocusedNode(out long nodeId);

        [domain=Inspector] void setExtraHeaders(in Object headers);

        [domain=Inspector] void getCookies(out Array cookies, out String cookiesString);
        [domain=Inspector] void deleteCookie(in String cookieName, in String domain);

        ///////////////////////////////////////////////////////////////////////
        // Console API
        ///////////////////////////////////////////////////////////////////////

        [domain=Console] void setConsoleMessagesEnabled(in boolean enabled, out boolean newState);
        [notify, domain=Console] void addConsoleMessage(out Object messageObj);
        [notify, domain=Console] void updateConsoleMessageExpiredCount(out unsigned long count);
        [notify, domain=Console] void updateConsoleMessageRepeatCount(out unsigned long count);
        [domain=Console] void clearConsoleMessages();
        [notify, domain=Console] void consoleMessagesCleared();

        ///////////////////////////////////////////////////////////////////////
        // Network API
        ///////////////////////////////////////////////////////////////////////

        [domain=Network] void cachedResources(out Object resources);
        [domain=Network] void resourceContent(in unsigned long frameId, in String url, in boolean base64Encode, out String content);
        [notify, domain=Network] void frameDetachedFromParent(out unsigned long frameId);

        [notify, domain=Network] void identifierForInitialRequest(out long identifier, out String url, out Object loader, out Value callStack);
        [notify, domain=Network] void willSendRequest(out long identifier, out double time, out Object request, out Object redirectResponse);
        [notify, domain=Network] void markResourceAsCached(out long identifier);
        [notify, domain=Network] void didReceiveResponse(out long identifier, out double time, out String resourceType, out Object response);
        [notify, domain=Network] void didReceiveContentLength(out long identifier, out double time, out long lengthReceived);
        [notify, domain=Network] void didFinishLoading(out long identifier, out double finishTime);
        [notify, domain=Network] void didFailLoading(out long identifier, out double time, out String localizedDescription);
        [notify, domain=Network] void didLoadResourceFromMemoryCache(out double time, out Object resource);
        [notify, domain=Network] void setInitialContent(out long identifier, out String sourceString, out String type);
        [notify, domain=Network] void didCommitLoadForFrame(out Object frame, out Object loader);
        [notify, domain=Network] void didCreateWebSocket(out unsigned long identifier, out String requestURL);
        [notify, domain=Network] void willSendWebSocketHandshakeRequest(out unsigned long identifier, out double time, out Object request);
        [notify, domain=Network] void didReceiveWebSocketHandshakeResponse(out unsigned long identifier, out double time, out Object response);
        [notify, domain=Network] void didCloseWebSocket(out unsigned long identifier, out double time);

#if defined(ENABLE_DATABASE) && ENABLE_DATABASE

        ///////////////////////////////////////////////////////////////////////
        // Database API
        ///////////////////////////////////////////////////////////////////////

        [notify, domain=Database] void addDatabase(out Object database);
        [notify, domain=Database] void selectDatabase(out int databaseId);
        [domain=Database] void getDatabaseTableNames(in long databaseId, out Array tableNames);
        [domain=Database] void executeSQL(in long databaseId, in String query, out boolean success, out long transactionId);
        [notify, domain=Database] void sqlTransactionSucceeded(out long transactionId, out Value columnNames, out Value values);
        [notify, domain=Database] void sqlTransactionFailed(out long transactionId, out Value sqlError);
#endif

#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE

        ///////////////////////////////////////////////////////////////////////
        // DOM Storage API
        ///////////////////////////////////////////////////////////////////////

        [domain=DOMStorage] void getDOMStorageEntries(in long storageId, out Array entries);
        [domain=DOMStorage] void setDOMStorageItem(in long storageId, in String key, in String value, out boolean success);
        [domain=DOMStorage] void removeDOMStorageItem(in long storageId, in String key, out boolean success);
        [notify, domain=DOMStorage] void addDOMStorage(out Object storage);
        [notify, domain=DOMStorage] void updateDOMStorage(out int storageId);
        [notify, domain=DOMStorage] void selectDOMStorage(out int storageId);
#endif

#if defined(ENABLE_OFFLINE_WEB_APPLICATIONS) && ENABLE_OFFLINE_WEB_APPLICATIONS

        ///////////////////////////////////////////////////////////////////////
        // AppCache API
        ///////////////////////////////////////////////////////////////////////

        [domain=ApplicationCache] void getApplicationCaches(out Value applicationCaches);
        [notify, domain=ApplicationCache] void updateApplicationCacheStatus(out int status);
        [notify, domain=ApplicationCache] void updateNetworkState(out boolean isNowOnline);
#endif

#if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM

        ///////////////////////////////////////////////////////////////////////
        // Filesystem API
        ///////////////////////////////////////////////////////////////////////

        [domain=FileSystem] void getFileSystemPathAsync(in unsigned int type, in String origin);
        [domain=FileSystem] void revealFolderInOS(in String path);

        [notify, domain=FileSystem] void didGetFileSystemPath(out String root, out int type, out String origin);
        [notify, domain=FileSystem] void didGetFileSystemError(out int type, out String origin);
        [notify, domain=FileSystem] void didGetFileSystemDisabled();
#endif

        ///////////////////////////////////////////////////////////////////////
        // DOM API
        ///////////////////////////////////////////////////////////////////////

        [domain=DOM] void getChildNodes(in long nodeId);
        [domain=DOM] void setAttribute(in long elementId, in String name, in String value, out boolean success);
        [domain=DOM] void removeAttribute(in long elementId, in String name, out boolean success);
        [domain=DOM] void setTextNodeValue(in long nodeId, in String value, out boolean success);
        [domain=DOM] void getEventListenersForNode(in long nodeId, out long outNodeId, out Array listenersArray);
        [domain=DOM] void copyNode(in long nodeId);
        [domain=DOM] void removeNode(in long nodeId, out long outNodeId);
        [domain=DOM] void changeTagName(in long nodeId, in String newTagName, out long outNodeId);
        [domain=DOM] void getOuterHTML(in long nodeId, out String outerHTML);
        [domain=DOM] void setOuterHTML(in long nodeId, in String outerHTML, out long outNodeId);
        [domain=DOM] void addInspectedNode(in long nodeId);
        [domain=DOM] void performSearch(in String query, in boolean runSynchronously);
        [domain=DOM] void searchCanceled();
        [domain=DOM] void pushNodeByPathToFrontend(in String path, out long nodeId);

        [notify, domain=DOM] void setDocument(out Value root); // FIXME: should be requested from the front-end as getDocument.
        [notify, domain=DOM] void attributesUpdated(out long id, out Array attributes);
        [notify, domain=DOM] void characterDataModified(out long id, out String newValue);
        [notify, domain=DOM] void setChildNodes(out long parentId, out Array nodes);
        [notify, domain=DOM] void setDetachedRoot(out Object root);
        [notify, domain=DOM] void childNodeCountUpdated(out long id, out int newValue);
        [notify, domain=DOM] void childNodeInserted(out long parentId, out long prevId, out Object node);
        [notify, domain=DOM] void childNodeRemoved(out long parentId, out long id);

        ///////////////////////////////////////////////////////////////////////
        // CSS API
        ///////////////////////////////////////////////////////////////////////

        [domain=CSS] void getStylesForNode2(in long nodeId, out Value styles);
        [domain=CSS] void getComputedStyleForNode2(in long nodeId, out Value style);
        [domain=CSS] void getInlineStyleForNode2(in long nodeId, out Value style);
        [domain=CSS] void getAllStyles2(out Array styleSheetIds);
        [domain=CSS] void getStyleSheet2(in String styleSheetId, out Value styleSheet);
        [domain=CSS] void getStyleSheetText2(in String styleSheetId, out String url, out String text);
        [domain=CSS] void setStyleSheetText2(in String styleSheetId, in String text, out boolean success);
        [domain=CSS] void setPropertyText2(in Object styleId, in long propertyIndex, in String text, in boolean overwrite, out Value style);
        [domain=CSS] void toggleProperty2(in Object styleId, in long propertyIndex, in boolean disable, out Value style);
        [domain=CSS] void setRuleSelector2(in Object ruleId, in String selector, out Value rule);
        [domain=CSS] void addRule2(in long contextNodeId, in String selector, out Value rule);
        [domain=CSS] void getSupportedCSSProperties(out Array cssProperties);
        [domain=CSS] void querySelectorAll(in long documentId, in String selector, out Array result);

        ///////////////////////////////////////////////////////////////////////
        // Timeline API
        ///////////////////////////////////////////////////////////////////////

        [domain=Inspector] void startTimelineProfiler();
        [domain=Inspector] void stopTimelineProfiler();
        [notify, domain=Timeline] void timelineProfilerWasStarted();
        [notify, domain=Timeline] void timelineProfilerWasStopped();
        [notify, domain=Timeline] void addRecordToTimeline(out Object record);

#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER

        ///////////////////////////////////////////////////////////////////////
        // Debugger API
        ///////////////////////////////////////////////////////////////////////

        [domain=Inspector] void enableDebugger(in boolean always);
        [domain=Inspector] void disableDebugger(in boolean always);

        [domain=Inspector] void setStickyBreakpoints(in Object breakpoints);

        [notify, domain=Debugger] void debuggerWasEnabled();
        [notify, domain=Debugger] void debuggerWasDisabled();

        [notify, domain=Debugger] void parsedScriptSource(out String sourceID, out String url, out int lineOffset, out int columnOffset, out int scriptWorldType);
        [notify, domain=Debugger] void failedToParseScriptSource(out String url, out String data, out int firstLine, out int errorLine, out String errorMessage);

        [domain=Debugger] void activateBreakpoints();
        [domain=Debugger] void deactivateBreakpoints();

        [domain=Debugger] void setBreakpoint(in String sourceID, in unsigned int lineNumber, in String condition, in boolean enabled, out String breakpointId, out unsigned int actualLineNumber);
        [domain=Debugger] void removeBreakpoint(in String breakpointId);

        [domain=BrowserDebugger] void setDOMBreakpoint(in long nodeId, in long type);
        [domain=BrowserDebugger] void removeDOMBreakpoint(in long nodeId, in long type);
        [domain=BrowserDebugger] void setEventListenerBreakpoint(in String eventName);
        [domain=BrowserDebugger] void removeEventListenerBreakpoint(in String eventName);
        [domain=BrowserDebugger] void setXHRBreakpoint(in String url);
        [domain=BrowserDebugger] void removeXHRBreakpoint(in String url);

        [domain=Debugger] void stepOver();
        [domain=Debugger] void stepInto();
        [domain=Debugger] void stepOut();
        [domain=Debugger] void pause();
        [notify, domain=Debugger] void pausedScript(out Object details);
        [domain=Debugger] void resume();
        [notify, domain=Debugger] void resumedScript(); // FIXME: Make this out parameter fo resume if possible.

        [domain=Debugger] void setPauseOnExceptionsState(in long pauseOnExceptionsState, out long newState);

        [domain=Debugger] void editScriptSource(in String sourceID, in String newContent, out boolean success, out String result, out Value newCallFrames);
        [domain=Debugger] void getScriptSource(in String sourceID, out String scriptSource);

        [notify, domain=Debugger] void breakpointResolved(out String breakpointId, out String sourceID, out unsigned int lineNumber, out String condition, out boolean enabled, out unsigned int originalLineNumber);

#if defined(ENABLE_WORKERS) && ENABLE_WORKERS
        [notify, domain=Debugger] void didCreateWorker(out long id, out String url, out boolean isShared);
        [notify, domain=Debugger] void didDestroyWorker(out long id);
#endif // ENABLE_WORKERS

        ///////////////////////////////////////////////////////////////////////
        // Profiler API
        ///////////////////////////////////////////////////////////////////////

        [domain=Inspector] void enableProfiler(in boolean always); // FIXME: preferrable with Inspector domain, dispatched on backend.
        [domain=Inspector] void disableProfiler(in boolean always);
        [notify, domain=Profiler] void profilerWasEnabled();
        [notify, domain=Profiler] void profilerWasDisabled();

        [domain=Inspector] void startProfiling(); // FIXME: dispatch on profiler agent.
        [domain=Inspector] void stopProfiling(); // FIXME: dispatch on profiler agent.

        [domain=Profiler] void getProfileHeaders(out Array headers);
        [domain=Profiler] void getProfile(in String type, in unsigned long uid, out Object profile);
        [domain=Profiler] void removeProfile(in String type, in unsigned long uid);
        [domain=Profiler] void clearProfiles();

        // FIXME: split into Profiler and HeapProfiler.
        [domain=Profiler] void takeHeapSnapshot();
        [notify, domain=Profiler] void addProfileHeader(out Object header);
        [notify, domain=Profiler] void addHeapSnapshotChunk(out unsigned long uid, out String chunk);
        [notify, domain=Profiler] void finishHeapSnapshot(out unsigned long uid);
        [notify, domain=Profiler] void setRecordingProfile(out boolean isProfiling);
        [notify, domain=Profiler] void resetProfiles();

#endif // ENABLE_JAVASCRIPT_DEBUGGER
    };
}