Bug 78406 - Move CSSOM wrapper pointer out of StylePropertySet
Summary: Move CSSOM wrapper pointer out of StylePropertySet
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 77745
  Show dependency treegraph
 
Reported: 2012-02-10 18:51 PST by Antti Koivisto
Modified: 2012-04-11 20:53 PDT (History)
4 users (show)

See Also:


Attachments
patch (5.28 KB, patch)
2012-02-10 23:04 PST, Antti Koivisto
kling: review+
kling: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2012-02-10 18:51:09 PST
...to a global HashMap.
Comment 1 Antti Koivisto 2012-02-10 23:04:24 PST
Created attachment 126620 [details]
patch
Comment 2 Andreas Kling 2012-02-10 23:33:15 PST
Comment on attachment 126620 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=126620&action=review

r=me with one fix:

> Source/WebCore/css/StylePropertySet.cpp:49
> +static PropertySetCSSOMWrapperMap* propertySetCSSOMWrapperMap;

This pointer needs to be explicitly initialized.
Also, a common pattern in WebKit is to write these like so:

static PropertySetCSSOMWrapperMap& propertySetCSSOMWrapperMap()
{
    DEFINE_STATIC_LOCAL(PropertySetCSSOMWrapperMap, derp, ());
    return derp;
}
Comment 3 Andreas Kling 2012-02-10 23:39:17 PST
(In reply to comment #2)
> (From update of attachment 126620 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=126620&action=review
> 
> r=me with one fix:
> 
> > Source/WebCore/css/StylePropertySet.cpp:49
> > +static PropertySetCSSOMWrapperMap* propertySetCSSOMWrapperMap;
> 
> This pointer needs to be explicitly initialized.

Disregard this cool story, bro. TIL that static globals are zero-initialized..
Comment 4 Antti Koivisto 2012-02-10 23:52:57 PST
http://trac.webkit.org/changeset/107474

The pattern looks nicer so I did it anyway.