Changeset 83601 in webkit
- Timestamp:
- Apr 12, 2011 10:07:33 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83600 r83601 1 2011-04-12 Pavel Feldman <pfeldman@google.com> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: remove scriptWorldType from the protocol. 6 https://bugs.webkit.org/show_bug.cgi?id=58324 7 8 * inspector/Inspector.json: 9 * inspector/InspectorDebuggerAgent.cpp: 10 (WebCore::InspectorDebuggerAgent::didParseSource): 11 * inspector/ScriptDebugListener.h: 12 (WebCore::ScriptDebugListener::~ScriptDebugListener): 13 * inspector/front-end/DebuggerModel.js: 14 (WebInspector.DebuggerModel.prototype._parsedScriptSource): 15 (WebInspector.DebuggerDispatcher.prototype.scriptParsed): 16 * inspector/front-end/Script.js: 17 (WebInspector.Script): 18 * inspector/front-end/ScriptsPanel.js: 19 * inspector/front-end/SourceFile.js: 20 (WebInspector.SourceFile): 21 1 22 2011-04-11 Dimitri Glazkov <dglazkov@chromium.org> 2 23 -
trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp
r83190 r83601 215 215 } 216 216 217 void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, SourceProvider* sourceProvider, ScriptWorldType worldType)217 void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, SourceProvider* sourceProvider, bool isContentScript) 218 218 { 219 219 String sourceID = ustringToString(JSC::UString::number(sourceProvider->asID())); … … 226 226 copyToVector(listeners, copy); 227 227 for (size_t i = 0; i < copy.size(); ++i) 228 copy[i]->didParseSource(sourceID, url, data, lineOffset, columnOffset, worldType);228 copy[i]->didParseSource(sourceID, url, data, lineOffset, columnOffset, isContentScript); 229 229 } 230 230 … … 241 241 } 242 242 243 static ScriptWorldType currentWorldType(ExecState* exec) 244 { 245 if (currentWorld(exec) == mainThreadNormalWorld()) 246 return MAIN_WORLD; 247 return EXTENSIONS_WORLD; 243 static bool isContentScript(ExecState* exec) 244 { 245 return currentWorld(exec) != mainThreadNormalWorld(); 248 246 } 249 247 … … 276 274 if (isError) 277 275 dispatchFailedToParseSource(*listeners, sourceProvider, errorLine, ustringToString(errorMessage)); 278 else { 279 ScriptWorldType worldType = currentWorldType(exec); 280 dispatchDidParseSource(*listeners, sourceProvider, worldType); 281 } 276 else 277 dispatchDidParseSource(*listeners, sourceProvider, isContentScript(exec)); 282 278 283 279 m_callingListeners = false; -
trunk/Source/WebCore/bindings/js/ScriptDebugServer.h
r82590 r83601 103 103 void dispatchDidPause(ScriptDebugListener*); 104 104 void dispatchDidContinue(ScriptDebugListener*); 105 void dispatchDidParseSource(const ListenerSet& listeners, JSC::SourceProvider*, enum ScriptWorldType);105 void dispatchDidParseSource(const ListenerSet& listeners, JSC::SourceProvider*, bool isContentScript); 106 106 void dispatchFailedToParseSource(const ListenerSet& listeners, JSC::SourceProvider*, int errorLine, const String& errorMessage); 107 107 -
trunk/Source/WebCore/bindings/v8/DebuggerScript.js
r83290 r83601 39 39 }; 40 40 41 DebuggerScript.ScriptWorldType = {42 MainWorld : 0,43 ExtensionsWorld : 144 };45 46 41 DebuggerScript._pauseOnExceptionsState = DebuggerScript.PauseOnExceptionsState.DontPauseOnExceptions; 47 42 Debug.clearBreakOnException(); … … 77 72 DebuggerScript._formatScript = function(script) 78 73 { 79 var scriptWorldType = DebuggerScript.ScriptWorldType.MainWorld;80 if (script.context_data && script.context_data.indexOf("injected") == 0)81 scriptWorldType = DebuggerScript.ScriptWorldType.ExtensionsWorld;82 74 return { 83 75 id: script.id, … … 86 78 lineOffset: script.line_offset, 87 79 columnOffset: script.column_offset, 88 scriptWorldType: scriptWorldType80 isContentScript: !!script.context_data && script.context_data.indexOf("injected") == 0 89 81 }; 90 82 } -
trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
r83290 r83601 352 352 object->Get(v8::String::New("lineOffset"))->ToInteger()->Value(), 353 353 object->Get(v8::String::New("columnOffset"))->ToInteger()->Value(), 354 static_cast<ScriptWorldType>(object->Get(v8::String::New("scriptWorldType"))->Int32Value()));354 object->Get(v8::String::New("isContentScript"))->ToBoolean()->Value()); 355 355 } 356 356 -
trunk/Source/WebCore/inspector/Inspector.json
r83599 r83601 1455 1455 { "name": "columnOffset", "type": "integer", "description": "Column offset of the script within the resource with given URL." }, 1456 1456 { "name": "length", "type": "integer", "description": "Length of the script" }, 1457 { "name": " scriptWorldType", "type": "integer", "description": "Script type. // FIXME." }1457 { "name": "isContentScript", "type": "boolean", "optional": true, "description": "Determines whether this script is a user extension script." } 1458 1458 ], 1459 1459 "description": "Fired when virtual machine parses script. This even is also fired for all known scripts upon enabling debugger." -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
r83434 r83601 375 375 // JavaScriptDebugListener functions 376 376 377 void InspectorDebuggerAgent::didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, ScriptWorldType worldType)377 void InspectorDebuggerAgent::didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, bool isContentScript) 378 378 { 379 379 // Don't send script content to the front end until it's really needed. 380 m_frontend->scriptParsed(sourceID, url, lineOffset, columnOffset, data.length(), worldType);380 m_frontend->scriptParsed(sourceID, url, lineOffset, columnOffset, data.length(), isContentScript); 381 381 382 382 m_scripts.set(sourceID, Script(url, data, lineOffset, columnOffset)); -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h
r83290 r83601 120 120 PassRefPtr<InspectorArray> currentCallFrames(); 121 121 122 virtual void didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, ScriptWorldType);122 virtual void didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, bool isContentScript); 123 123 virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage); 124 124 virtual void didPause(ScriptState*); -
trunk/Source/WebCore/inspector/ScriptDebugListener.h
r75794 r83601 38 38 namespace WebCore { 39 39 40 enum ScriptWorldType {41 MAIN_WORLD = 0,42 EXTENSIONS_WORLD43 };44 45 40 class ScriptDebugListener { 46 41 public: 47 42 virtual ~ScriptDebugListener() { } 48 43 49 virtual void didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, ScriptWorldType) = 0;44 virtual void didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, bool isContentScript) = 0; 50 45 virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) = 0; 51 46 virtual void didPause(ScriptState*) = 0; -
trunk/Source/WebCore/inspector/front-end/DebuggerModel.js
r83290 r83601 180 180 }, 181 181 182 _parsedScriptSource: function(sourceID, sourceURL, lineOffset, columnOffset, length, scriptWorldType)183 { 184 var script = new WebInspector.Script(sourceID, sourceURL, lineOffset, columnOffset, length, undefined, undefined, scriptWorldType);182 _parsedScriptSource: function(sourceID, sourceURL, lineOffset, columnOffset, length, isContentScript) 183 { 184 var script = new WebInspector.Script(sourceID, sourceURL, lineOffset, columnOffset, length, undefined, undefined, isContentScript); 185 185 this._scripts[sourceID] = script; 186 186 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, script); … … 228 228 }, 229 229 230 scriptParsed: function(sourceID, sourceURL, lineOffset, columnOffset, length, scriptWorldType)231 { 232 this._debuggerModel._parsedScriptSource(sourceID, sourceURL, lineOffset, columnOffset, length, scriptWorldType);230 scriptParsed: function(sourceID, sourceURL, lineOffset, columnOffset, length, isContentScript) 231 { 232 this._debuggerModel._parsedScriptSource(sourceID, sourceURL, lineOffset, columnOffset, length, isContentScript); 233 233 }, 234 234 -
trunk/Source/WebCore/inspector/front-end/Script.js
r82683 r83601 24 24 */ 25 25 26 WebInspector.Script = function(sourceID, sourceURL, lineOffset, columnOffset, length, errorLine, errorMessage, worldType)26 WebInspector.Script = function(sourceID, sourceURL, lineOffset, columnOffset, length, errorLine, errorMessage, isContentScript) 27 27 { 28 28 this.sourceID = sourceID; … … 33 33 this.errorLine = errorLine; 34 34 this.errorMessage = errorMessage; 35 this.worldType = worldType; 36 } 37 38 WebInspector.Script.WorldType = { 39 MAIN_WORLD: 0, 40 EXTENSIONS_WORLD: 1 35 this.isContentScript = isContentScript; 41 36 } 42 37 -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r83290 r83601 281 281 var option = document.createElement("option"); 282 282 option.text = sourceFile.url ? WebInspector.displayNameForURL(sourceFile.url) : WebInspector.UIString("(program)"); 283 if (sourceFile.is ExtensionScript)283 if (sourceFile.isContentScript) 284 284 option.addStyleClass("extension-script"); 285 285 function optionCompare(a, b) -
trunk/Source/WebCore/inspector/front-end/SourceFile.js
r83294 r83601 39 39 this.id = id; 40 40 this.url = script.sourceURL; 41 this.is ExtensionScript = script.worldType === WebInspector.Script.WorldType.EXTENSIONS_WORLD;41 this.isContentScript = script.isContentScript; 42 42 this.messages = []; 43 43 this.breakpoints = {};
Note: See TracChangeset
for help on using the changeset viewer.