[Webkit-unassigned] [Bug 110779] WebKit API for enabling DOM logging for certain worlds

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 26 15:29:03 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=110779





--- Comment #13 from Ankur Taly <ataly at google.com>  2013-02-26 15:31:25 PST ---
(In reply to comment #11)
> ataly: I understood that TRACE_EVENT wouldn't be helpful for your use cases.
> 
> > So the other worlds do not see a direct slow down as a result of the logging.
> 
> Wouldn't this insert an if branch to hot DOM attribute getters/setters/methods to check whether we should log or not? (If you are just planning to insert the logging to a small part of DOM getters/setters/methods that are not hot, it would be OK.)
> 

Our goal was to avoid such an if statement as much as possible. Therefore the approach we take is to configure a different set of DOM templates for worlds with logging enabled. We check whether logging is needed, once, in the "initializeIfNeeded" method of DOMWindowShell and then set a flag in the context. Then we modify methods in V8DOMConfiguration to configure a different set of templates if the logging flag is enabled in the context. These templates have a wrapper around all the relevant callbacks, getters and setters, that first send a message to the log object and then forward the invocation.
(Ulfar E. has implemented this particular patch.). 

> > Policy could be thought of as a set of pairs of the form <cName, pName> which mean that every access to the property pName of object of class cName must be logged. We intend to use this mechanism for having a DOM activity log for Chrome extensions.
> 
> I don't understand what a policy is. Is it something exposed to developers? If you just want to know real-world usage of DOM activities, you might be able to use FeatureObservers.

A policy determines which DOM object-property accesses must be logged. For instance in the case of an extension we would be interested in logging all access to window.location, document.write, document.createElement etc., so we would add these to the policy. At the moment we plan to have a fixed policy for all worlds that is implemented as a hard-coded struct. Later we can add methods to WebCoverWrapping to also accept a per-world policy object from the chromium side.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list