Diff
Modified: trunk/Source/WebCore/ChangeLog (116739 => 116740)
--- trunk/Source/WebCore/ChangeLog 2012-05-11 08:29:08 UTC (rev 116739)
+++ trunk/Source/WebCore/ChangeLog 2012-05-11 08:42:07 UTC (rev 116740)
@@ -1,3 +1,30 @@
+2012-05-07 Yury Semikhatsky <yu...@chromium.org>
+
+ Web Inspector: get rid of InspectorAgent::emitCommitLoadIfNeeded method
+ https://bugs.webkit.org/show_bug.cgi?id=85708
+
+ Reviewed by Pavel Feldman.
+
+ Instead of calling emitCommitLoadIfNeeded after all agents are restored
+ required actions are performed directly in the restore() methods.
+
+ * inspector/InspectorAgent.cpp:
+ * inspector/InspectorAgent.h:
+ (WebCore::InspectorAgent::didCommitLoadFired):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::restoreInspectorStateFromCookie):
+ * inspector/InspectorDatabaseAgent.cpp:
+ (WebCore::InspectorDatabaseAgent::restore):
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::create):
+ (WebCore::InspectorPageAgent::InspectorPageAgent):
+ (WebCore::InspectorPageAgent::restore):
+ * inspector/InspectorPageAgent.h:
+ (WebCore):
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::InspectorResourceAgent::restore):
+
2012-05-10 Andrey Kosyakov <ca...@chromium.org>
Web Inspector: [Extensions API] add audit formatters for remote objects and DOM elements
Modified: trunk/Source/WebCore/inspector/InspectorAgent.cpp (116739 => 116740)
--- trunk/Source/WebCore/inspector/InspectorAgent.cpp 2012-05-11 08:29:08 UTC (rev 116739)
+++ trunk/Source/WebCore/inspector/InspectorAgent.cpp 2012-05-11 08:42:07 UTC (rev 116740)
@@ -80,12 +80,6 @@
m_instrumentingAgents->setInspectorAgent(0);
}
-void InspectorAgent::emitCommitLoadIfNeeded()
-{
- if (m_didCommitLoadFired)
- InspectorInstrumentation::didCommitLoad(m_inspectedPage->mainFrame(), m_inspectedPage->mainFrame()->loader()->documentLoader());
-}
-
void InspectorAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
{
if (world != mainThreadNormalWorld())
Modified: trunk/Source/WebCore/inspector/InspectorAgent.h (116739 => 116740)
--- trunk/Source/WebCore/inspector/InspectorAgent.h 2012-05-11 08:29:08 UTC (rev 116739)
+++ trunk/Source/WebCore/inspector/InspectorAgent.h 2012-05-11 08:42:07 UTC (rev 116740)
@@ -80,7 +80,7 @@
void didCommitLoad();
void domContentLoadedEventFired();
- void emitCommitLoadIfNeeded();
+ bool didCommitLoadFired() { return m_didCommitLoadFired; }
#if ENABLE(WORKERS)
void didCreateWorker(intptr_t, const String& url, bool isSharedWorker);
Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (116739 => 116740)
--- trunk/Source/WebCore/inspector/InspectorController.cpp 2012-05-11 08:29:08 UTC (rev 116739)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp 2012-05-11 08:42:07 UTC (rev 116740)
@@ -84,7 +84,7 @@
m_inspectorAgent = inspectorAgentPtr.get();
m_agents.append(inspectorAgentPtr.release());
- OwnPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_state.get(), m_injectedScriptManager.get(), inspectorClient));
+ OwnPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_inspectorAgent, m_state.get(), m_injectedScriptManager.get(), inspectorClient));
InspectorPageAgent* pageAgent = pageAgentPtr.get();
m_pageAgent = pageAgentPtr.get();
m_agents.append(pageAgentPtr.release());
@@ -274,7 +274,6 @@
for (Agents::iterator it = m_agents.begin(); it != m_agents.end(); ++it)
(*it)->restore();
- m_inspectorAgent->emitCommitLoadIfNeeded();
}
void InspectorController::setProcessId(long processId)
Modified: trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp (116739 => 116740)
--- trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp 2012-05-11 08:29:08 UTC (rev 116739)
+++ trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp 2012-05-11 08:42:07 UTC (rev 116740)
@@ -288,7 +288,7 @@
void InspectorDatabaseAgent::restore()
{
- m_enabled = m_state->getBoolean(DatabaseAgentState::databaseAgentEnabled);
+ m_enabled = m_state->getBoolean(DatabaseAgentState::databaseAgentEnabled);
}
void InspectorDatabaseAgent::getDatabaseTableNames(ErrorString* error, const String& databaseId, RefPtr<TypeBuilder::Array<String> >& names)
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (116739 => 116740)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2012-05-11 08:29:08 UTC (rev 116739)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2012-05-11 08:42:07 UTC (rev 116740)
@@ -55,6 +55,7 @@
#include "HTMLNames.h"
#include "IdentifiersFactory.h"
#include "InjectedScriptManager.h"
+#include "InspectorAgent.h"
#include "InspectorClient.h"
#include "InspectorFrontend.h"
#include "InspectorInstrumentation.h"
@@ -222,9 +223,9 @@
return decodeSharedBuffer(buffer, textEncodingName, result);
}
-PassOwnPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* instrumentingAgents, Page* page, InspectorState* state, InjectedScriptManager* injectedScriptManager, InspectorClient* client)
+PassOwnPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* instrumentingAgents, Page* page, InspectorAgent* inspectorAgent, InspectorState* state, InjectedScriptManager* injectedScriptManager, InspectorClient* client)
{
- return adoptPtr(new InspectorPageAgent(instrumentingAgents, page, state, injectedScriptManager, client));
+ return adoptPtr(new InspectorPageAgent(instrumentingAgents, page, inspectorAgent, state, injectedScriptManager, client));
}
// static
@@ -307,9 +308,10 @@
return resourceTypeJson(cachedResourceType(cachedResource));
}
-InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents, Page* page, InspectorState* inspectorState, InjectedScriptManager* injectedScriptManager, InspectorClient* client)
+InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents, Page* page, InspectorAgent* inspectorAgent, InspectorState* inspectorState, InjectedScriptManager* injectedScriptManager, InspectorClient* client)
: InspectorBaseAgent<InspectorPageAgent>("Page", instrumentingAgents, inspectorState)
, m_page(page)
+ , m_inspectorAgent(inspectorAgent)
, m_injectedScriptManager(injectedScriptManager)
, m_client(client)
, m_frontend(0)
@@ -343,6 +345,9 @@
double fontScaleFactor = m_state->getDouble(PageAgentState::pageAgentFontScaleFactorOverride);
bool fitWindow = m_state->getBoolean(PageAgentState::pageAgentFitWindow);
updateViewMetrics(width, height, fontScaleFactor, fitWindow);
+
+ if (m_inspectorAgent->didCommitLoadFired())
+ frameNavigated(m_page->mainFrame()->loader()->documentLoader());
}
}
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (116739 => 116740)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.h 2012-05-11 08:29:08 UTC (rev 116739)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h 2012-05-11 08:42:07 UTC (rev 116740)
@@ -49,6 +49,7 @@
class Frame;
class Frontend;
class InjectedScriptManager;
+class InspectorAgent;
class InspectorArray;
class InspectorClient;
class InspectorObject;
@@ -76,7 +77,7 @@
OtherResource
};
- static PassOwnPtr<InspectorPageAgent> create(InstrumentingAgents*, Page*, InspectorState*, InjectedScriptManager*, InspectorClient*);
+ static PassOwnPtr<InspectorPageAgent> create(InstrumentingAgents*, Page*, InspectorAgent*, InspectorState*, InjectedScriptManager*, InspectorClient*);
static bool cachedResourceContent(CachedResource*, String* result, bool* base64Encoded);
static bool sharedBufferContent(PassRefPtr<SharedBuffer>, const String& textEncodingName, bool withBase64Encode, String* result);
@@ -136,12 +137,13 @@
static DocumentLoader* assertDocumentLoader(ErrorString*, Frame*);
private:
- InspectorPageAgent(InstrumentingAgents*, Page*, InspectorState*, InjectedScriptManager*, InspectorClient*);
+ InspectorPageAgent(InstrumentingAgents*, Page*, InspectorAgent*, InspectorState*, InjectedScriptManager*, InspectorClient*);
void updateViewMetrics(int, int, double, bool);
PassRefPtr<TypeBuilder::Page::Frame> buildObjectForFrame(Frame*);
PassRefPtr<TypeBuilder::Page::FrameResourceTree> buildObjectForFrameTree(Frame*);
Page* m_page;
+ InspectorAgent* m_inspectorAgent;
InjectedScriptManager* m_injectedScriptManager;
InspectorClient* m_client;
InspectorFrontend::Page* m_frontend;