OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 : JavaScriptDebugListener, public Noncopyable | 93 : JavaScriptDebugListener, public Noncopyable |
94 #else | 94 #else |
95 : public Noncopyable | 95 : public Noncopyable |
96 #endif | 96 #endif |
97 { | 97 { |
98 public: | 98 public: |
99 typedef HashMap<unsigned long, RefPtr<InspectorResource> > ResourcesMap; | 99 typedef HashMap<unsigned long, RefPtr<InspectorResource> > ResourcesMap; |
100 typedef HashMap<RefPtr<Frame>, ResourcesMap*> FrameResourcesMap; | 100 typedef HashMap<RefPtr<Frame>, ResourcesMap*> FrameResourcesMap; |
101 typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMa
p; | 101 typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMa
p; |
102 typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourc
esMap; | 102 typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourc
esMap; |
103 typedef HashMap<String, Vector<String> > ObjectGroupsMap; | |
104 | 103 |
105 typedef enum { | 104 typedef enum { |
106 CurrentPanel, | 105 CurrentPanel, |
107 ConsolePanel, | 106 ConsolePanel, |
108 ElementsPanel, | 107 ElementsPanel, |
109 ResourcesPanel, | 108 ResourcesPanel, |
110 ScriptsPanel, | 109 ScriptsPanel, |
111 TimelinePanel, | 110 TimelinePanel, |
112 ProfilesPanel, | 111 ProfilesPanel, |
113 StoragePanel | 112 StoragePanel |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 void resumeDebugger(); | 241 void resumeDebugger(); |
243 | 242 |
244 virtual void didParseSource(JSC::ExecState*, const JSC::SourceCode&); | 243 virtual void didParseSource(JSC::ExecState*, const JSC::SourceCode&); |
245 virtual void failedToParseSource(JSC::ExecState*, const JSC::SourceCode&, in
t errorLine, const JSC::UString& errorMessage); | 244 virtual void failedToParseSource(JSC::ExecState*, const JSC::SourceCode&, in
t errorLine, const JSC::UString& errorMessage); |
246 virtual void didPause(); | 245 virtual void didPause(); |
247 virtual void didContinue(); | 246 virtual void didContinue(); |
248 #endif | 247 #endif |
249 | 248 |
250 void evaluateForTestInFrontend(long callId, const String& script); | 249 void evaluateForTestInFrontend(long callId, const String& script); |
251 | 250 |
| 251 ScriptObject injectedScriptForNodeId(long id); |
| 252 |
252 private: | 253 private: |
253 static const char* const FrontendSettingsSettingName; | 254 static const char* const FrontendSettingsSettingName; |
254 friend class InspectorBackend; | 255 friend class InspectorBackend; |
255 friend class InspectorFrontendHost; | 256 friend class InspectorFrontendHost; |
256 friend class InjectedScriptHost; | 257 friend class InjectedScriptHost; |
257 // Following are used from InspectorBackend and internally. | 258 // Following are used from InspectorBackend and internally. |
258 void scriptObjectReady(); | 259 void scriptObjectReady(); |
259 void moveWindowBy(float x, float y) const; | 260 void moveWindowBy(float x, float y) const; |
260 void setAttachedWindow(bool); | 261 void setAttachedWindow(bool); |
261 void setAttachedWindowHeight(unsigned height); | 262 void setAttachedWindowHeight(unsigned height); |
262 void storeLastActivePanel(const String& panelName); | 263 void storeLastActivePanel(const String& panelName); |
263 void closeWindow(); | 264 void closeWindow(); |
264 InspectorDOMAgent* domAgent() { return m_domAgent.get(); } | 265 InspectorDOMAgent* domAgent() { return m_domAgent.get(); } |
265 void releaseDOMAgent(); | 266 void releaseDOMAgent(); |
266 | 267 |
267 friend class InspectorFrontend; | |
268 // Following are used from InspectorFrontend only. We don't want to expose t
hem to the | |
269 // rest of the InspectorController clients. | |
270 // TODO: extract these into a separate interface. | |
271 ScriptValue wrapObject(const ScriptValue& object, const String& objectGroup)
; | |
272 ScriptValue unwrapObject(const String& objectId); | |
273 void releaseWrapperObjectGroup(const String& objectGroup); | |
274 | |
275 void resetInjectedScript(); | |
276 | |
277 void deleteCookie(const String& cookieName, const String& domain); | 268 void deleteCookie(const String& cookieName, const String& domain); |
278 | 269 |
279 #if ENABLE(JAVASCRIPT_DEBUGGER) | 270 #if ENABLE(JAVASCRIPT_DEBUGGER) |
280 typedef HashMap<unsigned int, RefPtr<JSC::Profile> > ProfilesMap; | 271 typedef HashMap<unsigned int, RefPtr<JSC::Profile> > ProfilesMap; |
281 | 272 |
282 void startUserInitiatedProfilingSoon(); | 273 void startUserInitiatedProfilingSoon(); |
283 void toggleRecordButton(bool); | 274 void toggleRecordButton(bool); |
284 void enableDebuggerFromFrontend(bool always); | 275 void enableDebuggerFromFrontend(bool always); |
285 void getProfileHeaders(long callId); | 276 void getProfileHeaders(long callId); |
286 void getProfile(long callId, unsigned uid); | 277 void getProfile(long callId, unsigned uid); |
(...skipping 27 matching lines...) Expand all Loading... |
314 | 305 |
315 SpecialPanels specialPanelForJSName(const String& panelName); | 306 SpecialPanels specialPanelForJSName(const String& panelName); |
316 | 307 |
317 void didEvaluateForTestInFrontend(long callId, const String& jsonResult); | 308 void didEvaluateForTestInFrontend(long callId, const String& jsonResult); |
318 | 309 |
319 Page* m_inspectedPage; | 310 Page* m_inspectedPage; |
320 InspectorClient* m_client; | 311 InspectorClient* m_client; |
321 OwnPtr<InspectorFrontend> m_frontend; | 312 OwnPtr<InspectorFrontend> m_frontend; |
322 RefPtr<InspectorDOMAgent> m_domAgent; | 313 RefPtr<InspectorDOMAgent> m_domAgent; |
323 OwnPtr<InspectorTimelineAgent> m_timelineAgent; | 314 OwnPtr<InspectorTimelineAgent> m_timelineAgent; |
324 ScriptObject m_injectedScriptObj; | |
325 Page* m_page; | 315 Page* m_page; |
326 RefPtr<Node> m_nodeToFocus; | 316 RefPtr<Node> m_nodeToFocus; |
327 RefPtr<InspectorResource> m_mainResource; | 317 RefPtr<InspectorResource> m_mainResource; |
328 ResourcesMap m_resources; | 318 ResourcesMap m_resources; |
329 HashSet<String> m_knownResources; | 319 HashSet<String> m_knownResources; |
330 FrameResourcesMap m_frameResources; | 320 FrameResourcesMap m_frameResources; |
331 Vector<ConsoleMessage*> m_consoleMessages; | 321 Vector<ConsoleMessage*> m_consoleMessages; |
332 unsigned m_expiredConsoleMessageCount; | 322 unsigned m_expiredConsoleMessageCount; |
333 HashMap<String, double> m_times; | 323 HashMap<String, double> m_times; |
334 HashMap<String, unsigned> m_counts; | 324 HashMap<String, unsigned> m_counts; |
335 #if ENABLE(DATABASE) | 325 #if ENABLE(DATABASE) |
336 DatabaseResourcesMap m_databaseResources; | 326 DatabaseResourcesMap m_databaseResources; |
337 #endif | 327 #endif |
338 #if ENABLE(DOM_STORAGE) | 328 #if ENABLE(DOM_STORAGE) |
339 DOMStorageResourcesMap m_domStorageResources; | 329 DOMStorageResourcesMap m_domStorageResources; |
340 #endif | 330 #endif |
341 ScriptState* m_scriptState; | 331 ScriptState* m_scriptState; |
342 bool m_windowVisible; | 332 bool m_windowVisible; |
343 SpecialPanels m_showAfterVisible; | 333 SpecialPanels m_showAfterVisible; |
344 RefPtr<Node> m_highlightedNode; | 334 RefPtr<Node> m_highlightedNode; |
345 unsigned m_groupLevel; | 335 unsigned m_groupLevel; |
346 bool m_searchingForNode; | 336 bool m_searchingForNode; |
347 ConsoleMessage* m_previousMessage; | 337 ConsoleMessage* m_previousMessage; |
348 bool m_resourceTrackingEnabled; | 338 bool m_resourceTrackingEnabled; |
349 bool m_resourceTrackingSettingsLoaded; | 339 bool m_resourceTrackingSettingsLoaded; |
350 RefPtr<InspectorBackend> m_inspectorBackend; | 340 RefPtr<InspectorBackend> m_inspectorBackend; |
351 RefPtr<InspectorFrontendHost> m_inspectorFrontendHost; | 341 RefPtr<InspectorFrontendHost> m_inspectorFrontendHost; |
352 RefPtr<InjectedScriptHost> m_injectedScriptHost; | 342 RefPtr<InjectedScriptHost> m_injectedScriptHost; |
353 HashMap<String, ScriptValue> m_idToWrappedObject; | |
354 ObjectGroupsMap m_objectGroups; | |
355 long m_lastBoundObjectId; | |
356 | 343 |
357 typedef HashMap<String, String> Settings; | 344 typedef HashMap<String, String> Settings; |
358 mutable Settings m_settings; | 345 mutable Settings m_settings; |
359 | 346 |
360 Vector<pair<long, String> > m_pendingEvaluateTestCommands; | 347 Vector<pair<long, String> > m_pendingEvaluateTestCommands; |
361 #if ENABLE(JAVASCRIPT_DEBUGGER) | 348 #if ENABLE(JAVASCRIPT_DEBUGGER) |
362 bool m_debuggerEnabled; | 349 bool m_debuggerEnabled; |
363 bool m_attachDebuggerWhenShown; | 350 bool m_attachDebuggerWhenShown; |
364 bool m_profilerEnabled; | 351 bool m_profilerEnabled; |
365 bool m_recordingUserInitiatedProfile; | 352 bool m_recordingUserInitiatedProfile; |
366 int m_currentUserInitiatedProfileNumber; | 353 int m_currentUserInitiatedProfileNumber; |
367 unsigned m_nextUserInitiatedProfileNumber; | 354 unsigned m_nextUserInitiatedProfileNumber; |
368 Timer<InspectorController> m_startProfiling; | 355 Timer<InspectorController> m_startProfiling; |
369 ProfilesMap m_profiles; | 356 ProfilesMap m_profiles; |
370 #endif | 357 #endif |
371 }; | 358 }; |
372 | 359 |
373 } // namespace WebCore | 360 } // namespace WebCore |
374 | 361 |
375 #endif // !defined(InspectorController_h) | 362 #endif // !defined(InspectorController_h) |
OLD | NEW |