Commit 519c34fc authored by loislo@chromium.org's avatar loislo@chromium.org

2011-02-09 Ilya Tikhonovsky <loislo@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: InspectorAgent should know nothing about InspectorController instance.

        https://bugs.webkit.org/show_bug.cgi?id=54100

        * inspector/InspectorAgent.cpp:
        (WebCore::InspectorAgent::InspectorAgent):
        (WebCore::InspectorAgent::restoreInspectorStateFromCookie):
        (WebCore::InspectorAgent::disconnectFrontend):
        * inspector/InspectorAgent.h:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::InspectorController):
        (WebCore::InspectorController::disconnectFrontend):
        (WebCore::InspectorController::restoreInspectorStateFromCookie):

git-svn-id: svn://svn.chromium.org/blink/trunk@78056 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6c9106a0
2011-02-09 Ilya Tikhonovsky <loislo@chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: InspectorAgent should know nothing about InspectorController instance.
https://bugs.webkit.org/show_bug.cgi?id=54100
* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::InspectorAgent):
(WebCore::InspectorAgent::restoreInspectorStateFromCookie):
(WebCore::InspectorAgent::disconnectFrontend):
* inspector/InspectorAgent.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::restoreInspectorStateFromCookie):
2011-02-09 Pavel Podivilov <podivilov@chromium.org> 2011-02-09 Pavel Podivilov <podivilov@chromium.org>
Reviewed by Pavel Feldman. Reviewed by Pavel Feldman.
...@@ -140,9 +140,8 @@ static const char scriptsPanelName[] = "scripts"; ...@@ -140,9 +140,8 @@ static const char scriptsPanelName[] = "scripts";
static const char consolePanelName[] = "console"; static const char consolePanelName[] = "console";
static const char profilesPanelName[] = "profiles"; static const char profilesPanelName[] = "profiles";
InspectorAgent::InspectorAgent(InspectorController* inspectorController, Page* page, InspectorClient* client) InspectorAgent::InspectorAgent(Page* page, InspectorClient* client)
: m_inspectorController(inspectorController) : m_inspectedPage(page)
, m_inspectedPage(page)
, m_client(client) , m_client(client)
, m_frontend(0) , m_frontend(0)
, m_cssAgent(new InspectorCSSAgent()) , m_cssAgent(new InspectorCSSAgent())
...@@ -198,13 +197,9 @@ void InspectorAgent::restoreInspectorStateFromCookie(const String& inspectorStat ...@@ -198,13 +197,9 @@ void InspectorAgent::restoreInspectorStateFromCookie(const String& inspectorStat
{ {
m_state->restoreFromInspectorCookie(inspectorStateCookie); m_state->restoreFromInspectorCookie(inspectorStateCookie);
if (!m_frontend) { m_frontend->frontendReused();
m_inspectorController->connectFrontend(); m_frontend->inspectedURLChanged(inspectedURL().string());
m_frontend->frontendReused(); pushDataCollectedOffline();
m_frontend->inspectedURLChanged(inspectedURL().string());
m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());
pushDataCollectedOffline();
}
m_resourceAgent = InspectorResourceAgent::restore(m_inspectedPage, m_state.get(), m_frontend); m_resourceAgent = InspectorResourceAgent::restore(m_inspectedPage, m_state.get(), m_frontend);
...@@ -365,8 +360,6 @@ void InspectorAgent::disconnectFrontend() ...@@ -365,8 +360,6 @@ void InspectorAgent::disconnectFrontend()
m_frontend = 0; m_frontend = 0;
m_inspectorController->disconnectFrontendImpl();
#if ENABLE(JAVASCRIPT_DEBUGGER) #if ENABLE(JAVASCRIPT_DEBUGGER)
// If the window is being closed with the debugger enabled, // If the window is being closed with the debugger enabled,
// remember this state to re-enable debugger on the next window // remember this state to re-enable debugger on the next window
......
...@@ -59,7 +59,6 @@ class InspectorArray; ...@@ -59,7 +59,6 @@ class InspectorArray;
class InspectorBrowserDebuggerAgent; class InspectorBrowserDebuggerAgent;
class InspectorClient; class InspectorClient;
class InspectorConsoleAgent; class InspectorConsoleAgent;
class InspectorController;
class InspectorCSSAgent; class InspectorCSSAgent;
class InspectorDOMAgent; class InspectorDOMAgent;
class InspectorDOMStorageAgent; class InspectorDOMStorageAgent;
...@@ -108,7 +107,7 @@ class InspectorAgent { ...@@ -108,7 +107,7 @@ class InspectorAgent {
WTF_MAKE_NONCOPYABLE(InspectorAgent); WTF_MAKE_NONCOPYABLE(InspectorAgent);
WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_FAST_ALLOCATED;
public: public:
InspectorAgent(InspectorController*, Page*, InspectorClient*); InspectorAgent(Page*, InspectorClient*);
virtual ~InspectorAgent(); virtual ~InspectorAgent();
InspectorClient* inspectorClient() { return m_client; } InspectorClient* inspectorClient() { return m_client; }
...@@ -141,7 +140,6 @@ public: ...@@ -141,7 +140,6 @@ public:
InspectorResourceAgent* resourceAgent(); InspectorResourceAgent* resourceAgent();
InspectorController* inspectorController() { return m_inspectorController; };
InspectorAgent* inspectorAgent() { return this; } InspectorAgent* inspectorAgent() { return this; }
InspectorConsoleAgent* consoleAgent() { return m_consoleAgent.get(); } InspectorConsoleAgent* consoleAgent() { return m_consoleAgent.get(); }
InspectorCSSAgent* cssAgent() { return m_cssAgent.get(); } InspectorCSSAgent* cssAgent() { return m_cssAgent.get(); }
...@@ -276,7 +274,6 @@ private: ...@@ -276,7 +274,6 @@ private:
void focusNode(); void focusNode();
bool isMainResourceLoader(DocumentLoader*, const KURL& requestUrl); bool isMainResourceLoader(DocumentLoader*, const KURL& requestUrl);
InspectorController* m_inspectorController;
Page* m_inspectedPage; Page* m_inspectedPage;
InspectorClient* m_client; InspectorClient* m_client;
InspectorFrontend* m_frontend; InspectorFrontend* m_frontend;
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
namespace WebCore { namespace WebCore {
InspectorController::InspectorController(Page* page, InspectorClient* inspectorClient) InspectorController::InspectorController(Page* page, InspectorClient* inspectorClient)
: m_inspectorAgent(new InspectorAgent(this, page, inspectorClient)) : m_inspectorAgent(new InspectorAgent(page, inspectorClient))
, m_inspectorBackendDispatcher(new InspectorBackendDispatcher(m_inspectorAgent.get())) , m_inspectorBackendDispatcher(new InspectorBackendDispatcher(m_inspectorAgent.get()))
, m_inspectorClient(inspectorClient) , m_inspectorClient(inspectorClient)
, m_openingFrontend(false) , m_openingFrontend(false)
...@@ -104,20 +104,18 @@ void InspectorController::connectFrontend() ...@@ -104,20 +104,18 @@ void InspectorController::connectFrontend()
} }
void InspectorController::disconnectFrontend() void InspectorController::disconnectFrontend()
{
m_inspectorAgent->disconnectFrontend();
}
void InspectorController::disconnectFrontendImpl()
{ {
if (!m_inspectorFrontend) if (!m_inspectorFrontend)
return; return;
m_inspectorAgent->disconnectFrontend();
m_inspectorFrontend.clear(); m_inspectorFrontend.clear();
InspectorInstrumentation::frontendDeleted(); InspectorInstrumentation::frontendDeleted();
if (!InspectorInstrumentation::hasFrontends()) if (!InspectorInstrumentation::hasFrontends())
ScriptController::setCaptureCallStackForUncaughtExceptions(false); ScriptController::setCaptureCallStackForUncaughtExceptions(false);
} }
void InspectorController::show() void InspectorController::show()
...@@ -146,6 +144,8 @@ void InspectorController::close() ...@@ -146,6 +144,8 @@ void InspectorController::close()
void InspectorController::restoreInspectorStateFromCookie(const String& inspectorStateCookie) void InspectorController::restoreInspectorStateFromCookie(const String& inspectorStateCookie)
{ {
ASSERT(!m_inspectorFrontend);
connectFrontend();
m_inspectorAgent->restoreInspectorStateFromCookie(inspectorStateCookie); m_inspectorAgent->restoreInspectorStateFromCookie(inspectorStateCookie);
} }
......
...@@ -100,12 +100,8 @@ public: ...@@ -100,12 +100,8 @@ public:
#endif #endif
private: private:
friend class InspectorAgent;
friend class PostWorkerNotificationToFrontendTask; friend class PostWorkerNotificationToFrontendTask;
void disconnectFrontendImpl(); // used by InspectorAgent
void frontendLoaded();
OwnPtr<InspectorAgent> m_inspectorAgent; OwnPtr<InspectorAgent> m_inspectorAgent;
OwnPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher; OwnPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher;
OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient; OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment