[webkit-reviews] review granted: [Bug 126144] [WK2] Replace usage of DEFINE_STATIC_LOCAL with NeverDestroyed : [Attachment 219888] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 22 21:27:06 PST 2013


Anders Carlsson <andersca at apple.com> has granted Sam Weinig <sam at webkit.org>'s
request for review:
Bug 126144: [WK2] Replace usage of DEFINE_STATIC_LOCAL with NeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=126144

Attachment 219888: Patch
https://bugs.webkit.org/attachment.cgi?id=219888&action=review

------- Additional Comments from Anders Carlsson <andersca at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=219888&action=review


> Source/WebKit2/Shared/WebContextMenuItem.cpp:61
> +    static NeverDestroyed<WebContextMenuItem*> separatorItem(adoptRef(new
WebContextMenuItem(WebContextMenuItemData(WebCore::SeparatorType,
WebCore::ContextMenuItemTagNoAction, String(), true, false))).leakRef());

This can just be a raw pointer!

> Source/WebKit2/UIProcess/WebContext.cpp:117
> +    static NeverDestroyed<Vector<WebContext*>> contexts;;

Extra semicolon.

> Source/WebKit2/UIProcess/cf/WebBackForwardListCF.cpp:51
> +    static CFNumberRef version = CFNumberCreate(0, kCFNumberCFIndexType,
&currentVersionAsCFIndex);

Nah, this doesn't need to be static.

> Source/WebKit2/UIProcess/cf/WebBackForwardListCF.cpp:62
> +static CFStringRef SessionHistoryVersionKey =
CFSTR("SessionHistoryVersion");
> +static CFStringRef SessionHistoryCurrentIndexKey =
CFSTR("SessionHistoryCurrentIndex");
> +static CFStringRef SessionHistoryEntriesKey =
CFSTR("SessionHistoryEntries");
> +static CFStringRef SessionHistoryEntryTitleKey =
CFSTR("SessionHistoryEntryTitle");
> +static CFStringRef SessionHistoryEntryURLKey =
CFSTR("SessionHistoryEntryURL");
> +static CFStringRef SessionHistoryEntryOriginalURLKey =
CFSTR("SessionHistoryEntryOriginalURL");
> +static CFStringRef SessionHistoryEntryDataKey =
CFSTR("SessionHistoryEntryData");

Very nice. I think all these names should start with a lower case s.

> Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp:45
> +static CFStringRef SessionHistoryKey = CFSTR("SessionHistory");
> +static CFStringRef ProvisionalURLKey = CFSTR("ProvisionalURL");

Lowercase s and p.

> Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:50
> +    static uint64_t identifier = 1;
> +    return identifier++;

static uint64_t identifier;
return ++identifier;


More information about the webkit-reviews mailing list