Changeset 126066 in webkit


Ignore:
Timestamp:
Aug 20, 2012 2:11:07 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r125884.
http://trac.webkit.org/changeset/125884
https://bugs.webkit.org/show_bug.cgi?id=94523

Appears to be causing a top crash in the Canary channel
(Requested by abarth on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-08-20

  • UseV8.cmake:
  • WebCore.gypi:
  • bindings/v8/DOMWrapperWorld.cpp:

(WebCore::DOMWrapperWorld::DOMWrapperWorld):
(WebCore::mainThreadNormalWorld):

  • bindings/v8/DOMWrapperWorld.h:

(WebCore):
(WebCore::DOMWrapperWorld::create):
(WebCore::DOMWrapperWorld::~DOMWrapperWorld):
(DOMWrapperWorld):

  • bindings/v8/IsolatedWorld.cpp: Copied from Source/WebCore/bindings/v8/DOMWrapperWorld.cpp.

(WebCore):
(WebCore::IsolatedWorld::IsolatedWorld):
(WebCore::IsolatedWorld::~IsolatedWorld):

  • bindings/v8/IsolatedWorld.h: Copied from Source/WebCore/bindings/v8/DOMWrapperWorld.h.

(WebCore):
(IsolatedWorld):
(WebCore::IsolatedWorld::create):
(WebCore::IsolatedWorld::count):
(WebCore::IsolatedWorld::id):
(WebCore::IsolatedWorld::domDataStore):

  • bindings/v8/V8DOMWrapper.h:

(WebCore::V8DOMWrapper::getCachedWrapper):

  • bindings/v8/V8IsolatedContext.cpp:

(WebCore::V8IsolatedContext::V8IsolatedContext):
(WebCore::V8IsolatedContext::destroy):

  • bindings/v8/V8IsolatedContext.h:

(WebCore::V8IsolatedContext::getEntered):
(WebCore::V8IsolatedContext::world):
(V8IsolatedContext):

  • bindings/v8/V8PerIsolateData.h:

(WebCore::V8PerIsolateData::registerDOMDataStore):
(WebCore::V8PerIsolateData::unregisterDOMDataStore):

Location:
trunk/Source/WebCore
Files:
9 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r126065 r126066  
     12012-08-20  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r125884.
     4        http://trac.webkit.org/changeset/125884
     5        https://bugs.webkit.org/show_bug.cgi?id=94523
     6
     7        Appears to be causing a top crash in the Canary channel
     8        (Requested by abarth on #webkit).
     9
     10        * UseV8.cmake:
     11        * WebCore.gypi:
     12        * bindings/v8/DOMWrapperWorld.cpp:
     13        (WebCore::DOMWrapperWorld::DOMWrapperWorld):
     14        (WebCore::mainThreadNormalWorld):
     15        * bindings/v8/DOMWrapperWorld.h:
     16        (WebCore):
     17        (WebCore::DOMWrapperWorld::create):
     18        (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
     19        (DOMWrapperWorld):
     20        * bindings/v8/IsolatedWorld.cpp: Copied from Source/WebCore/bindings/v8/DOMWrapperWorld.cpp.
     21        (WebCore):
     22        (WebCore::IsolatedWorld::IsolatedWorld):
     23        (WebCore::IsolatedWorld::~IsolatedWorld):
     24        * bindings/v8/IsolatedWorld.h: Copied from Source/WebCore/bindings/v8/DOMWrapperWorld.h.
     25        (WebCore):
     26        (IsolatedWorld):
     27        (WebCore::IsolatedWorld::create):
     28        (WebCore::IsolatedWorld::count):
     29        (WebCore::IsolatedWorld::id):
     30        (WebCore::IsolatedWorld::domDataStore):
     31        * bindings/v8/V8DOMWrapper.h:
     32        (WebCore::V8DOMWrapper::getCachedWrapper):
     33        * bindings/v8/V8IsolatedContext.cpp:
     34        (WebCore::V8IsolatedContext::V8IsolatedContext):
     35        (WebCore::V8IsolatedContext::destroy):
     36        * bindings/v8/V8IsolatedContext.h:
     37        (WebCore::V8IsolatedContext::getEntered):
     38        (WebCore::V8IsolatedContext::world):
     39        (V8IsolatedContext):
     40        * bindings/v8/V8PerIsolateData.h:
     41        (WebCore::V8PerIsolateData::registerDOMDataStore):
     42        (WebCore::V8PerIsolateData::unregisterDOMDataStore):
     43
    1442012-08-20  Chris Rogers  <crogers@google.com>
    245
  • trunk/Source/WebCore/UseV8.cmake

    r125995 r126066  
    2626    bindings/v8/IDBBindingUtilities.cpp
    2727    bindings/v8/IDBCustomBindings.cpp
     28    bindings/v8/IsolatedWorld.cpp
    2829    bindings/v8/Dictionary.cpp
    2930    bindings/v8/PageScriptDebugServer.cpp
  • trunk/Source/WebCore/WebCore.gypi

    r126052 r126066  
    21832183            'bindings/v8/IDBCustomBindings.cpp',
    21842184            'bindings/v8/IntrusiveDOMWrapperMap.h',
     2185            'bindings/v8/IsolatedWorld.cpp',
     2186            'bindings/v8/IsolatedWorld.h',
    21852187            'bindings/v8/JavaScriptCallFrame.cpp',
    21862188            'bindings/v8/JavaScriptCallFrame.h',
  • trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.cpp

    r125884 r126066  
    3737namespace WebCore {
    3838
    39 int DOMWrapperWorld::isolatedWorldCount = 0;
     39DOMWrapperWorld::DOMWrapperWorld()
     40{
     41    // This class is pretty boring, huh?
     42}
    4043
    4144DOMWrapperWorld* mainThreadNormalWorld()
    4245{
    4346    ASSERT(isMainThread());
    44     DEFINE_STATIC_LOCAL(RefPtr<DOMWrapperWorld>, cachedNormalWorld, (DOMWrapperWorld::create(DOMWrapperWorld::mainWorldId)));
     47    DEFINE_STATIC_LOCAL(RefPtr<DOMWrapperWorld>, cachedNormalWorld, (DOMWrapperWorld::create()));
    4548    return cachedNormalWorld.get();
    4649}
  • trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.h

    r125884 r126066  
    3232#define DOMWrapperWorld_h
    3333
    34 #include "DOMDataStore.h"
    3534#include <wtf/PassRefPtr.h>
    3635#include <wtf/RefCounted.h>
     
    4039
    4140// This class represent a collection of DOM wrappers for a specific world.
     41// The base class is pretty boring because the wrappers are actually stored
     42// statically in V8DOMMap and garbage collected by V8 itself.
    4243class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
    4344public:
    44     static const int mainWorldId = -1;
    45     static PassRefPtr<DOMWrapperWorld> create(int worldId = mainWorldId) { return adoptRef(new DOMWrapperWorld(worldId)); }
    46     ~DOMWrapperWorld()
    47     {
    48         if (m_worldId != mainWorldId)
    49             isolatedWorldCount--;
    50     }
    51     static int count() { return isolatedWorldCount; }
     45    static PassRefPtr<DOMWrapperWorld> create() { return adoptRef(new DOMWrapperWorld()); }
     46    virtual ~DOMWrapperWorld() {}
    5247
    53     int worldId() const { return m_worldId; }
    54     DOMDataStore* domDataStore() const { return m_domDataStore.getStore(); }
    55 
    56 private:
    57     DOMWrapperWorld(int worldId)
    58         : m_worldId(worldId)
    59     {
    60         if (m_worldId != mainWorldId)
    61             isolatedWorldCount++;
    62     }
    63 
    64     // The backing store for the isolated world's DOM wrappers. This class
    65     // doesn't have visibility into the wrappers. This handle simply helps
    66     // manage their lifetime.
    67     DOMDataStoreHandle m_domDataStore;
    68 
    69     const int m_worldId;
    70     static int isolatedWorldCount;
     48protected:
     49    DOMWrapperWorld();
    7150};
    7251
  • trunk/Source/WebCore/bindings/v8/IsolatedWorld.cpp

    r126065 r126066  
    3030
    3131#include "config.h"
    32 #include "DOMWrapperWorld.h"
    33 
    34 #include <wtf/MainThread.h>
    35 #include <wtf/StdLibExtras.h>
     32#include "IsolatedWorld.h"
    3633
    3734namespace WebCore {
    3835
    39 int DOMWrapperWorld::isolatedWorldCount = 0;
     36int IsolatedWorld::isolatedWorldCount = 0;
    4037
    41 DOMWrapperWorld* mainThreadNormalWorld()
     38IsolatedWorld::IsolatedWorld(int id)
    4239{
    43     ASSERT(isMainThread());
    44     DEFINE_STATIC_LOCAL(RefPtr<DOMWrapperWorld>, cachedNormalWorld, (DOMWrapperWorld::create(DOMWrapperWorld::mainWorldId)));
    45     return cachedNormalWorld.get();
     40    ++isolatedWorldCount;
     41    m_id = id;
     42}
     43
     44IsolatedWorld::~IsolatedWorld()
     45{
     46    --isolatedWorldCount;
    4647}
    4748
  • trunk/Source/WebCore/bindings/v8/IsolatedWorld.h

    r126065 r126066  
    2929 */
    3030
    31 #ifndef DOMWrapperWorld_h
    32 #define DOMWrapperWorld_h
     31#ifndef IsolatedWorld_h
     32#define IsolatedWorld_h
    3333
    34 #include "DOMDataStore.h"
    35 #include <wtf/PassRefPtr.h>
    36 #include <wtf/RefCounted.h>
    37 #include <wtf/RefPtr.h>
     34#include "DOMWrapperWorld.h"
     35#include "V8DOMMap.h"
    3836
    3937namespace WebCore {
    4038
    41 // This class represent a collection of DOM wrappers for a specific world.
    42 class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
     39// An DOMWrapperWorld other than the thread's normal world.
     40class IsolatedWorld : public DOMWrapperWorld {
    4341public:
    44     static const int mainWorldId = -1;
    45     static PassRefPtr<DOMWrapperWorld> create(int worldId = mainWorldId) { return adoptRef(new DOMWrapperWorld(worldId)); }
    46     ~DOMWrapperWorld()
    47     {
    48         if (m_worldId != mainWorldId)
    49             isolatedWorldCount--;
    50     }
     42    static PassRefPtr<IsolatedWorld> create(int id) { return adoptRef(new IsolatedWorld(id)); }
    5143    static int count() { return isolatedWorldCount; }
    5244
    53     int worldId() const { return m_worldId; }
     45    int id() const { return m_id; }
    5446    DOMDataStore* domDataStore() const { return m_domDataStore.getStore(); }
    5547
     48protected:
     49    explicit IsolatedWorld(int id);
     50    ~IsolatedWorld();
     51
    5652private:
    57     DOMWrapperWorld(int worldId)
    58         : m_worldId(worldId)
    59     {
    60         if (m_worldId != mainWorldId)
    61             isolatedWorldCount++;
    62     }
     53    int m_id;
    6354
    64     // The backing store for the isolated world's DOM wrappers. This class
    65     // doesn't have visibility into the wrappers. This handle simply helps
     55    // The backing store for the isolated world's DOM wrappers.  This class
     56    // doesn't have visibility into the wrappers.  This handle simply helps
    6657    // manage their lifetime.
    6758    DOMDataStoreHandle m_domDataStore;
    6859
    69     const int m_worldId;
    7060    static int isolatedWorldCount;
    7161};
    7262
    73 DOMWrapperWorld* mainThreadNormalWorld();
    74 
    7563} // namespace WebCore
    7664
    77 #endif // DOMWrapperWorld_h
     65#endif // IsolatedWorld_h
  • trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h

    r125884 r126066  
    3434#include "DOMDataStore.h"
    3535#include "Event.h"
     36#include "IsolatedWorld.h"
    3637#include "Node.h"
    3738#include "NodeFilter.h"
     
    130131        {
    131132            ASSERT(isMainThread());
    132             if (LIKELY(!DOMWrapperWorld::count())) {
     133            if (LIKELY(!IsolatedWorld::count())) {
    133134                v8::Persistent<v8::Object>* wrapper = node->wrapper();
    134135                if (LIKELY(!!wrapper))
  • trunk/Source/WebCore/bindings/v8/V8IsolatedContext.cpp

    r126005 r126066  
    6767
    6868V8IsolatedContext::V8IsolatedContext(V8Proxy* proxy, int extensionGroup, int worldId)
    69     : m_world(DOMWrapperWorld::create(worldId)),
     69    : m_world(IsolatedWorld::create(worldId)),
    7070      m_frame(proxy->frame())
    7171{
     
    7676
    7777    // FIXME: We should be creating a new V8DOMWindowShell here instead of riping out the context.
    78     m_context = SharedPersistent<v8::Context>::create(proxy->windowShell()->createNewContext(v8::Handle<v8::Object>(), extensionGroup, m_world->worldId()));
     78    m_context = SharedPersistent<v8::Context>::create(proxy->windowShell()->createNewContext(v8::Handle<v8::Object>(), extensionGroup, m_world->id()));
    7979    if (m_context->get().IsEmpty())
    8080        return;
     
    101101    m_context->get()->UseDefaultSecurityToken();
    102102
    103     m_frame->loader()->client()->didCreateScriptContext(context(), extensionGroup, m_world->worldId());
     103    m_frame->loader()->client()->didCreateScriptContext(context(), extensionGroup, m_world->id());
    104104}
    105105
     
    107107{
    108108    m_perContextData.clear();
    109     m_frame->loader()->client()->willReleaseScriptContext(context(), m_world->worldId());
     109    m_frame->loader()->client()->willReleaseScriptContext(context(), m_world->id());
    110110    m_context->get().MakeWeak(this, &contextWeakReferenceCallback);
    111111    m_frame = 0;
  • trunk/Source/WebCore/bindings/v8/V8IsolatedContext.h

    r125884 r126066  
    3232#define V8IsolatedContext_h
    3333
    34 #include "DOMWrapperWorld.h"
     34#include "IsolatedWorld.h"
    3535#include "ScriptSourceCode.h" // for WebCore::ScriptSourceCode
    3636#include "SharedPersistent.h"
     
    8383        // Until then, we optimize the common case of not having any isolated
    8484        // worlds at all.
    85         if (!DOMWrapperWorld::count())
     85        if (!IsolatedWorld::count())
    8686            return 0;
    8787        if (!v8::Context::InContext())
     
    9393    PassRefPtr<SharedPersistent<v8::Context> > sharedContext() { return m_context; }
    9494
    95     DOMWrapperWorld* world() const { return m_world.get(); }
     95    IsolatedWorld* world() const { return m_world.get(); }
    9696
    9797    SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }
     
    116116    RefPtr<SharedPersistent<v8::Context> > m_context;
    117117
    118     RefPtr<DOMWrapperWorld> m_world;
     118    RefPtr<IsolatedWorld> m_world;
    119119
    120120    RefPtr<SecurityOrigin> m_securityOrigin;
  • trunk/Source/WebCore/bindings/v8/V8PerIsolateData.h

    r125884 r126066  
    9191    void registerDOMDataStore(DOMDataStore* domDataStore)
    9292    {
    93         ASSERT(m_domDataList.find(domDataStore) == notFound);
    9493        m_domDataList.append(domDataStore);
    9594    }
     
    9796    void unregisterDOMDataStore(DOMDataStore* domDataStore)
    9897    {
    99         ASSERT(m_domDataList.find(domDataStore) != notFound);
     98        ASSERT(m_domDataList.find(domDataStore));
    10099        m_domDataList.remove(m_domDataList.find(domDataStore));
    101100    }
Note: See TracChangeset for help on using the changeset viewer.