Bug 130601 - Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T> in bridge/
Summary: Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T> in bridge/
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sergio Villar Senin
URL:
Keywords:
Depends on:
Blocks: 130185
  Show dependency treegraph
 
Reported: 2014-03-21 09:48 PDT by Sergio Villar Senin
Modified: 2014-03-21 10:32 PDT (History)
5 users (show)

See Also:


Attachments
Patch (5.57 KB, patch)
2014-03-21 09:53 PDT, Sergio Villar Senin
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Villar Senin 2014-03-21 09:48:25 PDT
Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T> in bridge/
Comment 1 Sergio Villar Senin 2014-03-21 09:53:31 PDT
Created attachment 227448 [details]
Patch
Comment 2 Darin Adler 2014-03-21 10:00:01 PDT
Comment on attachment 227448 [details]
Patch

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

> Source/WebCore/bridge/runtime_root.cpp:65
> -    RootObjectSet::const_iterator end = rootObjectSet()->end();
> -    for (RootObjectSet::const_iterator it = rootObjectSet()->begin(); it != end; ++it) {
> +    RootObjectSet::const_iterator end = rootObjectSet().end();
> +    for (RootObjectSet::const_iterator it = rootObjectSet().begin(); it != end; ++it) {
>          if ((*it)->gcIsProtected(jsObject))
>              return *it;
>      }

I would’ve switched to a new style for loop if I had to touch this code for another reason.

    for (auto* rootObject : rootObjectSet()) {
        if (rootObject->gcIsProtected(jsObject))
            return rootObject;
    }

> Source/WebCore/bridge/runtime_root.cpp:75
> -    RootObjectSet::const_iterator end = rootObjectSet()->end();
> -    for (RootObjectSet::const_iterator it = rootObjectSet()->begin(); it != end; ++it) {
> +    RootObjectSet::const_iterator end = rootObjectSet().end();
> +    for (RootObjectSet::const_iterator it = rootObjectSet().begin(); it != end; ++it) {
>          if ((*it)->globalObject() == globalObject)
>              return *it;
>      }

I would’ve switched to a new style for loop if I had to touch this code for another reason.

    for (auto* rootObject : rootObjectSet()) {
        if (rootObject->globalObject() == globalObject)
            return rootObject;
    }
Comment 3 Sergio Villar Senin 2014-03-21 10:32:44 PDT
Committed r166071: <http://trac.webkit.org/changeset/166071>