Title: [101531] trunk/Source/WebCore
Revision
101531
Author
[email protected]
Date
2011-11-30 10:49:06 -0800 (Wed, 30 Nov 2011)

Log Message

Web Inspector: Inspect element does not highlight element in elements panel when inspector is opened.
https://bugs.webkit.org/show_bug.cgi?id=73459

Reviewed by Pavel Feldman.

This regressed in r101503.

* inspector/InjectedScriptHost.cpp:
(WebCore::InjectedScriptHost::InjectedScriptHost):
(WebCore::InjectedScriptHost::disconnect):
(WebCore::InjectedScriptHost::inspectImpl):
* inspector/InjectedScriptHost.h:
(WebCore::InjectedScriptHost::init):
* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::enable):
(WebCore::InspectorAgent::inspect):
* inspector/InspectorAgent.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::connectFrontend):
(WebCore::WorkerInspectorController::disconnectFrontend):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (101530 => 101531)


--- trunk/Source/WebCore/ChangeLog	2011-11-30 18:44:43 UTC (rev 101530)
+++ trunk/Source/WebCore/ChangeLog	2011-11-30 18:49:06 UTC (rev 101531)
@@ -1,3 +1,29 @@
+2011-11-30  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Inspect element does not highlight element in elements panel when inspector is opened.
+        https://bugs.webkit.org/show_bug.cgi?id=73459
+
+        Reviewed by Pavel Feldman.
+
+        This regressed in r101503.
+
+        * inspector/InjectedScriptHost.cpp:
+        (WebCore::InjectedScriptHost::InjectedScriptHost):
+        (WebCore::InjectedScriptHost::disconnect):
+        (WebCore::InjectedScriptHost::inspectImpl):
+        * inspector/InjectedScriptHost.h:
+        (WebCore::InjectedScriptHost::init):
+        * inspector/InspectorAgent.cpp:
+        (WebCore::InspectorAgent::enable):
+        (WebCore::InspectorAgent::inspect):
+        * inspector/InspectorAgent.h:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::connectFrontend):
+        (WebCore::InspectorController::disconnectFrontend):
+        * inspector/WorkerInspectorController.cpp:
+        (WebCore::WorkerInspectorController::connectFrontend):
+        (WebCore::WorkerInspectorController::disconnectFrontend):
+
 2011-11-30  Tony Chang  <[email protected]>
 
         Remove dead flexible box code

Modified: trunk/Source/WebCore/inspector/InjectedScriptHost.cpp (101530 => 101531)


--- trunk/Source/WebCore/inspector/InjectedScriptHost.cpp	2011-11-30 18:44:43 UTC (rev 101530)
+++ trunk/Source/WebCore/inspector/InjectedScriptHost.cpp	2011-11-30 18:49:06 UTC (rev 101531)
@@ -73,7 +73,6 @@
     , m_databaseAgent(0)
 #endif
     , m_domStorageAgent(0)
-    , m_frontend(0)
     , m_lastWorkerId(1 << 31) // Distinguish ids of fake workers from real ones, to minimize the chances they overlap.
 {
 }
@@ -90,7 +89,6 @@
     m_databaseAgent = 0;
 #endif
     m_domStorageAgent = 0;
-    m_frontend = 0;
 }
 
 void InjectedScriptHost::addInspectedNode(Node* node)
@@ -107,8 +105,8 @@
 
 void InjectedScriptHost::inspectImpl(PassRefPtr<InspectorValue> object, PassRefPtr<InspectorValue> hints)
 {
-    if (m_frontend)
-        m_frontend->inspector()->inspect(object->asObject(), hints->asObject());
+    if (m_inspectorAgent)
+        m_inspectorAgent->inspect(object->asObject(), hints->asObject());
 }
 
 void InjectedScriptHost::clearConsoleMessages()

Modified: trunk/Source/WebCore/inspector/InjectedScriptHost.h (101530 => 101531)


--- trunk/Source/WebCore/inspector/InjectedScriptHost.h	2011-11-30 18:44:43 UTC (rev 101530)
+++ trunk/Source/WebCore/inspector/InjectedScriptHost.h	2011-11-30 18:49:06 UTC (rev 101531)
@@ -72,8 +72,6 @@
 #endif
         m_domStorageAgent = domStorageAgent;
     }
-    void setFrontend(InspectorFrontend* frontend) { m_frontend = frontend; }
-    void clearFrontend() { m_frontend = 0; }
 
     static Node* scriptValueAsNode(ScriptValue);
     static ScriptValue nodeAsScriptValue(ScriptState*, Node*);
@@ -106,7 +104,6 @@
     InspectorDatabaseAgent* m_databaseAgent;
 #endif
     InspectorDOMStorageAgent* m_domStorageAgent;
-    InspectorFrontend* m_frontend;
     long m_lastWorkerId;
     Vector<RefPtr<Node> > m_inspectedNodes;
 };

Modified: trunk/Source/WebCore/inspector/InspectorAgent.cpp (101530 => 101531)


--- trunk/Source/WebCore/inspector/InspectorAgent.cpp	2011-11-30 18:44:43 UTC (rev 101530)
+++ trunk/Source/WebCore/inspector/InspectorAgent.cpp	2011-11-30 18:49:06 UTC (rev 101531)
@@ -129,6 +129,9 @@
     }
 #endif
 
+    if (m_pendingInspectData.first)
+        inspect(m_pendingInspectData.first, m_pendingInspectData.second);
+
     for (Vector<pair<long, String> >::iterator it = m_pendingEvaluateTestCommands.begin(); m_frontend && it != m_pendingEvaluateTestCommands.end(); ++it)
         m_frontend->inspector()->evaluateForTestInFrontend((*it).first, (*it).second);
     m_pendingEvaluateTestCommands.clear();
@@ -232,6 +235,18 @@
     m_inspectorExtensionAPI = source;
 }
 
+void InspectorAgent::inspect(PassRefPtr<InspectorObject> objectToInspect, PassRefPtr<InspectorObject> hints)
+{
+    if (m_state->getBoolean(InspectorAgentState::inspectorAgentEnabled) && m_frontend) {
+        m_frontend->inspector()->inspect(objectToInspect, hints);
+        m_pendingInspectData.first = 0;
+        m_pendingInspectData.second = 0;
+        return;
+    }
+    m_pendingInspectData.first = objectToInspect;
+    m_pendingInspectData.second = hints;
+}
+
 KURL InspectorAgent::inspectedURL() const
 {
     return m_inspectedPage->mainFrame()->document()->url();

Modified: trunk/Source/WebCore/inspector/InspectorAgent.h (101530 => 101531)


--- trunk/Source/WebCore/inspector/InspectorAgent.h	2011-11-30 18:44:43 UTC (rev 101530)
+++ trunk/Source/WebCore/inspector/InspectorAgent.h	2011-11-30 18:49:06 UTC (rev 101531)
@@ -97,6 +97,8 @@
 
     void setInspectorExtensionAPI(const String& source);
 
+    void inspect(PassRefPtr<InspectorObject> objectToInspect, PassRefPtr<InspectorObject> hints);
+
 private:
     InspectorAgent(Page*, InjectedScriptManager*, InstrumentingAgents*, InspectorState*);
 
@@ -113,6 +115,7 @@
     InjectedScriptManager* m_injectedScriptManager;
 
     Vector<pair<long, String> > m_pendingEvaluateTestCommands;
+    pair<RefPtr<InspectorObject>, RefPtr<InspectorObject> > m_pendingInspectData;
     String m_inspectorExtensionAPI;
 #if ENABLE(WORKERS)
     typedef HashMap<intptr_t, RefPtr<InspectorWorkerResource> > WorkersMap;

Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (101530 => 101531)


--- trunk/Source/WebCore/inspector/InspectorController.cpp	2011-11-30 18:44:43 UTC (rev 101530)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp	2011-11-30 18:49:06 UTC (rev 101531)
@@ -192,7 +192,6 @@
 {
     m_openingFrontend = false;
     m_inspectorFrontend = adoptPtr(new InspectorFrontend(m_inspectorClient));
-    m_injectedScriptManager->injectedScriptHost()->setFrontend(m_inspectorFrontend.get());
     // We can reconnect to existing front-end -> unmute state.
     m_state->unmute();
 
@@ -226,8 +225,6 @@
     for (Agents::iterator it = m_agents.begin(); it != m_agents.end(); ++it)
         (*it)->clearFrontend();
 
-    m_injectedScriptManager->injectedScriptHost()->clearFrontend();
-
     m_inspectorFrontend.clear();
 
     InspectorInstrumentation::frontendDeleted();

Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.cpp (101530 => 101531)


--- trunk/Source/WebCore/inspector/WorkerInspectorController.cpp	2011-11-30 18:44:43 UTC (rev 101530)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.cpp	2011-11-30 18:49:06 UTC (rev 101531)
@@ -130,7 +130,6 @@
 #endif
     m_runtimeAgent->registerInDispatcher(m_backendDispatcher.get());
 
-    m_injectedScriptManager->injectedScriptHost()->setFrontend(m_frontend.get());
 #if ENABLE(_javascript__DEBUGGER)
     m_debuggerAgent->setFrontend(m_frontend.get());
 #endif
@@ -150,7 +149,6 @@
     m_debuggerAgent->clearFrontend();
 #endif
     m_consoleAgent->clearFrontend();
-    m_injectedScriptManager->injectedScriptHost()->clearFrontend();
 
     m_frontend.clear();
     m_frontendChannel.clear();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to