WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
92739
Web Inspector: Protocol: Add "namedFlowCreated" and "namedFlowRemoved" events
https://bugs.webkit.org/show_bug.cgi?id=92739
Summary
Web Inspector: Protocol: Add "namedFlowCreated" and "namedFlowRemoved" events
Andrei Poenaru
Reported
2012-07-31 04:13:59 PDT
Extends the protocol with "namedFlowCreated" and "namedFlowRemoved" events.
Attachments
Inspector Extension
(3.03 KB, application/octet-stream)
2012-07-31 04:15 PDT
,
Andrei Poenaru
no flags
Details
Patch
(17.75 KB, patch)
2012-07-31 06:53 PDT
,
Andrei Poenaru
pfeldman
: review-
Details
Formatted Diff
Diff
Patch
(18.43 KB, patch)
2012-08-03 01:21 PDT
,
Andrei Poenaru
pfeldman
: review-
Details
Formatted Diff
Diff
Patch
(18.26 KB, patch)
2012-08-03 04:20 PDT
,
Andrei Poenaru
pfeldman
: review-
Details
Formatted Diff
Diff
Patch
(18.79 KB, patch)
2012-08-06 07:58 PDT
,
Andrei Poenaru
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Andrei Poenaru
Comment 1
2012-07-31 04:15:02 PDT
Created
attachment 155486
[details]
Inspector Extension
Andrei Poenaru
Comment 2
2012-07-31 06:53:15 PDT
Created
attachment 155521
[details]
Patch
Pavel Feldman
Comment 3
2012-08-02 12:00:32 PDT
Comment on
attachment 155521
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155521&action=review
> Source/WebCore/inspector/InspectorCSSAgent.cpp:540 > + int nodeId = m_domAgent->boundNodeId(static_cast<Node*>(document));
There is no need to cast document to Node, Document is a Node.
> Source/WebCore/inspector/InspectorCSSAgent.cpp:541 > + if (!nodeId)
I am not sure this is what you want. You only report creation / destruction of the flows when document node on the front-end is visible. So every time document node is received on the front-end (user expanded an <iframe> tag), you want to query for document's existing named flows and dispatch corresponding events.
> Source/WebCore/inspector/InspectorCSSAgent.cpp:550 > + int nodeId = m_domAgent->boundNodeId(static_cast<Node*>(document));
ditto
Andrei Poenaru
Comment 4
2012-08-03 01:21:02 PDT
Created
attachment 156285
[details]
Patch
Pavel Feldman
Comment 5
2012-08-03 02:31:56 PDT
Comment on
attachment 156285
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156285&action=review
Couple more nits, one of them depends on another bug Alexander is filing.
> Source/WebCore/dom/WebKitNamedFlowCollection.cpp:83 > +#if ENABLE(INSPECTOR)
You should not surround Instrumentation calls with #if ENABLE.
> Source/WebCore/dom/WebKitNamedFlowCollection.cpp:101 > +#if ENABLE(INSPECTOR)
ditto
> Source/WebCore/inspector/InspectorCSSAgent.cpp:540 > + int nodeId = m_domAgent->pushNodePathToFrontend(document);
pushChildNodesToFrontend implies there is a front-end.
> Source/WebCore/inspector/InspectorCSSAgent.cpp:542 > + if (m_frontend)
You should not make this check. In fact, you should not be getting into this method when there is no m_frontend. It is a bug in InspectorCSSAgent that needs to be addressed. I'll ask apavlov@ to handle it.
Pavel Feldman
Comment 6
2012-08-03 02:32:08 PDT
Comment on
attachment 156285
[details]
Patch r- per comments
Andrei Poenaru
Comment 7
2012-08-03 04:20:46 PDT
Created
attachment 156323
[details]
Patch
Pavel Feldman
Comment 8
2012-08-06 06:34:38 PDT
Comment on
attachment 156323
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156323&action=review
Looks good, once issue below...
> Source/WebCore/inspector/InspectorCSSAgent.cpp:540 > + m_frontend->namedFlowCreated(m_domAgent->pushNodePathToFrontend(document), name.string());
Sorry for not spotting this earlier. By design, protocol should not emit any events unless they are explicitly requested by the client. In your case, attaching to the backend will start populating DOM with nodes and issuing these events. So we need to figure out how to prevent that from happening. What we try to do in such cases is: - events are not generated unless getNamedFlowCollection is called for given document node - once getNamedFlowCollection was called at least once, namedFromCreated/Deleted events start flowing to the front-end That will make behaviour consistent: once you asked for the present state, you get update notifications, you would not need to call pushNodePathToFrontend anymore - boundNodeId would be sufficient.
Andrei Poenaru
Comment 9
2012-08-06 07:58:50 PDT
Created
attachment 156695
[details]
Patch
WebKit Review Bot
Comment 10
2012-08-06 09:40:12 PDT
Comment on
attachment 156695
[details]
Patch Clearing flags on attachment: 156695 Committed
r124778
: <
http://trac.webkit.org/changeset/124778
>
WebKit Review Bot
Comment 11
2012-08-06 09:40:16 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug