Changeset 64124 in webkit
- Timestamp:
- Jul 27, 2010 6:41:20 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/Android.derived.v8bindings.mk
r63064 r64124 572 572 GEN := \ 573 573 $(intermediates)/bindings/V8InjectedScriptHost.h \ 574 $(intermediates)/bindings/V8InspectorBackend.h \575 574 $(intermediates)/bindings/V8InspectorFrontendHost.h 576 575 -
trunk/WebCore/CMakeLists.txt
r63975 r64124 294 294 295 295 inspector/InjectedScriptHost.idl 296 inspector/InspectorBackend.idl297 296 inspector/InspectorFrontendHost.idl 298 297 inspector/JavaScriptCallFrame.idl -
trunk/WebCore/ChangeLog
r64111 r64124 1 2010-07-27 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: Current implementation of message based inspector 6 transport generated by CodeGeneratorInspector should be upstreamed 7 from WebKit/chromium to WebCore. 8 https://bugs.webkit.org/show_bug.cgi?id=42983 9 10 * Android.derived.v8bindings.mk: 11 * CMakeLists.txt: 12 * DerivedSources.cpp: 13 * DerivedSources.make: 14 * GNUmakefile.am: 15 * WebCore.exp.in: 16 * WebCore.gypi: 17 * WebCore.pri: 18 * WebCore.vcproj/WebCore.vcproj: 19 * WebCore.xcodeproj/project.pbxproj: 20 * bindings/js/ScriptObject.cpp: 21 * bindings/js/ScriptObject.h: 22 * bindings/v8/ScriptObject.cpp: 23 * bindings/v8/ScriptObject.h: 24 * inspector/CodeGeneratorInspector.pm: 25 * inspector/InspectorBackend.idl: Removed. 26 * inspector/InspectorFrontendClient.h: 27 * inspector/InspectorFrontendClientLocal.cpp: 28 (WebCore::InspectorFrontendClientLocal::windowObjectCleared): 29 (WebCore::InspectorFrontendClientLocal::sendMessageToBackend): 30 * inspector/InspectorFrontendClientLocal.h: 31 * inspector/InspectorFrontendHost.cpp: 32 (WebCore::InspectorFrontendHost::sendMessageToBackend): 33 * inspector/InspectorFrontendHost.h: 34 * inspector/InspectorFrontendHost.idl: 35 * inspector/front-end/InspectorBackendStub.js: 36 (.WebInspector.InspectorBackendStub): 37 (.WebInspector.InspectorBackendStub.prototype._registerDelegate): 38 (.WebInspector.InspectorBackendStub.prototype.sendMessageToBackend): 39 1 40 2010-07-27 Satish Sampath <satish@chromium.org> 2 41 -
trunk/WebCore/DerivedSources.cpp
r63064 r64124 191 191 #include "JSIndexedDatabaseRequest.cpp" 192 192 #include "JSInjectedScriptHost.cpp" 193 #include "JSInspectorBackend.cpp"194 193 #include "JSInspectorFrontendHost.cpp" 195 194 #include "JSJavaScriptCallFrame.cpp" -
trunk/WebCore/DerivedSources.make
r63198 r64124 234 234 IndexedDatabaseRequest \ 235 235 InjectedScriptHost \ 236 InspectorBackend \237 236 InspectorFrontendHost \ 238 237 KeyboardEvent \ -
trunk/WebCore/GNUmakefile.am
r64111 r64124 393 393 DerivedSources/WebCore/JSInjectedScriptHost.cpp \ 394 394 DerivedSources/WebCore/JSInjectedScriptHost.h \ 395 DerivedSources/WebCore/JSInspectorBackend.cpp \396 DerivedSources/WebCore/JSInspectorBackend.h \397 395 DerivedSources/WebCore/JSInspectorFrontendHost.cpp \ 398 396 DerivedSources/WebCore/JSInspectorFrontendHost.h \ -
trunk/WebCore/WebCore.exp.in
r64086 r64124 1196 1196 __ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv 1197 1197 __ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv 1198 __ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKNS_6StringE 1198 1199 __ZN7WebCore28InspectorFrontendClientLocal26changeAttachedWindowHeightEj 1199 1200 __ZN7WebCore28InspectorFrontendClientLocal27restoreAttachedWindowHeightEv -
trunk/WebCore/WebCore.gypi
r64111 r64124 197 197 'html/VoidCallback.idl', 198 198 'inspector/InjectedScriptHost.idl', 199 'inspector/InspectorBackend.idl',200 199 'inspector/InspectorFrontendHost.idl', 201 200 'inspector/JavaScriptCallFrame.idl', -
trunk/WebCore/WebCore.pri
r63952 r64124 449 449 html/VoidCallback.idl \ 450 450 inspector/InjectedScriptHost.idl \ 451 inspector/InspectorBackend.idl \452 451 inspector/InspectorFrontendHost.idl \ 453 452 inspector/JavaScriptCallFrame.idl \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r64111 r64124 8782 8782 </File> 8783 8783 <File 8784 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"8785 >8786 <FileConfiguration8787 Name="Debug|Win32"8788 ExcludedFromBuild="true"8789 >8790 <Tool8791 Name="VCCLCompilerTool"8792 />8793 </FileConfiguration>8794 <FileConfiguration8795 Name="Release|Win32"8796 ExcludedFromBuild="true"8797 >8798 <Tool8799 Name="VCCLCompilerTool"8800 />8801 </FileConfiguration>8802 <FileConfiguration8803 Name="Debug_Internal|Win32"8804 ExcludedFromBuild="true"8805 >8806 <Tool8807 Name="VCCLCompilerTool"8808 />8809 </FileConfiguration>8810 <FileConfiguration8811 Name="Debug_Cairo|Win32"8812 ExcludedFromBuild="true"8813 >8814 <Tool8815 Name="VCCLCompilerTool"8816 />8817 </FileConfiguration>8818 <FileConfiguration8819 Name="Release_Cairo|Win32"8820 ExcludedFromBuild="true"8821 >8822 <Tool8823 Name="VCCLCompilerTool"8824 />8825 </FileConfiguration>8826 <FileConfiguration8827 Name="Debug_All|Win32"8828 ExcludedFromBuild="true"8829 >8830 <Tool8831 Name="VCCLCompilerTool"8832 />8833 </FileConfiguration>8834 </File>8835 <File8836 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.h"8837 >8838 </File>8839 <File8840 8784 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.cpp" 8841 8785 > … … 20742 20686 </File> 20743 20687 <File 20744 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher. h"20688 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.cpp" 20745 20689 > 20746 20690 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r64111 r64124 833 833 41E1B1D30FF5986900576B3B /* SharedWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41E1B1CD0FF5986900576B3B /* SharedWorker.cpp */; }; 834 834 41E1B1D40FF5986900576B3B /* SharedWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E1B1CE0FF5986900576B3B /* SharedWorker.h */; }; 835 41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */; };836 41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */; };837 835 41F061740F5F00AC00A07EAC /* InspectorDOMStorageResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */; }; 838 836 41F061750F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */; }; … … 6541 6539 41E1B1CE0FF5986900576B3B /* SharedWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedWorker.h; path = workers/SharedWorker.h; sourceTree = "<group>"; }; 6542 6540 41E1B1CF0FF5986900576B3B /* SharedWorker.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SharedWorker.idl; path = workers/SharedWorker.idl; sourceTree = "<group>"; }; 6543 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorBackend.cpp; sourceTree = "<group>"; };6544 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInspectorBackend.h; sourceTree = "<group>"; };6545 6541 41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMStorageResource.h; sourceTree = "<group>"; }; 6546 6542 41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMStorageResource.cpp; sourceTree = "<group>"; }; … … 7172 7168 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; }; 7173 7169 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = "<group>"; }; 7174 7A74ECB61018399A00BF939E /* InspectorBackend.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InspectorBackend.idl; sourceTree = "<group>"; };7175 7170 7A74ECB8101839A500BF939E /* InspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackend.cpp; sourceTree = "<group>"; }; 7176 7171 7A74ECB9101839A600BF939E /* InspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackend.h; sourceTree = "<group>"; }; … … 11436 11431 7A0E76D810BF059800A0276E /* JSInjectedScriptHost.cpp */, 11437 11432 7A0E76D910BF059800A0276E /* JSInjectedScriptHost.h */, 11438 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */,11439 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */,11440 11433 7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */, 11441 11434 7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */, … … 11467 11460 7A74ECB8101839A500BF939E /* InspectorBackend.cpp */, 11468 11461 7A74ECB9101839A600BF939E /* InspectorBackend.h */, 11469 7A74ECB61018399A00BF939E /* InspectorBackend.idl */,11470 11462 1C81B9580E97330800266E07 /* InspectorClient.h */, 11471 11463 1C81B9570E97330800266E07 /* InspectorController.cpp */, … … 18739 18731 C585A69711D4FB13004C3E4B /* JSIndexedDatabaseRequest.h in Headers */, 18740 18732 7A0E76DB10BF059800A0276E /* JSInjectedScriptHost.h in Headers */, 18741 41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */,18742 18733 7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */, 18743 18734 49EECF07105070C400099FAB /* JSInt16Array.h in Headers */, … … 21203 21194 7A0E76DA10BF059800A0276E /* JSInjectedScriptHost.cpp in Sources */, 21204 21195 7A0E76D510BF050700A0276E /* JSInjectedScriptHostCustom.cpp in Sources */, 21205 41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */,21206 21196 7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */, 21207 21197 7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */, -
trunk/WebCore/bindings/js/ScriptObject.cpp
r57738 r64124 38 38 #if ENABLE(INSPECTOR) 39 39 #include "JSInjectedScriptHost.h" 40 #include "JSInspectorBackend.h"41 40 #include "JSInspectorFrontendHost.h" 42 41 #endif … … 159 158 160 159 #if ENABLE(INSPECTOR) 161 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorBackend* value)162 {163 JSLock lock(SilenceAssertionsOnly);164 JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());165 globalObject->putDirect(Identifier(scriptState, name), toJS(scriptState, globalObject, value));166 return handleException(scriptState);167 }168 169 160 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value) 170 161 { -
trunk/WebCore/bindings/js/ScriptObject.h
r53766 r64124 40 40 namespace WebCore { 41 41 class InjectedScriptHost; 42 class InspectorBackend;43 42 class InspectorFrontendHost; 44 43 … … 71 70 static bool set(ScriptState*, const char* name, const ScriptObject&); 72 71 #if ENABLE(INSPECTOR) 73 static bool set(ScriptState*, const char* name, InspectorBackend*);74 72 static bool set(ScriptState*, const char* name, InspectorFrontendHost*); 75 73 static bool set(ScriptState*, const char* name, InjectedScriptHost*); -
trunk/WebCore/bindings/v8/ScriptObject.cpp
r54421 r64124 39 39 #include "V8Binding.h" 40 40 #include "V8InjectedScriptHost.h" 41 #include "V8InspectorBackend.h"42 41 #include "V8InspectorFrontendHost.h" 43 42 #include "V8Proxy.h" … … 147 146 148 147 #if ENABLE(INSPECTOR) 149 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorBackend* value)150 {151 ScriptScope scope(scriptState);152 scope.global()->Set(v8::String::New(name), toV8(value));153 return scope.success();154 }155 156 148 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value) 157 149 { -
trunk/WebCore/bindings/v8/ScriptObject.h
r53766 r64124 38 38 namespace WebCore { 39 39 class InjectedScriptHost; 40 class InspectorBackend;41 40 class InspectorFrontendHost; 42 41 class ScriptState; … … 70 69 public: 71 70 static bool set(ScriptState*, const char* name, const ScriptObject&); 72 static bool set(ScriptState*, const char* name, InspectorBackend*);73 71 static bool set(ScriptState*, const char* name, InspectorFrontendHost*); 74 72 static bool set(ScriptState*, const char* name, InjectedScriptHost*); -
trunk/WebCore/inspector/CodeGeneratorInspector.pm
r63967 r64124 165 165 my @backendHead; 166 166 push(@backendHead, " ${backendClassName}(InspectorBackend* inspectorBackend) : m_inspectorBackend(inspectorBackend) { }"); 167 push(@backendHead, " void dispatch(const String& message , String* exception);");167 push(@backendHead, " void dispatch(const String& message);"); 168 168 push(@backendHead, "private:"); 169 169 $backendConstructor = join("\n", @backendHead); … … 289 289 my @mapEntries = map("dispatchMap.add(\"$_\", &${backendClassName}::$_);", @methods); 290 290 291 push(@body, "void ${backendClassName}::dispatch(const String& message , String* exception)");291 push(@body, "void ${backendClassName}::dispatch(const String& message)"); 292 292 push(@body, "{"); 293 push(@body, " String exception;"); 293 294 push(@body, " typedef void (${backendClassName}::*CallHandler)(PassRefPtr<InspectorArray> args, String* exception);"); 294 295 push(@body, " typedef HashMap<String, CallHandler> DispatchMap;"); … … 301 302 push(@body, " if (!parsedMessage) {"); 302 303 push(@body, " ASSERT_NOT_REACHED();"); 303 push(@body, " *exception = \"Error: Invalid message format. Message should be in JSON format.\";");304 push(@body, " exception = \"Error: Invalid message format. Message should be in JSON format.\";"); 304 305 push(@body, " return;"); 305 306 push(@body, " }"); … … 308 309 push(@body, " if (!messageArray) {"); 309 310 push(@body, " ASSERT_NOT_REACHED();"); 310 push(@body, " *exception = \"Error: Invalid message format. The message should be a JSONified array of arguments.\";");311 push(@body, " exception = \"Error: Invalid message format. The message should be a JSONified array of arguments.\";"); 311 312 push(@body, " return;"); 312 313 push(@body, " }"); … … 314 315 push(@body, " if (!messageArray->length()) {"); 315 316 push(@body, " ASSERT_NOT_REACHED();"); 316 push(@body, " *exception = \"Error: Invalid message format. Empty message was received.\";");317 push(@body, " exception = \"Error: Invalid message format. Empty message was received.\";"); 317 318 push(@body, " return;"); 318 319 push(@body, " }"); … … 321 322 push(@body, " if (!messageArray->get(0)->asString(&methodName)) {"); 322 323 push(@body, " ASSERT_NOT_REACHED();"); 323 push(@body, " *exception = \"Error: Invalid message format. The first element of the message should be method name.\";");324 push(@body, " exception = \"Error: Invalid message format. The first element of the message should be method name.\";"); 324 325 push(@body, " return;"); 325 326 push(@body, " }"); … … 328 329 push(@body, " if (it == dispatchMap.end()) {"); 329 330 push(@body, " ASSERT_NOT_REACHED();"); 330 push(@body, " *exception = String::format(\"Error: Invalid method name. '%s' wasn't found.\", methodName.utf8().data());");331 push(@body, " exception = String::format(\"Error: Invalid method name. '%s' wasn't found.\", methodName.utf8().data());"); 331 332 push(@body, " return;"); 332 333 push(@body, " }"); 333 334 push(@body, ""); 334 push(@body, " ((*this).*it->second)(messageArray, exception);");335 push(@body, " ((*this).*it->second)(messageArray, &exception);"); 335 336 push(@body, "}"); 336 337 return @body; -
trunk/WebCore/inspector/InspectorFrontendClient.h
r57146 r64124 60 60 61 61 virtual void inspectedURLChanged(const String&) = 0; 62 63 virtual void sendMessageToBackend(const String&) = 0; 62 64 }; 63 65 -
trunk/WebCore/inspector/InspectorFrontendClientLocal.cpp
r63896 r64124 38 38 #include "Frame.h" 39 39 #include "FrameView.h" 40 #include "InspectorBackendDispatcher.h" 40 41 #include "InspectorController.h" 41 42 #include "InspectorFrontend.h" … … 73 74 // FIXME: don't keep reference to the script state 74 75 m_frontendScriptState = scriptStateFromPage(debuggerWorld(), m_frontendPage); 75 ScriptGlobalObject::set(m_frontendScriptState, "InspectorBackend", m_inspectorController->inspectorBackend());76 76 m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage); 77 77 ScriptGlobalObject::set(m_frontendScriptState, "InspectorFrontendHost", m_frontendHost.get()); … … 160 160 return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio))); 161 161 } 162 162 163 void InspectorFrontendClientLocal::sendMessageToBackend(const String& message) 164 { 165 m_inspectorController->inspectorBackendDispatcher()->dispatch(message); 166 } 167 163 168 } // namespace WebCore 164 169 -
trunk/WebCore/inspector/InspectorFrontendClientLocal.h
r57146 r64124 60 60 bool canAttachWindow(); 61 61 62 virtual void sendMessageToBackend(const String& message); 63 62 64 protected: 63 65 virtual void setAttachedWindowHeight(unsigned) = 0; -
trunk/WebCore/inspector/InspectorFrontendHost.cpp
r57429 r64124 208 208 } 209 209 210 void InspectorFrontendHost::sendMessageToBackend(const String& message) 211 { 212 m_client->sendMessageToBackend(message); 213 } 214 210 215 #if ENABLE(CONTEXT_MENUS) 211 216 void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMenuItem*>& items) -
trunk/WebCore/inspector/InspectorFrontendHost.h
r57429 r64124 76 76 // Called from [Custom] implementations. 77 77 void showContextMenu(Event*, const Vector<ContextMenuItem*>& items); 78 void sendMessageToBackend(const String& message); 78 79 79 80 private: -
trunk/WebCore/inspector/InspectorFrontendHost.idl
r57146 r64124 51 51 [Custom] DOMString port(); 52 52 [Custom] void showContextMenu(in MouseEvent event, in DOMObject items); 53 void sendMessageToBackend(in DOMString message); 53 54 }; 54 55 } -
trunk/WebCore/inspector/front-end/InspectorBackendStub.js
r63309 r64124 1 1 /* 2 * Copyright (C) 2009 Google Inc. All rights reserved.2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 33 33 WebInspector.InspectorBackendStub = function() 34 34 { 35 this._attachedWindowHeight = 0; 36 this._timelineEnabled = false; 35 this._registerDelegate("addInspectedNode"); 36 this._registerDelegate("addScriptToEvaluateOnLoad"); 37 this._registerDelegate("changeTagName"); 38 this._registerDelegate("clearConsoleMessages"); 39 this._registerDelegate("copyNode"); 40 this._registerDelegate("deleteCookie"); 41 this._registerDelegate("didEvaluateForTestInFrontend"); 42 this._registerDelegate("disableMonitoringXHR"); 43 this._registerDelegate("disableResourceTracking"); 44 this._registerDelegate("disableSearchingForNode"); 45 this._registerDelegate("disableTimeline"); 46 this._registerDelegate("dispatchOnInjectedScript"); 47 this._registerDelegate("enableMonitoringXHR"); 48 this._registerDelegate("enableResourceTracking"); 49 this._registerDelegate("enableSearchingForNode"); 50 this._registerDelegate("enableTimeline"); 51 this._registerDelegate("getChildNodes"); 52 this._registerDelegate("getCookies"); 53 this._registerDelegate("getDatabaseTableNames"); 54 this._registerDelegate("getDOMStorageEntries"); 55 this._registerDelegate("getEventListenersForNode"); 56 this._registerDelegate("getOuterHTML"); 57 this._registerDelegate("getProfile"); 58 this._registerDelegate("getProfileHeaders"); 59 this._registerDelegate("removeProfile"); 60 this._registerDelegate("clearProfiles"); 61 this._registerDelegate("getResourceContent"); 62 this._registerDelegate("highlightDOMNode"); 63 this._registerDelegate("hideDOMNodeHighlight"); 64 this._registerDelegate("performSearch"); 65 this._registerDelegate("pushNodeByPathToFrontend"); 66 this._registerDelegate("releaseWrapperObjectGroup"); 67 this._registerDelegate("removeAllScriptsToEvaluateOnLoad"); 68 this._registerDelegate("reloadPage"); 69 this._registerDelegate("removeAttribute"); 70 this._registerDelegate("removeDOMStorageItem"); 71 this._registerDelegate("removeNode"); 72 this._registerDelegate("saveApplicationSettings"); 73 this._registerDelegate("saveSessionSettings"); 74 this._registerDelegate("searchCanceled"); 75 this._registerDelegate("setAttribute"); 76 this._registerDelegate("setDOMStorageItem"); 77 this._registerDelegate("setInjectedScriptSource"); 78 this._registerDelegate("setOuterHTML"); 79 this._registerDelegate("setTextNodeValue"); 80 this._registerDelegate("startProfiling"); 81 this._registerDelegate("startTimelineProfiler"); 82 this._registerDelegate("stopProfiling"); 83 this._registerDelegate("stopTimelineProfiler"); 84 this._registerDelegate("storeLastActivePanel"); 85 this._registerDelegate("takeHeapSnapshot"); 86 87 this._registerDelegate("getAllStyles"); 88 this._registerDelegate("getStyles"); 89 this._registerDelegate("getComputedStyle"); 90 this._registerDelegate("getInlineStyle"); 91 this._registerDelegate("getStyleSheet"); 92 this._registerDelegate("getRuleRanges"); 93 this._registerDelegate("applyStyleText"); 94 this._registerDelegate("setStyleText"); 95 this._registerDelegate("setStyleProperty"); 96 this._registerDelegate("toggleStyleEnabled"); 97 this._registerDelegate("setRuleSelector"); 98 this._registerDelegate("addRule"); 99 100 this._registerDelegate("disableDebugger"); 101 this._registerDelegate("editScriptSource"); 102 this._registerDelegate("getScriptSource"); 103 this._registerDelegate("enableDebugger"); 104 this._registerDelegate("setBreakpoint"); 105 this._registerDelegate("removeBreakpoint"); 106 this._registerDelegate("activateBreakpoints"); 107 this._registerDelegate("deactivateBreakpoints"); 108 this._registerDelegate("resume"); 109 this._registerDelegate("stepIntoStatement"); 110 this._registerDelegate("stepOutOfFunction"); 111 this._registerDelegate("stepOverStatement"); 112 this._registerDelegate("setPauseOnExceptionsState"); 37 113 } 38 114 39 115 WebInspector.InspectorBackendStub.prototype = { 40 wrapCallback: function(func)116 _registerDelegate: function(methodName) 41 117 { 42 return func;118 this[methodName] = this.sendMessageToBackend.bind(this, methodName); 43 119 }, 44 120 45 closeWindow: function()121 sendMessageToBackend: function() 46 122 { 47 this._windowVisible = false; 48 }, 49 50 attach: function() 51 { 52 }, 53 54 detach: function() 55 { 56 }, 57 58 storeLastActivePanel: function(panel) 59 { 60 }, 61 62 clearConsoleMessages: function() 63 { 64 }, 65 66 getOuterHTML: function() 67 { 68 }, 69 70 setOuterHTML: function() 71 { 72 }, 73 74 addInspectedNode: function() 75 { 76 }, 77 78 search: function(sourceRow, query) 79 { 80 }, 81 82 moveByUnrestricted: function(x, y) 83 { 84 }, 85 86 getResourceContent: function(callId, identifier) 87 { 88 WebInspector.didGetResourceContent(callId, ""); 89 }, 90 91 highlightDOMNode: function(node) 92 { 93 }, 94 95 hideDOMNodeHighlight: function() 96 { 97 }, 98 99 inspectedWindow: function() 100 { 101 return window; 102 }, 103 104 loaded: function() 105 { 106 }, 107 108 localizedStringsURL: function() 109 { 110 return undefined; 111 }, 112 113 windowUnloading: function() 114 { 115 return false; 116 }, 117 118 hiddenPanels: function() 119 { 120 return ""; 121 }, 122 123 enableResourceTracking: function() 124 { 125 WebInspector.resourceTrackingWasEnabled(); 126 }, 127 128 disableResourceTracking: function() 129 { 130 WebInspector.resourceTrackingWasDisabled(); 131 }, 132 133 134 enableSearchingForNode: function() 135 { 136 WebInspector.searchingForNodeWasEnabled(); 137 }, 138 139 disableSearchingForNode: function() 140 { 141 WebInspector.searchingForNodeWasDisabled(); 142 }, 143 144 enableMonitoringXHR: function() 145 { 146 WebInspector.monitoringXHRWasEnabled(); 147 }, 148 149 disableMonitoringXHR: function() 150 { 151 WebInspector.monitoringXHRWasDisabled(); 152 }, 153 154 reloadPage: function() 155 { 156 }, 157 158 enableDebugger: function() 159 { 160 WebInspector.debuggerWasEnabled(); 161 }, 162 163 disableDebugger: function() 164 { 165 WebInspector.debuggerWasDisabled(); 166 }, 167 168 setBreakpoint: function(callId, sourceID, line, enabled, condition) 169 { 170 WebInspector.didSetBreakpoint(callId, true, line); 171 }, 172 173 removeBreakpoint: function(sourceID, line) 174 { 175 }, 176 177 activateBreakpoints: function() 178 { 179 this._breakpointsActivated = true; 180 }, 181 182 deactivateBreakpoints: function() 183 { 184 this._breakpointsActivated = false; 185 }, 186 187 pause: function() 188 { 189 }, 190 191 setPauseOnExceptionsState: function(value) 192 { 193 WebInspector.updatePauseOnExceptionsState(value); 194 }, 195 196 editScriptSource: function() 197 { 198 WebInspector.didEditScriptSource(callId, false); 199 }, 200 201 getScriptSource: function(callId, sourceID) 202 { 203 WebInspector.didGetScriptSource(callId, null); 204 }, 205 206 resume: function() 207 { 208 }, 209 210 enableProfiler: function() 211 { 212 WebInspector.profilerWasEnabled(); 213 }, 214 215 disableProfiler: function() 216 { 217 WebInspector.profilerWasDisabled(); 218 }, 219 220 startProfiling: function() 221 { 222 }, 223 224 stopProfiling: function() 225 { 226 }, 227 228 getProfileHeaders: function(callId) 229 { 230 WebInspector.didGetProfileHeaders(callId, []); 231 }, 232 233 getProfile: function(callId, uid) 234 { 235 }, 236 237 takeHeapSnapshot: function() 238 { 239 }, 240 241 databaseTableNames: function(database) 242 { 243 return []; 244 }, 245 246 stepIntoStatement: function() 247 { 248 }, 249 250 stepOutOfFunction: function() 251 { 252 }, 253 254 stepOverStatement: function() 255 { 256 }, 257 258 saveApplicationSettings: function() 259 { 260 }, 261 262 saveSessionSettings: function() 263 { 264 }, 265 266 dispatchOnInjectedScript: function() 267 { 268 }, 269 270 releaseWrapperObjectGroup: function() 271 { 272 }, 273 274 setInjectedScriptSource: function() 275 { 276 }, 277 278 addScriptToEvaluateOnLoad: function() 279 { 280 }, 281 282 removeAllScriptsToEvaluateOnLoad: function() 283 { 284 }, 285 286 performSearch: function() 287 { 288 }, 289 290 searchCanceled: function() 291 { 123 var message = JSON.stringify(Array.prototype.slice.call(arguments)); 124 if (WebInspector._paramsObject && "page" in WebInspector._paramsObject) 125 WebInspector.socket.send(message); 126 else 127 InspectorFrontendHost.sendMessageToBackend(message); 292 128 } 293 129 } -
trunk/WebKit/chromium/ChangeLog
r64113 r64124 1 2010-07-27 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: Current implementation of message based inspector 6 transport generated by CodeGeneratorInspector should be upstreamed 7 from WebKit/chromium to WebCore. 8 https://bugs.webkit.org/show_bug.cgi?id=42983 9 10 * WebKit.gypi: 11 * src/InspectorFrontendClientImpl.cpp: 12 (WebKit::InspectorFrontendClientImpl::sendMessageToBackend): 13 * src/InspectorFrontendClientImpl.h: 14 * src/ToolsAgent.h: 15 * src/WebDevToolsAgentImpl.cpp: 16 (WebKit::WebDevToolsAgentImpl::dispatchOnInspectorController): 17 (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost): 18 * src/WebDevToolsAgentImpl.h: 19 * src/js/InspectorControllerImpl.js: Removed. 20 1 21 2010-07-27 Dominic Mazzoni <dmazzoni@google.com> 2 22 -
trunk/WebKit/chromium/WebKit.gypi
r63311 r64124 34 34 # for copying them to resource dir, and for generating 'devtools.html' file. 35 35 'devtools_js_files': [ 36 'src/js/InspectorControllerImpl.js',37 36 'src/js/ProfilerAgent.js', 38 37 'src/js/ProfilerProcessor.js', -
trunk/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
r63311 r64124 125 125 } 126 126 127 void InspectorFrontendClientImpl::sendMessageToBackend(const String& message) 128 { 129 WebDevToolsMessageData messageData; 130 messageData.className = "ToolsAgent"; 131 messageData.methodName = "dispatchOnInspectorController"; 132 WebVector<WebString> args(static_cast<size_t>(1)); 133 args[0] = message; 134 messageData.arguments.swap(args); 135 m_client->sendMessageToAgent(messageData); 136 } 137 127 138 } // namespace WebKit -
trunk/WebKit/chromium/src/InspectorFrontendClientImpl.h
r57146 r64124 69 69 virtual void inspectedURLChanged(const WebCore::String&); 70 70 71 virtual void sendMessageToBackend(const WebCore::String&); 71 72 private: 72 73 WebCore::Page* m_frontendPage; -
trunk/WebKit/chromium/src/ToolsAgent.h
r63965 r64124 40 40 #define TOOLS_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ 41 41 /* Dispatches given function on the InspectorController object */ \ 42 METHOD2(dispatchOnInspectorController, int /* call_id */, \ 43 String /* message */) \ 42 METHOD1(dispatchOnInspectorController, String /* message */) \ 44 43 45 44 DEFINE_RPC_CLASS(ToolsAgent, TOOLS_AGENT_STRUCT) -
trunk/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
r63965 r64124 56 56 #include "ScriptValue.h" 57 57 #include "V8Binding.h" 58 #include "V8InspectorBackend.h"59 58 #include "V8Proxy.h" 60 59 #include "V8Utilities.h" … … 94 93 using WebCore::String; 95 94 using WebCore::V8DOMWrapper; 96 using WebCore::V8InspectorBackend;97 95 using WebCore::V8Proxy; 98 96 … … 310 308 } 311 309 312 void WebDevToolsAgentImpl::dispatchOnInspectorController(int callId, const String& message) 313 { 314 String exception; 315 inspectorController()->inspectorBackendDispatcher()->dispatch(message, &exception); 316 m_toolsAgentDelegateStub->didDispatchOn(callId, "", exception); 310 void WebDevToolsAgentImpl::dispatchOnInspectorController(const String& message) 311 { 312 inspectorController()->inspectorBackendDispatcher()->dispatch(message); 317 313 } 318 314 … … 376 372 WebDevToolsAgentImpl::jsDispatchOnClient); 377 373 devtoolsAgentHost.build(); 378 379 v8::HandleScope scope;380 v8::Context::Scope utilityScope(m_utilityContext);381 // Call custom code to create inspector backend wrapper in the utility context382 // instead of calling V8DOMWrapper::convertToV8Object that would create the383 // wrapper in the Page main frame context.384 v8::Handle<v8::Object> backendWrapper = createInspectorBackendV8Wrapper();385 if (backendWrapper.IsEmpty())386 return;387 m_utilityContext->Global()->Set(v8::String::New("InspectorBackend"), backendWrapper);388 }389 390 v8::Local<v8::Object> WebDevToolsAgentImpl::createInspectorBackendV8Wrapper()391 {392 v8::Handle<v8::Function> function = V8InspectorBackend::GetTemplate()->GetFunction();393 if (function.IsEmpty()) {394 // Return if allocation failed.395 return v8::Local<v8::Object>();396 }397 v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);398 if (instance.IsEmpty()) {399 // Avoid setting the wrapper if allocation failed.400 return v8::Local<v8::Object>();401 }402 InspectorBackend* backend = m_webViewImpl->page()->inspectorController()->inspectorBackend();403 V8DOMWrapper::setDOMWrapper(instance, &V8InspectorBackend::info, backend);404 // Create a weak reference to the v8 wrapper of InspectorBackend to deref405 // InspectorBackend when the wrapper is garbage collected.406 backend->ref();407 v8::Persistent<v8::Object> weakHandle = v8::Persistent<v8::Object>::New(instance);408 weakHandle.MakeWeak(backend, &InspectorBackendWeakReferenceCallback);409 return instance;410 374 } 411 375 -
trunk/WebKit/chromium/src/WebDevToolsAgentImpl.h
r63965 r64124 73 73 74 74 // ToolsAgent implementation. 75 virtual void dispatchOnInspectorController( int callId,const WebCore::String& message);75 virtual void dispatchOnInspectorController(const WebCore::String& message); 76 76 77 77 // WebDevToolsAgentPrivate implementation. … … 128 128 WebCore::InspectorController* inspectorController(); 129 129 130 // Creates InspectorBackend v8 wrapper in the utility context so that it's131 // methods prototype is Function.protoype object from the utility context.132 // Otherwise some useful methods defined on Function.prototype(such as bind)133 // are missing for InspectorController native methods.134 v8::Local<v8::Object> createInspectorBackendV8Wrapper();135 136 130 int m_hostId; 137 131 WebDevToolsAgentClient* m_client;
Note: See TracChangeset
for help on using the changeset viewer.