RESOLVED DUPLICATE of bug 105722 105438
Web Inspector: Provide an isolated InspectorState instance rather than the shared one for each Agent
https://bugs.webkit.org/show_bug.cgi?id=105438
Summary Web Inspector: Provide an isolated InspectorState instance rather than the sh...
Alexander Pavlov (apavlov)
Reported 2012-12-19 08:15:32 PST
Patch to follow.
Attachments
Patch (4.57 KB, patch)
2012-12-20 06:59 PST, Alexander Pavlov (apavlov)
no flags
Patch (56.46 KB, patch)
2012-12-21 07:13 PST, Alexander Pavlov (apavlov)
no flags
Patch (56.56 KB, patch)
2012-12-21 07:37 PST, Alexander Pavlov (apavlov)
no flags
Patch (56.55 KB, patch)
2012-12-23 23:31 PST, Alexander Pavlov (apavlov)
yurys: review+
Alexander Pavlov (apavlov)
Comment 1 2012-12-20 06:59:37 PST
Andrey Kosyakov
Comment 2 2012-12-20 07:08:27 PST
Comment on attachment 180336 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180336&action=review > Source/WebCore/inspector/InspectorPageAgent.cpp:-417 > - if (!scripts) { Why is this gone?
Alexander Pavlov (apavlov)
Comment 3 2012-12-20 07:12:53 PST
Comment on attachment 180336 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180336&action=review >> Source/WebCore/inspector/InspectorPageAgent.cpp:-417 >> - if (!scripts) { > > Why is this gone? Please see the changelog entry for this method and getObject() implementation :)
Andrey Kosyakov
Comment 4 2012-12-20 07:30:50 PST
Comment on attachment 180336 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180336&action=review >>> Source/WebCore/inspector/InspectorPageAgent.cpp:-417 >>> - if (!scripts) { >> >> Why is this gone? > > Please see the changelog entry for this method and getObject() implementation :) Ok, I see. I did not know the fact that getObject() creates object if field is missing. The sad fact is that it sort of counters the effect of remove upon the first check of this property. Looks like we might be better off with replacing a call to remove() with setting the field to an empty object.
Pavel Feldman
Comment 5 2012-12-20 07:39:03 PST
Comment on attachment 180336 [details] Patch I'd suggest the following refactoring that would make things even better: structure state so that instead of holding all agents' states in a single flat m_properties map, it would have an object property per agent. The resetting the state of a particular agent would be as simple as resetting its state object (or replacing it with new blank object). Such refactoring would require InspectorController to shard state object and pass individual InspectorState into each of the agents.
Alexander Pavlov (apavlov)
Comment 6 2012-12-21 07:13:15 PST
Build Bot
Comment 7 2012-12-21 07:20:34 PST
Alexander Pavlov (apavlov)
Comment 8 2012-12-21 07:37:17 PST
Yury Semikhatsky
Comment 9 2012-12-21 08:01:30 PST
Comment on attachment 180522 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180522&action=review > Source/WebCore/inspector/InspectorState.cpp:118 > + InspectorState* result = new InspectorState(this, stateProperties); This should be OwnPtr<InspectorState> or you can inline this. > Source/WebCore/inspector/InspectorState.cpp:123 > +void InspectorCompositeState::loadFromCookie(const String& InspectorCompositeStateCookie) InspectorCompositeStateCookie -> inspectorCompositeStateCookie
Alexander Pavlov (apavlov)
Comment 10 2012-12-23 23:31:05 PST
Yury Semikhatsky
Comment 11 2012-12-24 00:31:58 PST
Comment on attachment 180649 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180649&action=review > Source/WebCore/ChangeLog:3 > + Web Inspector: Make use of the new InspectorState::remove() in inspector agents The main part of this change is about introduction of a composite state that allows to avoid name collisions, we should probably rename the bug.
Alexander Pavlov (apavlov)
Comment 12 2012-12-24 00:50:06 PST
The change in its current variation allows to get rid of agent-specific prefix hacks for state property names.
Alexander Pavlov (apavlov)
Comment 13 2012-12-24 01:08:44 PST
WebKit Review Bot
Comment 14 2012-12-24 08:41:16 PST
Re-opened since this is blocked by bug 105723
Alexander Pavlov (apavlov)
Comment 15 2012-12-28 23:56:25 PST
Re-implemented in bug 105722. *** This bug has been marked as a duplicate of bug 105722 ***
Note You need to log in before you can comment on or make changes to this bug.