Changeset 82847 in webkit
- Timestamp:
- Apr 4, 2011 11:00:32 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r82843 r82847 1 2011-04-04 Pavel Feldman <pfeldman@google.com> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: add support for the enumerated types in the protocol. 6 https://bugs.webkit.org/show_bug.cgi?id=57761 7 8 * inspector/debugger/debugger-autocontinue-on-syntax-error.html: 9 * inspector/debugger/debugger-pause-on-exception.html: 10 1 11 2011-04-04 Yong Li <yoli@rim.com> 2 12 -
trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html
r80416 r82847 19 19 function step1() 20 20 { 21 DebuggerAgent.setPauseOnExceptions State(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);21 DebuggerAgent.setPauseOnExceptions(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions); 22 22 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2); 23 23 InspectorTest.evaluateInPage("loadIframe()"); -
trunk/LayoutTests/inspector/debugger/debugger-pause-on-exception.html
r78717 r82847 21 21 function step1() 22 22 { 23 DebuggerAgent.setPauseOnExceptions State(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);23 DebuggerAgent.setPauseOnExceptions(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions); 24 24 InspectorTest.showScriptSource("debugger-pause-on-exception.html", step2); 25 25 } -
trunk/Source/WebCore/ChangeLog
r82845 r82847 1 2011-04-04 Pavel Feldman <pfeldman@google.com> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: add support for the enumerated types in the protocol. 6 https://bugs.webkit.org/show_bug.cgi?id=57761 7 8 * inspector/Inspector.json: 9 * inspector/InspectorDebuggerAgent.cpp: 10 (WebCore::InspectorDebuggerAgent::setPauseOnExceptions): 11 * inspector/InspectorDebuggerAgent.h: 12 * inspector/InspectorInstrumentation.cpp: 13 (WebCore::InspectorInstrumentation::resourceRetrievedByXMLHttpRequestImpl): 14 (WebCore::InspectorInstrumentation::scriptImportedImpl): 15 * inspector/InspectorResourceAgent.cpp: 16 (WebCore::cachedResourceTypeString): 17 (WebCore::InspectorResourceAgent::didReceiveResponse): 18 (WebCore::InspectorResourceAgent::setInitialScriptContent): 19 (WebCore::InspectorResourceAgent::setInitialXHRContent): 20 * inspector/InspectorResourceAgent.h: 21 * inspector/front-end/ScriptsPanel.js: 22 * inspector/generate-inspector-idl: 23 1 24 2011-04-04 Yury Semikhatsky <yurys@chromium.org> 2 25 -
trunk/Source/WebCore/inspector/Inspector.json
r82804 r82847 160 160 "parameters": [ 161 161 { "name": "objectId", "type": "string" }, 162 { "name": "ignoreHasOwnProperty", "type": "boolean" } ,162 { "name": "ignoreHasOwnProperty", "type": "boolean" } 163 163 ], 164 164 "returns": [ … … 286 286 }, 287 287 { 288 "id": "ResourceType", 289 "type": "string", 290 "enum": ["Document", "Stylesheet", "Image", "Font", "Script", "XHR", "WebSocket", "Other"], 291 "description": "Resource type as it was perceived by the rendering enging." 292 }, 293 { 288 294 "id": "CachedResource", 289 295 "type": "object", … … 291 297 "properties": { 292 298 "url": { "type": "string", "description": "Resource URL." }, 293 "type": { " type": "string", "description": "Type of this resource. // FIXME" },299 "type": { "$ref": "ResourceType", "description": "Type of this resource." }, 294 300 "response": { "$ref": "ResourceResponse", "description": "Cached response data." }, 295 301 "bodySize": { "type": "number", "description": "Cached response body size." } … … 320 326 "properties": { 321 327 "url": { "type": "string", "description": "Resource URL." }, 322 "type": { " type": "string", "description": "Type of this resource. // FIXME" }328 "type": { "$ref": "ResourceType", "description": "Type of this resource." } 323 329 } 324 330 }, … … 399 405 { "name": "identifier", "type": "integer", "description": "Request identifier." }, 400 406 { "name": "time", "type": "number", "description": "Timestamp." }, 401 { "name": " resourceType", "type": "string", "description": "Resource type. // FIXME" },407 { "name": "type", "$ref": "ResourceType", "description": "Resource type." }, 402 408 { "name": "response", "$ref": "ResourceResponse", "description": "Response data." } 403 409 ] … … 447 453 { "name": "identifier", "type": "integer", "description": "Request identifier." }, 448 454 { "name": "content", "type": "string", "description": "Resource content." }, 449 { "name": "type", " type": "string", "description": "Resource type. // FIXME" }455 { "name": "type", "$ref": "ResourceType", "description": "Resource type." } 450 456 ] 451 457 }, … … 679 685 "parameters": [ 680 686 { "name": "nodeId", "type": "integer", "description": "Id of the node to query upon." }, 681 { "name": "selectors", "type": "string", "description": "Selector string." } ,687 { "name": "selectors", "type": "string", "description": "Selector string." } 682 688 ], 683 689 "returns": [ … … 690 696 "parameters": [ 691 697 { "name": "nodeId", "type": "integer", "description": "Id of the node to query upon." }, 692 { "name": "selectors", "type": "string", "description": "Selector string." } ,698 { "name": "selectors", "type": "string", "description": "Selector string." } 693 699 ], 694 700 "returns": [ … … 1003 1009 "sourceURL": { "type": "string", "optional": true, "description": "Parent stylesheet resource URL (for regular rules)."}, 1004 1010 "sourceLine": { "type": "integer", "description": "Line ordinal of the rule selector start character in the resource."}, 1005 "origin": { "type": "string", " description": "The parent stylesheet type: \"user\" for user stylesheets, \"user-agent\" for user-agent stylesheets, \"inspector\" for stylesheets created by the inspector (i.e. those holding new rules created with <code>addRule()</code>), \"\" for regular stylesheets. // FIXME"},1011 "origin": { "type": "string", "enum": ["user", "user-agent", "inspector", ""], "description": "The parent stylesheet type: \"user\" for user stylesheets, \"user-agent\" for user-agent stylesheets, \"inspector\" for stylesheets created by the inspector (i.e. those holding new rules created with <code>addRule()</code>), \"\" for regular stylesheets."}, 1006 1012 "style": { "$ref": "CSSStyle", "description": "Associated style declaration." }, 1007 1013 "selectorRange": { "$ref": "SourceRange", "optional": true, "description": "The rule selector range in the underlying resource (if available)." } … … 1041 1047 "implicit": { "type": "boolean", "optional": true, "description": "Whether the property is implicit (implies <code>false</code> if absent)." }, 1042 1048 "parsedOk": { "type": "boolean", "optional": true, "description": "Whether the property is understood by the browser (implies <code>true</code> if absent)." }, 1043 "status": { "type": "string", " optional": true, "description": "The property status: \"active\" (implied if absent) if the property is effective in the style, \"inactive\" if the property is overridden by a same-named property in this style later on, \"disabled\" if the property is disabled by the user, \"style\" if the property is reported by the browser rather than by the CSS source parser. // FIXME" },1049 "status": { "type": "string", "enum": ["active", "inactive", "disabled", "style"], "optional": true, "description": "The property status: \"active\" (implied if absent) if the property is effective in the style, \"inactive\" if the property is overridden by a same-named property in this style later on, \"disabled\" if the property is disabled by the user, \"style\" if the property is reported by the browser rather than by the CSS source parser." }, 1044 1050 "shorthandName": { "type": "string", "description": "The related shorthand property name (absent if this property is not a longhand)." }, 1045 1051 "range": { "$ref": "SourceRange", "optional": true, "description": "The entire property range in the enclosing style declaration (if available)." } … … 1351 1357 }, 1352 1358 { 1353 "name": "setPauseOnExceptions State",1354 "parameters": [ 1355 { "name": " pauseOnExceptionsState", "type": "integer", "description": "Pause on exceptions mode. // FIXME, make enumerable." }1359 "name": "setPauseOnExceptions", 1360 "parameters": [ 1361 { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." } 1356 1362 ], 1357 1363 "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions." -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
r82804 r82847 302 302 } 303 303 304 void InspectorDebuggerAgent::setPauseOnExceptionsState(ErrorString* errorString, int pauseState) 305 { 304 void InspectorDebuggerAgent::setPauseOnExceptions(ErrorString* errorString, const String& stringPauseState) 305 { 306 ScriptDebugServer::PauseOnExceptionsState pauseState; 307 if (stringPauseState == "none") 308 pauseState = ScriptDebugServer::DontPauseOnExceptions; 309 else if (stringPauseState == "all") 310 pauseState = ScriptDebugServer::PauseOnAllExceptions; 311 else if (stringPauseState == "uncaught") 312 pauseState = ScriptDebugServer::PauseOnUncaughtExceptions; 313 else { 314 *errorString = "Unknown pause on exceptions mode: " + stringPauseState; 315 return; 316 } 306 317 scriptDebugServer().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState)); 307 318 if (scriptDebugServer().pauseOnExceptionsState() != pauseState) -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h
r82804 r82847 95 95 void stepInto(ErrorString*); 96 96 void stepOut(ErrorString*); 97 void setPauseOnExceptions State(ErrorString*, intpauseState);97 void setPauseOnExceptions(ErrorString*, const String& pauseState); 98 98 void evaluateOnCallFrame(ErrorString*, const String& callFrameId, const String& expression, const String& objectGroup, const bool* const optionalIncludeCommandLineAPI, RefPtr<InspectorObject>* result); 99 99 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r82403 r82847 485 485 inspectorAgent->consoleAgent()->resourceRetrievedByXMLHttpRequest(url, sendURL, sendLineNumber); 486 486 if (InspectorResourceAgent* resourceAgent = retrieveResourceAgent(inspectorAgent)) 487 resourceAgent->setInitial Content(identifier, sourceString, "XHR");487 resourceAgent->setInitialXHRContent(identifier, sourceString); 488 488 } 489 489 … … 491 491 { 492 492 if (InspectorResourceAgent* resourceAgent = retrieveResourceAgent(inspectorAgent)) 493 resourceAgent->setInitial Content(identifier, sourceString, "Script");493 resourceAgent->setInitialScriptContent(identifier, sourceString); 494 494 } 495 495 -
trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp
r82804 r82847 75 75 } 76 76 77 namespace ResourceType { 78 static const char document[] = "Document"; 79 static const char stylesheet[] = "Stylesheet"; 80 static const char image[] = "Image"; 81 static const char font[] = "Font"; 82 static const char script[] = "Script"; 83 static const char xhr[] = "XHR"; 84 static const char websocket[] = "WebSocket"; 85 static const char other[] = "Other"; 86 } 87 77 88 void InspectorResourceAgent::setFrontend(InspectorFrontend* frontend) 78 89 { … … 237 248 switch (cachedResource.type()) { 238 249 case CachedResource::ImageResource: 239 return "Image";250 return ResourceType::image; 240 251 case CachedResource::FontResource: 241 return "Font";252 return ResourceType::font; 242 253 case CachedResource::CSSStyleSheet: 243 254 // Fall through. … … 245 256 case CachedResource::XSLStyleSheet: 246 257 #endif 247 return "Stylesheet";258 return ResourceType::stylesheet; 248 259 case CachedResource::Script: 249 return "Script";260 return ResourceType::script; 250 261 default: 251 262 break; 252 263 } 253 return "Other";264 return ResourceType::other; 254 265 } 255 266 … … 315 326 } 316 327 if (equalIgnoringFragmentIdentifier(response.url(), loader->frameLoader()->iconURL())) 317 type = "Image";328 type = ResourceType::image; 318 329 else if (equalIgnoringFragmentIdentifier(response.url(), loader->url()) && type == "Other") 319 type = "Document";330 type = ResourceType::document; 320 331 } 321 332 m_frontend->responseReceived(static_cast<int>(identifier), currentTime(), type, resourceResponse); … … 349 360 } 350 361 351 void InspectorResourceAgent::setInitialContent(unsigned long identifier, const String& sourceString, const String& type) 352 { 353 m_frontend->initialContentSet(static_cast<int>(identifier), sourceString, type); 362 void InspectorResourceAgent::setInitialScriptContent(unsigned long identifier, const String& sourceString) 363 { 364 m_frontend->initialContentSet(static_cast<int>(identifier), sourceString, ResourceType::script); 365 } 366 367 void InspectorResourceAgent::setInitialXHRContent(unsigned long identifier, const String& sourceString) 368 { 369 m_frontend->initialContentSet(static_cast<int>(identifier), sourceString, ResourceType::xhr); 354 370 } 355 371 -
trunk/Source/WebCore/inspector/InspectorResourceAgent.h
r82804 r82847 96 96 void didFailLoading(unsigned long identifier, const ResourceError&); 97 97 void didLoadResourceFromMemoryCache(DocumentLoader*, const CachedResource*); 98 void setInitialContent(unsigned long identifier, const String& sourceString, const String& type); 98 void setInitialScriptContent(unsigned long identifier, const String& sourceString); 99 void setInitialXHRContent(unsigned long identifier, const String& sourceString); 99 100 void didCommitLoad(DocumentLoader*); 100 101 void frameDetachedFromParent(Frame*); -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r82685 r82847 205 205 // Keep these in sync with WebCore::ScriptDebugServer 206 206 WebInspector.ScriptsPanel.PauseOnExceptionsState = { 207 DontPauseOnExceptions : 0,208 PauseOnAllExceptions : 1,209 PauseOnUncaughtExceptions: 2207 DontPauseOnExceptions : "none", 208 PauseOnAllExceptions : "all", 209 PauseOnUncaughtExceptions: "uncaught" 210 210 }; 211 211 … … 415 415 _debuggerWasEnabled: function() 416 416 { 417 this._setPauseOnExceptions(WebInspector.settings.pauseOnExceptionState );417 this._setPauseOnExceptions(WebInspector.settings.pauseOnExceptionStateString); 418 418 419 419 if (this._debuggerEnabled) … … 682 682 _setPauseOnExceptions: function(pauseOnExceptionsState) 683 683 { 684 pauseOnExceptionsState = pauseOnExceptionsState || WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions; 684 685 function callback(error) 685 686 { … … 694 695 695 696 this._pauseOnExceptionButton.state = pauseOnExceptionsState; 696 WebInspector.settings.pauseOnExceptionState = pauseOnExceptionsState;697 } 698 DebuggerAgent.setPauseOnExceptions State(pauseOnExceptionsState, callback.bind(this));697 WebInspector.settings.pauseOnExceptionStateString = pauseOnExceptionsState; 698 } 699 DebuggerAgent.setPauseOnExceptions(pauseOnExceptionsState, callback.bind(this)); 699 700 }, 700 701 … … 811 812 _togglePauseOnExceptions: function() 812 813 { 813 this._setPauseOnExceptions((this._pauseOnExceptionButton.state + 1) % this._pauseOnExceptionButton.states); 814 var nextStateMap = {}; 815 var stateEnum = WebInspector.ScriptsPanel.PauseOnExceptionsState; 816 nextStateMap[stateEnum.DontPauseOnExceptions] = stateEnum.PauseOnAllExceptions; 817 nextStateMap[stateEnum.PauseOnAllExceptions] = stateEnum.PauseOnUncaughtExceptions; 818 nextStateMap[stateEnum.PauseOnUncaughtExceptions] = stateEnum.DontPauseOnExceptions; 819 this._setPauseOnExceptions(nextStateMap[this._pauseOnExceptionButton.state]); 814 820 }, 815 821 -
trunk/Source/WebCore/inspector/front-end/inspector.css
r82609 r82847 494 494 } 495 495 496 button.status-bar-item.toggled-1 .glyph {497 background-color: rgb(66, 129, 235);498 }499 500 button.status-bar-item.toggled-2 .glyph {501 background-color: purple;502 }503 504 496 button.status-bar-item:disabled { 505 497 opacity: 0.5; … … 2521 2513 } 2522 2514 2515 .scripts-pause-on-exceptions-status-bar-item.toggled-all .glyph { 2516 background-color: rgb(66, 129, 235); 2517 } 2518 2519 .scripts-pause-on-exceptions-status-bar-item.toggled-uncaught .glyph { 2520 background-color: purple; 2521 } 2522 2523 2523 #scripts-status-bar { 2524 2524 position: absolute; -
trunk/Source/WebCore/inspector/generate-inspector-idl
r82804 r82847 82 82 } 83 83 84 ref_types = {} 85 84 86 macro_traits = { 85 87 "Database": "DATABASE", … … 93 95 def param_type(param): 94 96 if "type" in param: 95 return type_traits[param["type"]] ;97 return type_traits[param["type"]] 96 98 if "$ref" in param: 97 return "Object" 99 type_id = param["$ref"] 100 if type_id in ref_types: 101 ref_type = ref_types[type_id] 102 return type_traits[ref_type["type"]] 103 else: 104 return "Object" 98 105 99 106 for domain in json_api: … … 102 109 output_file.write("\n#if defined(ENABLE_%s) && ENABLE_%s" % (macro_traits[domain_name], macro_traits[domain_name])) 103 110 output_file.write("\n interface [Conditional=INSPECTOR] %s {" % domain_name) 111 if "types" in domain: 112 for type in domain["types"]: 113 ref_types[type["id"]] = type 104 114 if "commands" in domain: 105 115 for command in domain["commands"]: 106 params = [] ;116 params = [] 107 117 if ("parameters" in command): 108 118 for in_param in command["parameters"]: … … 118 128 if "events" in domain: 119 129 for event in domain["events"]: 120 params = [] ;130 params = [] 121 131 if ("parameters" in event): 122 132 for in_param in event["parameters"]:
Note: See TracChangeset
for help on using the changeset viewer.