Changeset 90017 in webkit
- Timestamp:
- Jun 29, 2011 7:38:06 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90014 r90017 1 2011-06-29 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: backend needs to provide system-unique object ids, so these remain unique across navigation 6 https://bugs.webkit.org/show_bug.cgi?id=62894 7 8 * inspector/InspectorController.cpp: 9 (WebCore::InspectorController::setAgentProcessIdentifier): 10 * inspector/InspectorController.h: 11 * inspector/InspectorPageAgent.cpp: 12 (WebCore::InspectorPageAgent::setAgentIdentifier): 13 (WebCore::InspectorPageAgent::createIdentifier): 14 (WebCore::InspectorPageAgent::frameForId): 15 (WebCore::InspectorPageAgent::frameId): 16 (WebCore::InspectorPageAgent::frameDestroyed): 17 * inspector/InspectorPageAgent.h: 18 1 19 2011-06-29 Pavel Feldman <pfeldman@google.com> 2 20 -
trunk/Source/WebCore/inspector/InspectorController.cpp
r89652 r90017 350 350 } 351 351 352 void InspectorController::setAgentIdentifierPrefix(const String& prefix) 353 { 354 m_pageAgent->setAgentIdentifierPrefix(prefix); 355 } 356 352 357 void InspectorController::evaluateForTestInFrontend(long callId, const String& script) 353 358 { -
trunk/Source/WebCore/inspector/InspectorController.h
r86564 r90017 94 94 void disconnectFrontend(); 95 95 void restoreInspectorStateFromCookie(const String& inspectorCookie); 96 void setAgentIdentifierPrefix(const String&); 96 97 97 98 void showConsole(); -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r89449 r90017 70 70 // This should be kept the same as the one in front-end/utilities.js 71 71 static const char regexSpecialCharacters[] = "[](){}+-*.,?\\^$|"; 72 static unsigned int s_last FrameIdentifier = 0;72 static unsigned int s_lastUsedIdentifier = 0; 73 73 } 74 74 … … 281 281 m_instrumentingAgents->setInspectorPageAgent(0); 282 282 m_frontend = 0; 283 } 284 285 void InspectorPageAgent::setAgentIdentifierPrefix(const String& prefix) 286 { 287 m_agentIdentifierPrefix = prefix.isEmpty() ? String("") : prefix + "."; 283 288 } 284 289 … … 561 566 } 562 567 568 String InspectorPageAgent::createIdentifier() 569 { 570 return m_agentIdentifierPrefix + String::number(++s_lastUsedIdentifier); 571 } 572 563 573 Frame* InspectorPageAgent::frameForId(const String& frameId) 564 574 { 565 bool ok = false; 566 unsigned int identifier = frameId.toUIntStrict(&ok); 567 if (!ok || !identifier) 568 return 0; 569 return m_identifierToFrame.get(identifier); 575 return frameId.isEmpty() ? 0 : m_identifierToFrame.get(frameId); 570 576 } 571 577 … … 574 580 if (!frame) 575 581 return ""; 576 unsigned intidentifier = m_frameToIdentifier.get(frame);577 if ( !identifier) {578 identifier = ++s_lastFrameIdentifier;582 String identifier = m_frameToIdentifier.get(frame); 583 if (identifier.isNull()) { 584 identifier = createIdentifier(); 579 585 m_frameToIdentifier.set(frame, identifier); 580 586 m_identifierToFrame.set(identifier, frame); 581 587 } 582 return String::number(identifier);588 return identifier; 583 589 } 584 590 … … 590 596 void InspectorPageAgent::frameDestroyed(Frame* frame) 591 597 { 592 HashMap<Frame*, unsigned int>::iterator iterator = m_frameToIdentifier.find(frame);598 HashMap<Frame*, String>::iterator iterator = m_frameToIdentifier.find(frame); 593 599 if (iterator != m_frameToIdentifier.end()) { 594 600 m_identifierToFrame.remove(iterator->second); -
trunk/Source/WebCore/inspector/InspectorPageAgent.h
r89449 r90017 108 108 void setFrontend(InspectorFrontend*); 109 109 void clearFrontend(); 110 void setAgentIdentifierPrefix(const String&); 110 111 111 112 // Cross-agents API … … 118 119 InspectorPageAgent(InstrumentingAgents*, Page*, InjectedScriptManager*); 119 120 121 String createIdentifier(); 122 120 123 PassRefPtr<InspectorObject> buildObjectForFrame(Frame*); 121 124 PassRefPtr<InspectorObject> buildObjectForFrameTree(Frame*); … … 125 128 InjectedScriptManager* m_injectedScriptManager; 126 129 InspectorFrontend::Page* m_frontend; 130 String m_agentIdentifierPrefix; 127 131 Vector<String> m_scriptsToEvaluateOnLoad; 128 HashMap<Frame*, unsigned int> m_frameToIdentifier;129 HashMap< unsigned int, Frame*> m_identifierToFrame;132 HashMap<Frame*, String> m_frameToIdentifier; 133 HashMap<String, Frame*> m_identifierToFrame; 130 134 }; 131 135 -
trunk/Source/WebKit/chromium/ChangeLog
r89991 r90017 1 2011-06-29 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: backend needs to provide system-unique object ids, so these remain unique across navigation 6 https://bugs.webkit.org/show_bug.cgi?id=62894 7 8 * public/WebDevToolsAgent.h: 9 * src/WebDevToolsAgentImpl.cpp: 10 (WebKit::WebDevToolsAgentImpl::setAgentProcessIdentifier): 11 * src/WebDevToolsAgentImpl.h: 12 1 13 2011-06-28 Ilya Sherman <isherman@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h
r89252 r90017 60 60 virtual void inspectElementAt(const WebPoint&) = 0; 61 61 virtual void setRuntimeProperty(const WebString& name, const WebString& value) = 0; 62 virtual void setAgentIdentifierPrefix(const WebString&) = 0; 62 63 63 64 // Exposed for LayoutTestController. -
trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
r89252 r90017 307 307 } 308 308 309 void WebDevToolsAgentImpl::setAgentIdentifierPrefix(const WebString& prefix) 310 { 311 inspectorController()->setAgentIdentifierPrefix(prefix); 312 } 313 309 314 void WebDevToolsAgentImpl::evaluateInWebInspector(long callId, const WebString& script) 310 315 { -
trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
r89252 r90017 82 82 virtual void setJavaScriptProfilingEnabled(bool); 83 83 virtual void setRuntimeProperty(const WebString& name, const WebString& value); 84 virtual void setAgentIdentifierPrefix(const WebString&); 84 85 85 86 // InspectorClient implementation.
Note: See TracChangeset
for help on using the changeset viewer.