RESOLVED FIXED Bug 92108
Web Inspector: Resource agent's reference to cached resources should be weak.
https://bugs.webkit.org/show_bug.cgi?id=92108
Summary Web Inspector: Resource agent's reference to cached resources should be weak.
Vsevolod Vlasov
Reported 2012-07-24 06:02:22 PDT
Patch to follow
Attachments
Patch (52.76 KB, patch)
2012-07-24 07:07 PDT, Vsevolod Vlasov
no flags
Patch (26.36 KB, patch)
2012-07-25 07:37 PDT, Vsevolod Vlasov
no flags
Patch (40.17 KB, patch)
2012-07-26 02:34 PDT, Vsevolod Vlasov
gustavo: commit-queue-
Patch (42.78 KB, patch)
2012-07-27 01:20 PDT, Vsevolod Vlasov
no flags
Patch (45.21 KB, patch)
2012-07-29 13:02 PDT, Vsevolod Vlasov
no flags
Vsevolod Vlasov
Comment 1 2012-07-24 07:07:04 PDT
Pavel Feldman
Comment 2 2012-07-25 02:33:15 PDT
Comment on attachment 154051 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=154051&action=review This change looks like a hack both from the API and implementation standpoint. Is there a way to implement it in a more elegant manner? > Source/WebCore/inspector/Inspector.json:871 > + { "name": "resourceId", "$ref": "Page.ResourceId", "description": "Identifier of the relevant resource." }, I don't think we should introduce resourceId concept. Why is requestId not sufficient in the API? > Source/WebCore/inspector/InspectorController.cpp:186 > + InspectorInstrumentation::inspectedPageDestroyed(m_instrumentingAgents.get()); This is very strange - InspectorController has pointers to agents explicitly as well as to m_instrumentingAgents. Why does it use InspectorInstrumentation ? > Source/WebCore/inspector/InspectorInstrumentation.cpp:854 > + if (!cachedResourceToAgentsMap || !cachedResourceToAgentsMap->contains(cachedResource)) InspectorInstrumentation is just a dispatch, it should not have logic like this. > Source/WebCore/inspector/InspectorInstrumentation.cpp:1167 > +void InspectorInstrumentation::inspectedPageDestroyed(InstrumentingAgents* instrumentingAgents) ditto > Source/WebCore/inspector/InspectorPageAgent.cpp:960 > + InspectorInstrumentation::addInstrumentingAgentsForCachedResource(cachedResource, m_instrumentingAgents); This looks like a hack.
Vsevolod Vlasov
Comment 3 2012-07-25 07:37:51 PDT
Yury Semikhatsky
Comment 4 2012-07-25 08:14:47 PDT
Comment on attachment 154351 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=154351&action=review > Source/WebCore/inspector/InspectorInstrumentation.cpp:1160 > +void InspectorInstrumentation::registerInstrumentingAgents(InstrumentingAgents* instrumentingAgents) Why not iterate through all pages (see allPages in Page.cpp) and get InstrumentingAgents from Page instead of introducing a HashSet of all InstrumentingAgents instances?
Yury Semikhatsky
Comment 5 2012-07-25 08:20:09 PDT
Comment on attachment 154351 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=154351&action=review > Source/WebCore/inspector/InspectorInstrumentation.h:98 > + friend class InspectorController; I'd rather make (un)registerInstrumentingAgents methods public instead of adding friend class.
Pavel Feldman
Comment 6 2012-07-25 08:24:41 PDT
Comment on attachment 154351 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=154351&action=review How do we test this? > Source/WebCore/loader/cache/CachedResource.cpp:434 > + if (!deleteIfPossible() && !hasClients() && inCache()) { bool deleted = ... > Source/WebCore/loader/cache/CachedResourceLoader.cpp:816 > + if (!res->deleteIfPossible() && res->preloadResult() == CachedResource::PreloadNotReferenced) ditto
Vsevolod Vlasov
Comment 7 2012-07-26 01:48:26 PDT
WebKit Review Bot
Comment 8 2012-07-26 02:23:01 PDT
Re-opened since this is blocked by 92356
Vsevolod Vlasov
Comment 9 2012-07-26 02:34:42 PDT
Gustavo Noronha (kov)
Comment 10 2012-07-26 06:35:17 PDT
Build Bot
Comment 11 2012-07-26 14:04:44 PDT
Vsevolod Vlasov
Comment 12 2012-07-27 01:20:31 PDT
WebKit Review Bot
Comment 13 2012-07-27 07:32:09 PDT
Comment on attachment 154351 [details] Patch Cleared Pavel Feldman's review+ from obsolete attachment 154351 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Timothy Hatcher
Comment 14 2012-07-27 08:26:50 PDT
Comment on attachment 154874 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=154874&action=review > Source/WebCore/inspector/NetworkResourcesData.h:97 > + size_t dataLength() const; > + void appendData(const char* data, size_t dataLength); > + size_t decodeDataToContent(); All these int => size_t chanegs should be done in a seperate change. It has nothing to do with making the resources weak, it is just noise here.
Build Bot
Comment 15 2012-07-27 14:52:51 PDT
Vsevolod Vlasov
Comment 16 2012-07-29 13:02:36 PDT
Vsevolod Vlasov
Comment 17 2012-07-30 00:55:16 PDT
Chris Dumez
Comment 18 2012-07-30 04:20:04 PDT
This patch appears to cause crashes at least on EFL port. I opened Bug 92628 to address it.
Chris Dumez
Comment 19 2012-07-30 04:21:28 PDT
Comment on attachment 155178 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=155178&action=review > Source/WebCore/inspector/InspectorInstrumentation.cpp:1173 > + delete instrumentingAgentsSet; I believe we should reset instrumentingAgentsSet to 0 after calling delete.
WebKit Review Bot
Comment 20 2012-07-30 04:42:06 PDT
Re-opened since this is blocked by 92632
Vsevolod Vlasov
Comment 21 2012-07-30 08:59:10 PDT
Note You need to log in before you can comment on or make changes to this bug.