Diff
Modified: trunk/Source/WebCore/ChangeLog (95091 => 95092)
--- trunk/Source/WebCore/ChangeLog 2011-09-14 14:34:32 UTC (rev 95091)
+++ trunk/Source/WebCore/ChangeLog 2011-09-14 14:59:46 UTC (rev 95092)
@@ -1,3 +1,23 @@
+2011-09-14 Pavel Feldman <[email protected]>
+
+ Not reviewed: rolling out r95089.
+
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::InspectorInstrumentation::frameDestroyedImpl):
+ (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
+ * inspector/InspectorInstrumentation.h:
+ (WebCore::InspectorInstrumentation::frameWindowDiscarded):
+ (WebCore::InspectorInstrumentation::domContentLoadedEventFired):
+ (WebCore::InspectorInstrumentation::loadEventFired):
+ (WebCore::InspectorInstrumentation::didCommitLoad):
+ (WebCore::InspectorInstrumentation::frameDestroyed):
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::frameDetached):
+ (WebCore::InspectorPageAgent::frameDestroyed):
+ * inspector/InspectorPageAgent.h:
+ * page/Frame.cpp:
+ (WebCore::Frame::~Frame):
+
2011-09-14 Ilya Tikhonovsky <[email protected]>
Web Inspector: requestAnimationFrame callbacks don't show up in the timeline panel.
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (95091 => 95092)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2011-09-14 14:34:32 UTC (rev 95091)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2011-09-14 14:59:46 UTC (rev 95092)
@@ -660,6 +660,12 @@
pageAgent->frameNavigated(loader);
}
+void InspectorInstrumentation::frameDestroyedImpl(InstrumentingAgents* instrumentingAgents, Frame* frame)
+{
+ if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents->inspectorPageAgent())
+ inspectorPageAgent->frameDestroyed(frame);
+}
+
void InspectorInstrumentation::loaderDetachedFromFrameImpl(InstrumentingAgents* instrumentingAgents, DocumentLoader* loader)
{
if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents->inspectorPageAgent())
@@ -905,8 +911,6 @@
InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForPage(Page* page)
{
- // We should not be getting 0 page here, but we are not quite ready to remove the test below.
- ASSERT(page);
if (!page)
return 0;
return instrumentationForPage(page);
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (95091 => 95092)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2011-09-14 14:34:32 UTC (rev 95091)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2011-09-14 14:59:46 UTC (rev 95092)
@@ -142,6 +142,7 @@
static void loadEventFired(Frame*, const KURL&);
static void frameDetachedFromParent(Frame*);
static void didCommitLoad(Frame*, DocumentLoader*);
+ static void frameDestroyed(Frame*);
static void loaderDetachedFromFrame(Frame*, DocumentLoader*);
static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned int length, unsigned int startLine);
@@ -276,6 +277,7 @@
static void loadEventFiredImpl(InstrumentingAgents*, Frame*, const KURL&);
static void frameDetachedFromParentImpl(InstrumentingAgents*, Frame*);
static void didCommitLoadImpl(InstrumentingAgents*, Page*, DocumentLoader*);
+ static void frameDestroyedImpl(InstrumentingAgents*, Frame*);
static void loaderDetachedFromFrameImpl(InstrumentingAgents*, DocumentLoader*);
static InspectorInstrumentationCookie willWriteHTMLImpl(InstrumentingAgents*, unsigned int length, unsigned int startLine);
@@ -416,10 +418,7 @@
inline void InspectorInstrumentation::frameWindowDiscarded(Frame* frame, DOMWindow* domWindow)
{
#if ENABLE(INSPECTOR)
- Page* page = frame->page();
- if (!page)
- return; // Entire page being destroyed.
- if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
frameWindowDiscardedImpl(instrumentingAgents, domWindow);
#endif
}
@@ -876,10 +875,7 @@
inline void InspectorInstrumentation::domContentLoadedEventFired(Frame* frame, const KURL& url)
{
#if ENABLE(INSPECTOR)
- Page* page = frame->page();
- if (!page)
- return; // DOMContentLoaded event triggered post frame detach.
- if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
domContentLoadedEventFiredImpl(instrumentingAgents, frame, url);
#endif
}
@@ -887,10 +883,7 @@
inline void InspectorInstrumentation::loadEventFired(Frame* frame, const KURL& url)
{
#if ENABLE(INSPECTOR)
- Page* page = frame->page();
- if (!page)
- return; // Load event triggered post frame detach.
- if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
loadEventFiredImpl(instrumentingAgents, frame, url);
#endif
}
@@ -906,14 +899,24 @@
inline void InspectorInstrumentation::didCommitLoad(Frame* frame, DocumentLoader* loader)
{
#if ENABLE(INSPECTOR)
+ if (!frame)
+ return;
Page* page = frame->page();
if (!page)
- return; // Commit load triggered post frame detach.
+ return;
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
didCommitLoadImpl(instrumentingAgents, page, loader);
#endif
}
+inline void InspectorInstrumentation::frameDestroyed(Frame* frame)
+{
+#if ENABLE(INSPECTOR)
+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+ frameDestroyedImpl(instrumentingAgents, frame);
+#endif
+}
+
inline void InspectorInstrumentation::loaderDetachedFromFrame(Frame* frame, DocumentLoader* loader)
{
#if ENABLE(INSPECTOR)
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (95091 => 95092)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2011-09-14 14:34:32 UTC (rev 95091)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2011-09-14 14:59:46 UTC (rev 95092)
@@ -558,12 +558,7 @@
void InspectorPageAgent::frameDetached(Frame* frame)
{
- HashMap<Frame*, String>::iterator iterator = m_frameToIdentifier.find(frame);
- if (iterator != m_frameToIdentifier.end()) {
- m_frontend->frameDetached(iterator->second);
- m_identifierToFrame.remove(iterator->second);
- m_frameToIdentifier.remove(iterator);
- }
+ m_frontend->frameDetached(frameId(frame));
}
Frame* InspectorPageAgent::mainFrame()
@@ -601,6 +596,15 @@
return identifier;
}
+void InspectorPageAgent::frameDestroyed(Frame* frame)
+{
+ HashMap<Frame*, String>::iterator iterator = m_frameToIdentifier.find(frame);
+ if (iterator != m_frameToIdentifier.end()) {
+ m_identifierToFrame.remove(iterator->second);
+ m_frameToIdentifier.remove(iterator);
+ }
+}
+
void InspectorPageAgent::loaderDetachedFromFrame(DocumentLoader* loader)
{
HashMap<DocumentLoader*, String>::iterator iterator = m_loaderToIdentifier.find(loader);
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (95091 => 95092)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.h 2011-09-14 14:34:32 UTC (rev 95091)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h 2011-09-14 14:59:46 UTC (rev 95092)
@@ -102,6 +102,7 @@
void loadEventFired();
void frameNavigated(DocumentLoader*);
void frameDetached(Frame*);
+ void frameDestroyed(Frame*);
void loaderDetachedFromFrame(DocumentLoader*);
// Inspector Controller API
Modified: trunk/Source/WebCore/page/Frame.cpp (95091 => 95092)
--- trunk/Source/WebCore/page/Frame.cpp 2011-09-14 14:34:32 UTC (rev 95091)
+++ trunk/Source/WebCore/page/Frame.cpp 2011-09-14 14:59:46 UTC (rev 95092)
@@ -238,6 +238,8 @@
for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
(*it)->frameDestroyed();
+ InspectorInstrumentation::frameDestroyed(this);
+
if (m_view) {
m_view->hide();
m_view->clearFrame();