[webkit-reviews] review granted: [Bug 110779] WebKit API for enabling DOM logging for certain worlds : [Attachment 190625] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 28 00:48:07 PST 2013
Adam Barth <abarth at webkit.org> has granted Ankur Taly <ataly at google.com>'s
request for review:
Bug 110779: WebKit API for enabling DOM logging for certain worlds
https://bugs.webkit.org/show_bug.cgi?id=110779
Attachment 190625: Patch
https://bugs.webkit.org/attachment.cgi?id=190625&action=review
------- Additional Comments from Adam Barth <abarth at webkit.org>
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).
More information about the webkit-reviews
mailing list