Changeset 89127 in webkit
- Timestamp:
- Jun 17, 2011 1:19:26 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89122 r89127 1 2011-06-16 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: return description of the changes applied in response to editScriptSource command 6 https://bugs.webkit.org/show_bug.cgi?id=62801 7 8 Return description of the changes made in response to Debugger.editScriptSource command. 9 10 * bindings/js/ScriptDebugServer.cpp: 11 (WebCore::ScriptDebugServer::editScriptSource): 12 * bindings/js/ScriptDebugServer.h: 13 * bindings/v8/DebuggerScript.js: 14 (): 15 * bindings/v8/ScriptDebugServer.cpp: 16 (WebCore::ScriptDebugServer::editScriptSource): 17 * bindings/v8/ScriptDebugServer.h: 18 * inspector/Inspector.json: 19 1 20 2011-06-16 Gabor Loki <loki@webkit.org> 2 21 -
trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp
r86756 r89127 191 191 } 192 192 193 bool ScriptDebugServer::editScriptSource(const String&, const String&, String*, ScriptValue* )193 bool ScriptDebugServer::editScriptSource(const String&, const String&, String*, ScriptValue*, ScriptObject*) 194 194 { 195 195 // FIXME(40300): implement this. -
trunk/Source/WebCore/bindings/js/ScriptDebugServer.h
r85035 r89127 53 53 class JavaScriptCallFrame; 54 54 class ScriptDebugListener; 55 class ScriptObject; 55 56 class ScriptValue; 56 57 … … 80 81 void stepOutOfFunction(); 81 82 82 bool editScriptSource(const String& sourceID, const String& newContent, String* error, ScriptValue* newCallFrames );83 bool editScriptSource(const String& sourceID, const String& newContent, String* error, ScriptValue* newCallFrames, ScriptObject* result); 83 84 84 85 void recompileAllJSFunctionsSoon(); -
trunk/Source/WebCore/bindings/v8/DebuggerScript.js
r85320 r89127 188 188 189 189 var changeLog = []; 190 Debug.LiveEdit.SetScriptSource(scriptToEdit, newSource, false, changeLog); 191 return scriptToEdit.source; 190 return Debug.LiveEdit.SetScriptSource(scriptToEdit, newSource, false, changeLog); 192 191 } 193 192 -
trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
r87280 r89127 37 37 #include "JavaScriptCallFrame.h" 38 38 #include "ScriptDebugListener.h" 39 #include "ScriptObject.h" 39 40 #include "V8Binding.h" 40 41 #include "V8JavaScriptCallFrame.h" … … 212 213 } 213 214 214 bool ScriptDebugServer::editScriptSource(const String& sourceID, const String& newContent, String* error, ScriptValue* newCallFrames )215 bool ScriptDebugServer::editScriptSource(const String& sourceID, const String& newContent, String* error, ScriptValue* newCallFrames, ScriptObject* result) 215 216 { 216 217 ensureDebuggerScriptCompiled(); … … 226 227 v8::TryCatch tryCatch; 227 228 tryCatch.SetVerbose(false); 228 v8::Handle<v8::Value> result = function->Call(m_debuggerScript.get(), 2, argv);229 v8::Handle<v8::Value> v8result = function->Call(m_debuggerScript.get(), 2, argv); 229 230 if (tryCatch.HasCaught()) { 230 231 v8::Local<v8::Message> message = tryCatch.Message(); … … 235 236 return false; 236 237 } 237 ASSERT(!result.IsEmpty()); 238 ASSERT(!v8result.IsEmpty()); 239 if (v8result->IsObject()) 240 *result = ScriptObject(ScriptState::current(), v8result->ToObject()); 238 241 239 242 // Call stack may have changed after if the edited function was on the stack. -
trunk/Source/WebCore/bindings/v8/ScriptDebugServer.h
r85035 r89127 47 47 48 48 class ScriptDebugListener; 49 class ScriptObject; 49 50 class ScriptValue; 50 51 … … 74 75 void stepOutOfFunction(); 75 76 76 bool editScriptSource(const String& sourceID, const String& newContent, String* error, ScriptValue* newCallFrames );77 bool editScriptSource(const String& sourceID, const String& newContent, String* error, ScriptValue* newCallFrames, ScriptObject* result); 77 78 78 79 void recompileAllJSFunctionsSoon() { } -
trunk/Source/WebCore/inspector/Inspector.json
r89036 r89127 1495 1495 ], 1496 1496 "returns": [ 1497 { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame"}, "description": "New stack trace in case editing has happened while VM was stopped." } 1497 { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame"}, "description": "New stack trace in case editing has happened while VM was stopped." }, 1498 { "name": "result", "type": "object", "optional": true, "description": "VM-specific description of the changes applied." } 1498 1499 ], 1499 1500 "description": "Edits JavaScript script live." -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
r86756 r89127 286 286 } 287 287 288 void InspectorDebuggerAgent::editScriptSource(ErrorString* error, const String& sourceId, const String& newContent, RefPtr<InspectorArray>* newCallFrames) 289 { 290 if (scriptDebugServer().editScriptSource(sourceId, newContent, error, &m_currentCallStack)) 291 *newCallFrames = currentCallFrames(); 288 static PassRefPtr<InspectorObject> scriptToInspectorObject(ScriptObject scriptObject) 289 { 290 if (scriptObject.hasNoValue()) 291 return 0; 292 RefPtr<InspectorValue> value = scriptObject.toInspectorValue(scriptObject.scriptState()); 293 if (!value) 294 return 0; 295 return value->asObject(); 296 } 297 298 void InspectorDebuggerAgent::editScriptSource(ErrorString* error, const String& sourceId, const String& newContent, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result) 299 { 300 ScriptObject resultObject; 301 if (!scriptDebugServer().editScriptSource(sourceId, newContent, error, &m_currentCallStack, &resultObject)) 302 return; 303 *newCallFrames = currentCallFrames(); 304 RefPtr<InspectorObject> object = scriptToInspectorObject(resultObject); 305 if (object) 306 *result = object; 292 307 } 293 308 -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h
r86756 r89127 86 86 void continueToLocation(ErrorString*, PassRefPtr<InspectorObject> location); 87 87 88 void editScriptSource(ErrorString*, const String& sourceId, const String& newContent, RefPtr<InspectorArray>* newCallFrames );88 void editScriptSource(ErrorString*, const String& sourceId, const String& newContent, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result); 89 89 void getScriptSource(ErrorString*, const String& sourceId, String* scriptSource); 90 90 void schedulePauseOnNextStatement(DebuggerEventType type, PassRefPtr<InspectorValue> data);
Note: See TracChangeset
for help on using the changeset viewer.