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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 28 00:48:09 PST 2013


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


Adam Barth <abarth at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #190625|review?                     |review+, commit-queue-
               Flag|                            |




--- Comment #25 from Adam Barth <abarth at webkit.org>  2013-02-28 00:50:32 PST ---
(From update of attachment 190625)
View in context: https://bugs.webkit.org/attachment.cgi?id=190625&action=review

Ok, this generally looks good.  Below are a bunch of naming nits.

> Source/WebCore/bindings/v8/DOMWrapperWorld.cpp:225
> +typedef HashMap< int, OwnPtr<V8DOMActivityLogger>, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int> > DOMActivityLoggerMap; 

"< int"  <--- please remove space between < and int

I bet the WTF:: prefixes aren't needed on this line.

> Source/WebCore/bindings/v8/DOMWrapperWorld.cpp:233
> +void DOMWrapperWorld::setDOMActivityLogger(int worldID, PassOwnPtr<V8DOMActivityLogger> logger)

worldID -> worldId

We're not super consistent about this in WebCore, but I think we're supposed to match the DOM style (e.g., getElementById)

setDOMActivityLogger -> setActivityLogger

(We already know we're talking about the DOM because this is a method of DOMWrapperWorld.)

> Source/WebCore/bindings/v8/DOMWrapperWorld.cpp:238
> +V8DOMActivityLogger* DOMWrapperWorld::getDOMActivityLogger(int worldID)

Please remove the "get" prefix.  getDOMActivityLogger -> activityLogger

> Source/WebCore/bindings/v8/DOMWrapperWorld.cpp:240
> +    DOMActivityLoggerMap& loggers = domActivityLoggers();

This could be a const reverence.

> Source/WebCore/bindings/v8/DOMWrapperWorld.cpp:242
> +    return it == loggers.end() ? 0 : (it->value).get();

(it->value)   <--- the ( ) aren't needed.

> Source/WebCore/bindings/v8/DOMWrapperWorld.h:95
> +    // Associate a logger object with the world identified by worldID (worlID may be 0

object  <-- this word is redundant and can be removed.

> Source/WebCore/bindings/v8/V8DOMActivityLogger.h:42
> +    virtual void log(const char* apiCall, int argc, const v8::Handle<v8::Value>* args, const char* extra) { }

apiCall -> functionName ?  methodName ?  It's not a "call"...
args -> argv

What is "extra" ?

> Source/WebKit/chromium/public/WebDOMActivityLogger.h:47
> +bool hasDOMActivityLogger(int worldID);

You're going to need to mark this function and setDOMActivityLogger with WEBKIT_EXPORT so that the component build will link.

> Source/WebKit/chromium/src/WebDOMActivityLogger.cpp:49
> +    virtual ~DOMActivityLoggerContainer() { }

You can skip this line.  The compiler will generate it for you.

> Source/WebKit/chromium/src/WebDOMActivityLogger.cpp:66
> +    if (logger)

It's probably better to make it an error to call this function with a null pointer.  The way to do that is to ASSERT(logger).

-- 
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