Bug 102483 - Web Inspector: use events for instrumentation
Summary: Web Inspector: use events for instrumentation
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Kosyakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-16 04:48 PST by Andrey Kosyakov
Modified: 2014-12-13 14:38 PST (History)
15 users (show)

See Also:


Attachments
Proof of concept implementation -- just several timeline events replaced (121.20 KB, patch)
2012-11-16 05:25 PST, Andrey Kosyakov
buildbot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Kosyakov 2012-11-16 04:48:14 PST
Adding instrumentation for new events is currently very cumbersome, as it requires a lot of plumbing. Currently, a new timeline event adds at 3-6 new methods. Plumbing events from other modules (e.g. platform or embedder) or from different threads is event more inconvenient.
It is suggested to use event-bases system for delivering instrumentation events from call site to consumer (e.g. inspector or other tools, such as event tracer). This would also let us to unify call sites with event tracer in the future.
Comment 1 Andrey Kosyakov 2012-11-16 05:25:11 PST
Created attachment 174652 [details]
Proof of concept implementation -- just several timeline events replaced
Comment 2 Build Bot 2012-11-16 06:02:24 PST
Comment on attachment 174652 [details]
Proof of concept implementation -- just several timeline events replaced

Attachment 174652 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14857634
Comment 3 Build Bot 2012-11-16 16:43:55 PST
Comment on attachment 174652 [details]
Proof of concept implementation -- just several timeline events replaced

Attachment 174652 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14878058
Comment 4 Pavel Feldman 2012-11-20 09:44:22 PST
Comment on attachment 174652 [details]
Proof of concept implementation -- just several timeline events replaced

Clearing r? as this requires long offline discussions.
Comment 5 Pavel Feldman 2012-11-20 10:20:57 PST
Summary of offline discussion with Andrey:
Pavel: I don't like the fact that there is no place to look up the event signature
Andrey: I agree, but what are our options?

Pavel: I don't see the necessity of the intermediate data format, I'd rather pass raw types to the recipients and let them serialize it all.
Andrey: I can live with that


Pavel suggests:
Frankly speaking, I don't like macro definitions and I think that creating classes for events is overengineering. Can we keep things simple and define an interface per instrumentation module (much like PlatformInstrumentation and InspectorInstrumentation)? I don't think we need to support multiple clients at a time. Yes, it does require putting together stupid lines of code such as

inline void PlatformInstrumentation::willDecodeImage(const String& imageType)
{
    FAST_RETURN_IF_NO_CLIENT();
    m_client->willDecodeImage(imageType);
}

But is it that bad after all? A method in the interface, a delegating guard method like this and we are good to go?

Or should we define these in the IDL files and generate this delegating thing out of it?