Web Inspector: make sure InspectorInstrumentationCookie is invalidated if inspected...
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2013 12:37:08 +0000 (12:37 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2013 12:37:08 +0000 (12:37 +0000)
commitbd4cb3dbae58599979eaa5bc08b65d5b9a7df851
tree329fe5d15596744841a463770e9e5b68ec583d3e
parentc9958a5e606f2f59488e7b75466bea162eb2aee7
Web Inspector: make sure InspectorInstrumentationCookie is invalidated if inspected page was destroyed
https://bugs.webkit.org/show_bug.cgi?id=107232

Reviewed by Pavel Feldman.

Made InstrumentingAgents reference counted to make sure it is not deleted while there is
InspectorInstrumentationCookie with reference to it.

Introduced InstrumentingAgents::reset that is called from inspector controller destructor
to double check that references to all deleted agents are cleared.

InspectorInstrumentationCookie turned from std::pair into a custom class so that
we can avoid inclusion of InstrumentingAgents.h into InspectorInstrumentation.h

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::~InspectorController):
* inspector/InspectorController.h:
(InspectorController):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentationCookie::InspectorInstrumentationCookie):
(WebCore::InspectorInstrumentationCookie::operator=):
(WebCore::InspectorInstrumentationCookie::~InspectorInstrumentationCookie):
(WebCore::InspectorInstrumentation::didHandleEventImpl):
(WebCore::InspectorInstrumentation::didFireTimerImpl):
(WebCore::InspectorInstrumentation::didLayoutImpl):
(WebCore::InspectorInstrumentation::didPaintImpl):
(WebCore::InspectorInstrumentation::didRecalculateStyleImpl):
(WebCore::InspectorInstrumentation::didMatchRuleImpl):
(WebCore::InspectorInstrumentation::didProcessRuleImpl):
(WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
(WebCore::InspectorInstrumentation::retrieveTimelineAgent):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentationCookie):
(WebCore::InspectorInstrumentation::didCallFunction):
(WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent):
(WebCore::InspectorInstrumentation::didDispatchEvent):
(WebCore::InspectorInstrumentation::didHandleEvent):
(WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
(WebCore::InspectorInstrumentation::didEvaluateScript):
(WebCore::InspectorInstrumentation::didFireTimer):
(WebCore::InspectorInstrumentation::didLayout):
(WebCore::InspectorInstrumentation::didDispatchXHRLoadEvent):
(WebCore::InspectorInstrumentation::didPaint):
(WebCore::InspectorInstrumentation::didRecalculateStyle):
(WebCore::InspectorInstrumentation::didMatchRule):
(WebCore::InspectorInstrumentation::didProcessRule):
(WebCore::InspectorInstrumentation::didReceiveResourceData):
(WebCore::InspectorInstrumentation::didWriteHTML):
(WebCore::InspectorInstrumentation::didFireAnimationFrame):
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::InstrumentingAgents):
(WebCore):
(WebCore::InstrumentingAgents::reset):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::create):
(InstrumentingAgents):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::~WorkerInspectorController):
* inspector/WorkerInspectorController.h:
(WorkerInspectorController):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InstrumentingAgents.cpp
Source/WebCore/inspector/InstrumentingAgents.h
Source/WebCore/inspector/WorkerInspectorController.cpp
Source/WebCore/inspector/WorkerInspectorController.h