Changeset 95636 in webkit
- Timestamp:
- Sep 21, 2011 9:13:48 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r95634 r95636 1 2011-09-21 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: introduce Page.enable and Page.disable 4 https://bugs.webkit.org/show_bug.cgi?id=68530 5 6 Otherwise protocol is violating the contract of not sending 7 notifications by default. 8 9 Reviewed by Yury Semikhatsky. 10 11 * inspector/Inspector.json: 12 1 13 2011-09-21 Pavel Feldman <pfeldman@google.com> 2 14 -
trunk/Source/WebCore/inspector/Inspector.json
r95621 r95636 116 116 "commands": [ 117 117 { 118 "name": "enable", 119 "description": "Enables page domain notifications." 120 }, 121 { 122 "name": "disable", 123 "description": "Disables page domain notifications." 124 }, 125 { 118 126 "name": "addScriptToEvaluateOnLoad", 119 127 "parameters": [ … … 137 145 "parameters": [ 138 146 { "name": "url", "type": "string", "description": "URL to open." }, 139 { "name": "newWindow", "optional": true, "type": "boolean", "description": "If True, opens given URL in a new window or tab." } 140 ], 141 "description": "Opens given URL either in the inspected page or in a new tab / window." 147 { "name": "newWindow", "optional": true, "type": "boolean", "description": "If true, opens given URL in a new window or tab." } 148 ], 149 "description": "Opens given URL either in the inspected page or in a new tab / window.", 150 "hidden": true 142 151 }, 143 152 { … … 228 237 { 229 238 "domain": "Runtime", 230 "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose type, string representation and unique identifier that can be used for further object interaction. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",239 "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.", 231 240 "types": [ 232 241 { … … 302 311 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." } 303 312 ], 304 "description": "Calls function with given declaration on the given object. "313 "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object." 305 314 }, 306 315 { … … 313 322 { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor"}, "description": "Object properties." } 314 323 ], 315 "description": "Returns properties of a given object. "324 "description": "Returns properties of a given object. Object group of the result is inherited from the target object." 316 325 }, 317 326 { … … 437 446 "type": "string", 438 447 "description": "Unique request identifier." 448 }, 449 { 450 "id": "Timestamp", 451 "type": "number", 452 "description": "Number of seconds since epoch." 453 }, 454 { 455 "id": "Headers", 456 "type": "object", 457 "description": "Request / response headers as keys / values of JSON object." 439 458 }, 440 459 { … … 464 483 { "name": "url", "type": "string", "description": "Request URL." }, 465 484 { "name": "method", "type": "string", "description": "HTTP request method." }, 466 { "name": "headers", " type": "object", "description": "HTTP request headers." },485 { "name": "headers", "$ref": "Headers", "description": "HTTP request headers." }, 467 486 { "name": "postData", "type": "string", "optional": true, "description": "HTTP POST request data." } 468 487 ] … … 476 495 { "name": "status", "type": "number", "description": "HTTP response status code." }, 477 496 { "name": "statusText", "type": "string", "description": "HTTP response status text." }, 478 { "name": "headers", " type": "object", "description": "HTTP response headers." },497 { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }, 479 498 { "name": "headersText", "type": "string", "optional": true, "description": "HTTP response headers text." }, 480 499 { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." }, 481 { "name": "requestHeaders", " type": "object", "optional": true, "description": "Refined HTTP request headers that were actually transmitted over the network." },500 { "name": "requestHeaders", "$ref": "Headers", "optional": true, "description": "Refined HTTP request headers that were actually transmitted over the network." }, 482 501 { "name": "requestHeadersText", "type": "string", "optional": true, "description": "HTTP request headers text." }, 483 502 { "name": "connectionReused", "type": "boolean", "description": "Specifies whether physical connection was actually reused for this request." }, … … 528 547 { 529 548 "name": "setExtraHTTPHeaders", 530 "description": " Allows sendingextra HTTP headers with the requests from this page.",531 "parameters": [ 532 { "name": "headers", " type": "object", "description": "Map with extra HTTP headers." }549 "description": "Specifies whether to always send extra HTTP headers with the requests from this page.", 550 "parameters": [ 551 { "name": "headers", "$ref": "Headers", "description": "Map with extra HTTP headers." } 533 552 ] 534 553 }, … … 541 560 "returns": [ 542 561 { "name": "body", "type": "string", "description": "Response body." }, 543 { "name": "base64Encoded", "type": "boolean", "description": "True, if content was se rvedas base64." }562 { "name": "base64Encoded", "type": "boolean", "description": "True, if content was sent as base64." } 544 563 ] 545 564 }, … … 570 589 { "name": "documentURL", "type": "string", "description": "URL of the document this request is loaded for." }, 571 590 { "name": "request", "$ref": "Request", "description": "Request data." }, 572 { "name": "timestamp", " type": "number", "description": "Timestamp." },591 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, 573 592 { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." }, 574 593 { "name": "stackTrace", "$ref": "Console.StackTrace", "optional": true, "description": "JavaScript stack trace upon issuing this request." }, … … 588 607 "parameters": [ 589 608 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, 590 { "name": "timestamp", " type": "number", "description": "Timestamp." },609 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, 591 610 { "name": "type", "$ref": "Page.ResourceType", "description": "Resource type." }, 592 611 { "name": "response", "$ref": "Response", "description": "Response data." } … … 598 617 "parameters": [ 599 618 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, 600 { "name": "timestamp", " type": "number", "description": "Timestamp." },619 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, 601 620 { "name": "dataLength", "type": "integer", "description": "Data chunk length." }, 602 621 { "name": "encodedDataLength", "type": "integer", "description": "Actual bytes received (might be less than dataLength for compressed encodings)." } … … 608 627 "parameters": [ 609 628 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, 610 { "name": "timestamp", " type": "number", "description": "Timestamp." }629 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." } 611 630 ] 612 631 }, … … 616 635 "parameters": [ 617 636 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, 618 { "name": "timestamp", " type": "number", "description": "Timestamp." },637 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, 619 638 { "name": "errorText", "type": "string", "description": "User friendly error message." }, 620 639 { "name": "canceled", "type": "boolean", "optional": true, "description": "True if loading was canceled." } … … 629 648 { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." }, 630 649 { "name": "documentURL", "type": "string", "description": "URL of the document this request is loaded for." }, 631 { "name": "timestamp", " type": "number", "description": "Timestamp." },650 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, 632 651 { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." }, 633 652 { "name": "resource", "$ref": "CachedResource", "description": "Cached resource data." } … … 639 658 "parameters": [ 640 659 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, 641 { "name": "timestamp", " type": "number", "description": "Timestamp." },660 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, 642 661 { "name": "request", "type": "object", "description": "WebSocket request data." } 643 662 ], … … 649 668 "parameters": [ 650 669 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, 651 { "name": "timestamp", " type": "number", "description": "Timestamp." },670 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, 652 671 { "name": "response", "type": "object", "description": "WebSocket response data." } 653 672 ], … … 668 687 "parameters": [ 669 688 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, 670 { "name": "timestamp", " type": "number", "description": "Timestamp." }689 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." } 671 690 ], 672 691 "hidden": true … … 898 917 { "name": "paddingColor", "$ref": "RGBA", "optional": true, "description": "The padding highlight fill color (default: transparent)." }, 899 918 { "name": "borderColor", "$ref": "RGBA", "optional": true, "description": "The border highlight fill color (default: transparent)." }, 900 { "name": "marginColor", "$ref": "RGBA", "optional": true, "description": "The margin highlight fill color (default: transparent)." } ,919 { "name": "marginColor", "$ref": "RGBA", "optional": true, "description": "The margin highlight fill color (default: transparent)." } 901 920 ], 902 921 "description": "Configuration data for the highlighting of page elements." … … 1504 1523 { 1505 1524 "name": "started", 1506 "description": "Fired when timeline has been started." 1525 "description": "Fired when timeline has been started.", 1526 "hidden": true 1507 1527 }, 1508 1528 { 1509 1529 "name": "stopped", 1510 "description": "Fired when timeline has been stopped." 1530 "description": "Fired when timeline has been stopped.", 1531 "hidden": true 1511 1532 }, 1512 1533 { -
trunk/Source/WebCore/inspector/InspectorController.cpp
r95271 r95636 99 99 , m_state(adoptPtr(new InspectorState(inspectorClient))) 100 100 , m_inspectorAgent(adoptPtr(new InspectorAgent(page, m_injectedScriptManager.get(), m_instrumentingAgents.get()))) 101 , m_pageAgent(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_ injectedScriptManager.get()))101 , m_pageAgent(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_state.get(), m_injectedScriptManager.get())) 102 102 , m_domAgent(InspectorDOMAgent::create(m_instrumentingAgents.get(), m_pageAgent.get(), inspectorClient, m_state.get(), m_injectedScriptManager.get())) 103 103 , m_cssAgent(adoptPtr(new InspectorCSSAgent(m_instrumentingAgents.get(), m_domAgent.get()))) … … 343 343 m_state->loadFromCookie(inspectorStateCookie); 344 344 345 m_pageAgent->restore(); 345 346 m_domAgent->restore(); 346 347 m_resourceAgent->restore(); -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r95093 r95636 51 51 #include "InjectedScriptManager.h" 52 52 #include "InspectorFrontend.h" 53 #include "InspectorState.h" 53 54 #include "InspectorValues.h" 54 55 #include "InstrumentingAgents.h" … … 71 72 // This should be kept the same as the one in front-end/utilities.js 72 73 static const char regexSpecialCharacters[] = "[](){}+-*.,?\\^$|"; 74 } 75 76 namespace PageAgentState { 77 static const char pageAgentEnabled[] = "resourceAgentEnabled"; 73 78 } 74 79 … … 171 176 } 172 177 173 PassOwnPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* instrumentingAgents, Page* page, In jectedScriptManager* injectedScriptManager)174 { 175 return adoptPtr(new InspectorPageAgent(instrumentingAgents, page, injectedScriptManager));178 PassOwnPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* instrumentingAgents, Page* page, InspectorState* state, InjectedScriptManager* injectedScriptManager) 179 { 180 return adoptPtr(new InspectorPageAgent(instrumentingAgents, page, state, injectedScriptManager)); 176 181 } 177 182 … … 263 268 } 264 269 265 InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents, Page* page, In jectedScriptManager* injectedScriptManager)270 InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents, Page* page, InspectorState* state, InjectedScriptManager* injectedScriptManager) 266 271 : m_instrumentingAgents(instrumentingAgents) 267 272 , m_page(page) 268 273 , m_injectedScriptManager(injectedScriptManager) 274 , m_state(state) 269 275 , m_frontend(0) 270 276 { … … 274 280 { 275 281 m_frontend = frontend->page(); 282 } 283 284 void InspectorPageAgent::clearFrontend() 285 { 286 ErrorString error; 287 disable(&error); 288 m_frontend = 0; 289 } 290 291 void InspectorPageAgent::restore() 292 { 293 if (m_state->getBoolean(PageAgentState::pageAgentEnabled)) { 294 ErrorString error; 295 enable(&error); 296 } 297 } 298 299 void InspectorPageAgent::enable(ErrorString*) 300 { 301 m_state->setBoolean(PageAgentState::pageAgentEnabled, true); 276 302 m_instrumentingAgents->setInspectorPageAgent(this); 277 303 } 278 304 279 void InspectorPageAgent::clearFrontend() 280 { 305 void InspectorPageAgent::disable(ErrorString*) 306 { 307 m_state->setBoolean(PageAgentState::pageAgentEnabled, false); 281 308 m_instrumentingAgents->setInspectorPageAgent(0); 282 m_frontend = 0;283 309 } 284 310 -
trunk/Source/WebCore/inspector/InspectorPageAgent.h
r95093 r95636 51 51 class InspectorArray; 52 52 class InspectorObject; 53 class InspectorState; 53 54 class InstrumentingAgents; 54 55 class KURL; … … 74 75 }; 75 76 76 static PassOwnPtr<InspectorPageAgent> create(InstrumentingAgents*, Page*, In jectedScriptManager*);77 static PassOwnPtr<InspectorPageAgent> create(InstrumentingAgents*, Page*, InspectorState*, InjectedScriptManager*); 77 78 78 79 static bool cachedResourceContent(CachedResource*, String* result, bool* base64Encoded); … … 87 88 88 89 // Page API for InspectorFrontend 90 void enable(ErrorString*); 91 void disable(ErrorString*); 89 92 void addScriptToEvaluateOnLoad(ErrorString*, const String& source); 90 93 void removeAllScriptsToEvaluateOnLoad(ErrorString*); … … 108 111 void setFrontend(InspectorFrontend*); 109 112 void clearFrontend(); 113 void restore(); 110 114 111 115 // Cross-agents API … … 117 121 118 122 private: 119 InspectorPageAgent(InstrumentingAgents*, Page*, In jectedScriptManager*);123 InspectorPageAgent(InstrumentingAgents*, Page*, InspectorState*, InjectedScriptManager*); 120 124 121 125 PassRefPtr<InspectorObject> buildObjectForFrame(Frame*); … … 125 129 Page* m_page; 126 130 InjectedScriptManager* m_injectedScriptManager; 131 InspectorState* m_state; 127 132 InspectorFrontend::Page* m_frontend; 128 133 Vector<String> m_scriptsToEvaluateOnLoad; -
trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js
r94754 r95636 43 43 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); 44 44 45 PageAgent.enable(); 46 45 47 this.frontendReused(); 46 48 InspectorBackend.registerPageDispatcher(new WebInspector.PageDispatcher(this)); -
trunk/Source/WebCore/inspector/front-end/inspector.js
r95621 r95636 548 548 549 549 this.console.enableAgent(); 550 551 550 DatabaseAgent.enable(); 552 551 DOMStorageAgent.enable();
Note: See TracChangeset
for help on using the changeset viewer.