Changeset 64653 in webkit
- Timestamp:
- Aug 4, 2010 8:26:33 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64651 r64653 1 2010-08-04 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: use InspectorValue to push dispatch results from the injected script 6 https://bugs.webkit.org/show_bug.cgi?id=43483 7 8 * bindings/js/JSInjectedScriptHostCustom.cpp: 9 (WebCore::JSInjectedScriptHost::reportDidDispatchOnInjectedScript): 10 * bindings/v8/custom/V8InjectedScriptHostCustom.cpp: 11 (WebCore::V8InjectedScriptHost::reportDidDispatchOnInjectedScriptCallback): 12 * inspector/InjectedScript.cpp: 13 (WebCore::InjectedScript::dispatch): 14 * inspector/InjectedScript.h: 15 * inspector/InjectedScriptHost.cpp: 16 (WebCore::InjectedScriptHost::reportDidDispatchOnInjectedScript): 17 (WebCore::InjectedScriptHost::remoteFrontend): 18 * inspector/InjectedScriptHost.h: 19 * inspector/Inspector.idl: 20 * inspector/InspectorBackend.cpp: 21 (WebCore::InspectorBackend::dispatchOnInjectedScript): 22 * inspector/InspectorController.cpp: 23 (WebCore::InspectorController::didContinue): 24 * inspector/InspectorFrontend.cpp: 25 * inspector/InspectorFrontend.h: 26 1 27 2010-08-04 Abhishek Arya <inferno@chromium.org> 2 28 -
trunk/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
r60631 r64653 49 49 #include "InspectorController.h" 50 50 #include "InspectorResource.h" 51 #include "InspectorValues.h" 51 52 #include "JSDOMWindow.h" 52 53 #include "JSDOMWindowCustom.h" … … 56 57 #include "Page.h" 57 58 #if ENABLE(DOM_STORAGE) 58 #include "SerializedScriptValue.h"59 59 #include "Storage.h" 60 60 #include "JSStorage.h" … … 202 202 int callId = exec->argument(0).asInt32(); 203 203 204 RefPtr< SerializedScriptValue> result(SerializedScriptValue::create(exec, exec->argument(1)));204 RefPtr<InspectorValue> result = ScriptValue(exec->argument(1)).toInspectorValue(exec); 205 205 206 206 bool isException; 207 207 if (!exec->argument(2).getBoolean(isException)) 208 208 return jsUndefined(); 209 impl()->reportDidDispatchOnInjectedScript(callId, result .get(), isException);209 impl()->reportDidDispatchOnInjectedScript(callId, result, isException); 210 210 return jsUndefined(); 211 211 } -
trunk/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
r58166 r64653 38 38 #include "InjectedScriptHost.h" 39 39 #include "InspectorController.h" 40 #include "InspectorValues.h" 40 41 #include "Node.h" 41 42 #include "Page.h" 42 43 #include "ScriptDebugServer.h" 43 #include "SerializedScriptValue.h"44 44 45 45 #include "V8Binding.h" … … 216 216 InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder()); 217 217 int callId = args[0]->ToInt32()->Value(); 218 RefPtr< SerializedScriptValue> result(SerializedScriptValue::create(args[1]));218 RefPtr<InspectorValue> result = ScriptValue(args[1]).toInspectorValue(ScriptState::current()); 219 219 bool isException = args[2]->ToBoolean()->Value(); 220 host->reportDidDispatchOnInjectedScript(callId, result .get(), isException);220 host->reportDidDispatchOnInjectedScript(callId, result, isException); 221 221 return v8::Undefined(); 222 222 } -
trunk/WebCore/inspector/InjectedScript.cpp
r64540 r64653 36 36 #include "InspectorValues.h" 37 37 #include "PlatformString.h" 38 #include "SerializedScriptValue.h"39 38 #include "ScriptFunctionCall.h" 40 39 … … 46 45 } 47 46 48 void InjectedScript::dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr< SerializedScriptValue>* result, bool* hadException)47 void InjectedScript::dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<InspectorValue>* result, bool* hadException) 49 48 { 50 49 ASSERT(!hasNoValue()); … … 62 61 ScriptValue resultValue = function.call(*hadException); 63 62 if (!*hadException) 64 *result = resultValue. serialize(m_injectedScriptObject.scriptState());63 *result = resultValue.toInspectorValue(m_injectedScriptObject.scriptState()); 65 64 } 66 65 -
trunk/WebCore/inspector/InjectedScript.h
r64540 r64653 40 40 41 41 class InspectorValue; 42 class SerializedScriptValue;43 42 class String; 44 43 … … 50 49 bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); } 51 50 52 void dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr< SerializedScriptValue>* result, bool* hadException);51 void dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<InspectorValue>* result, bool* hadException); 53 52 #if ENABLE(JAVASCRIPT_DEBUGGER) 54 53 PassRefPtr<InspectorValue> callFrames(); -
trunk/WebCore/inspector/InjectedScriptHost.cpp
r61655 r64653 46 46 #include "InspectorResource.h" 47 47 #include "Pasteboard.h" 48 #include "RemoteInspectorFrontend.h" 48 49 49 50 #if ENABLE(JAVASCRIPT_DEBUGGER) … … 143 144 #endif 144 145 145 void InjectedScriptHost::reportDidDispatchOnInjectedScript(long callId, SerializedScriptValue*result, bool isException)146 { 147 if ( InspectorFrontend* frontend = inspectorFrontend())146 void InjectedScriptHost::reportDidDispatchOnInjectedScript(long callId, PassRefPtr<InspectorValue> result, bool isException) 147 { 148 if (RemoteInspectorFrontend* frontend = remoteFrontend()) 148 149 frontend->didDispatchOnInjectedScript(callId, result, isException); 149 150 } … … 186 187 } 187 188 189 RemoteInspectorFrontend* InjectedScriptHost::remoteFrontend() 190 { 191 if (!m_inspectorController) 192 return 0; 193 return m_inspectorController->m_remoteFrontend.get(); 194 } 195 188 196 pair<long, ScriptObject> InjectedScriptHost::injectScript(const String& source, ScriptState* scriptState) 189 197 { -
trunk/WebCore/inspector/InjectedScriptHost.h
r61655 r64653 46 46 class InspectorFrontend; 47 47 class Node; 48 class SerializedScriptValue;48 class RemoteInspectorFrontend; 49 49 class Storage; 50 50 … … 83 83 void didDestroyWorker(long id); 84 84 #endif 85 void reportDidDispatchOnInjectedScript(long callId, SerializedScriptValue*result, bool isException);85 void reportDidDispatchOnInjectedScript(long callId, PassRefPtr<InspectorValue> result, bool isException); 86 86 87 87 pair<long, ScriptObject> injectScript(const String& source, ScriptState*); … … 97 97 InspectorDOMAgent* inspectorDOMAgent(); 98 98 InspectorFrontend* inspectorFrontend(); 99 RemoteInspectorFrontend* remoteFrontend(); 99 100 ScriptObject createInjectedScript(const String& source, ScriptState* scriptState, long id); 100 101 -
trunk/WebCore/inspector/Inspector.idl
r64650 r64653 113 113 #endif 114 114 [handler=Backend] void setInjectedScriptSource(in String scriptSource); 115 [handler=Backend] void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in String methodName, in String arguments, in boolean async); 116 115 [handler=Backend] void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in String methodName, in String arguments, in boolean async, out Value result, out boolean isException); 117 116 [handler=Controller] void addScriptToEvaluateOnLoad(in String scriptSource); 118 117 [handler=Controller] void removeAllScriptsToEvaluateOnLoad(); -
trunk/WebCore/inspector/InspectorBackend.cpp
r64650 r64653 95 95 void InspectorBackend::dispatchOnInjectedScript(long callId, long injectedScriptId, const String& methodName, const String& arguments, bool async) 96 96 { 97 InspectorFrontend* frontend = inspectorFrontend();97 RemoteInspectorFrontend* frontend = remoteFrontend(); 98 98 if (!frontend) 99 99 return; … … 111 111 return; 112 112 113 RefPtr< SerializedScriptValue> result;113 RefPtr<InspectorValue> result; 114 114 bool hadException = false; 115 115 injectedScript.dispatch(callId, methodName, arguments, async, &result, &hadException); 116 116 if (async) 117 117 return; // InjectedScript will return result asynchronously by means of ::reportDidDispatchOnInjectedScript. 118 frontend->didDispatchOnInjectedScript(callId, result .get(), hadException);118 frontend->didDispatchOnInjectedScript(callId, result, hadException); 119 119 } 120 120 -
trunk/WebCore/inspector/InspectorController.cpp
r64650 r64653 1857 1857 { 1858 1858 m_pausedScriptState = 0; 1859 m_ frontend->resumedScript();1859 m_remoteFrontend->resumedScript(); 1860 1860 } 1861 1861 -
trunk/WebCore/inspector/InspectorFrontend.cpp
r64650 r64653 45 45 #include "ScriptString.h" 46 46 #include "ScriptValue.h" 47 #include "SerializedScriptValue.h"48 47 #include <wtf/OwnPtr.h> 49 48 … … 287 286 } 288 287 289 void InspectorFrontend::pausedScript(SerializedScriptValue* callFrames)290 {291 ScriptValue callFramesValue = ScriptValue::deserialize(scriptState(), callFrames);292 ScriptFunctionCall function(m_webInspector, "dispatch");293 function.appendArgument("pausedScript");294 function.appendArgument(callFramesValue);295 function.call();296 }297 298 void InspectorFrontend::resumedScript()299 {300 callSimpleFunction("resumedScript");301 }302 303 288 void InspectorFrontend::profilerWasEnabled() 304 289 { … … 365 350 function.appendArgument(cookies); 366 351 function.appendArgument(cookiesString); 367 function.call();368 }369 370 void InspectorFrontend::didDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException)371 {372 ScriptFunctionCall function(m_webInspector, "dispatch");373 function.appendArgument("didDispatchOnInjectedScript");374 function.appendArgument(callId);375 if (isException)376 function.appendArgument("");377 else {378 ScriptValue resultValue = ScriptValue::deserialize(scriptState(), result);379 function.appendArgument(resultValue);380 }381 function.appendArgument(isException);382 352 function.call(); 383 353 } -
trunk/WebCore/inspector/InspectorFrontend.h
r64650 r64653 39 39 namespace WebCore { 40 40 class ConsoleMessage; 41 class Database;42 41 class Frame; 43 42 class InspectorClient; … … 46 45 class Node; 47 46 class ScriptString; 48 class SerializedScriptValue;49 47 class Storage; 50 48 … … 98 96 void restoredBreakpoint(const String& sourceID, const String& url, int line, bool enabled, const String& condition); 99 97 void failedToParseScriptSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage); 100 void pausedScript(SerializedScriptValue* callFrames);101 void resumedScript();102 98 103 99 void profilerWasEnabled(); … … 133 129 134 130 void didGetCookies(long callId, const ScriptArray& cookies, const String& cookiesString); 135 void didDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException);136 131 137 132 void contextMenuItemSelected(int itemId);
Note: See TracChangeset
for help on using the changeset viewer.