Changeset 126066 in webkit
- Timestamp:
- Aug 20, 2012 2:11:07 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r126065 r126066 1 2012-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 1 44 2012-08-20 Chris Rogers <crogers@google.com> 2 45 -
trunk/Source/WebCore/UseV8.cmake
r125995 r126066 26 26 bindings/v8/IDBBindingUtilities.cpp 27 27 bindings/v8/IDBCustomBindings.cpp 28 bindings/v8/IsolatedWorld.cpp 28 29 bindings/v8/Dictionary.cpp 29 30 bindings/v8/PageScriptDebugServer.cpp -
trunk/Source/WebCore/WebCore.gypi
r126052 r126066 2183 2183 'bindings/v8/IDBCustomBindings.cpp', 2184 2184 'bindings/v8/IntrusiveDOMWrapperMap.h', 2185 'bindings/v8/IsolatedWorld.cpp', 2186 'bindings/v8/IsolatedWorld.h', 2185 2187 'bindings/v8/JavaScriptCallFrame.cpp', 2186 2188 'bindings/v8/JavaScriptCallFrame.h', -
trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.cpp
r125884 r126066 37 37 namespace WebCore { 38 38 39 int DOMWrapperWorld::isolatedWorldCount = 0; 39 DOMWrapperWorld::DOMWrapperWorld() 40 { 41 // This class is pretty boring, huh? 42 } 40 43 41 44 DOMWrapperWorld* mainThreadNormalWorld() 42 45 { 43 46 ASSERT(isMainThread()); 44 DEFINE_STATIC_LOCAL(RefPtr<DOMWrapperWorld>, cachedNormalWorld, (DOMWrapperWorld::create( DOMWrapperWorld::mainWorldId)));47 DEFINE_STATIC_LOCAL(RefPtr<DOMWrapperWorld>, cachedNormalWorld, (DOMWrapperWorld::create())); 45 48 return cachedNormalWorld.get(); 46 49 } -
trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.h
r125884 r126066 32 32 #define DOMWrapperWorld_h 33 33 34 #include "DOMDataStore.h"35 34 #include <wtf/PassRefPtr.h> 36 35 #include <wtf/RefCounted.h> … … 40 39 41 40 // 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. 42 43 class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> { 43 44 public: 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() {} 52 47 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; 48 protected: 49 DOMWrapperWorld(); 71 50 }; 72 51 -
trunk/Source/WebCore/bindings/v8/IsolatedWorld.cpp
r126065 r126066 30 30 31 31 #include "config.h" 32 #include "DOMWrapperWorld.h" 33 34 #include <wtf/MainThread.h> 35 #include <wtf/StdLibExtras.h> 32 #include "IsolatedWorld.h" 36 33 37 34 namespace WebCore { 38 35 39 int DOMWrapperWorld::isolatedWorldCount = 0;36 int IsolatedWorld::isolatedWorldCount = 0; 40 37 41 DOMWrapperWorld* mainThreadNormalWorld()38 IsolatedWorld::IsolatedWorld(int id) 42 39 { 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 44 IsolatedWorld::~IsolatedWorld() 45 { 46 --isolatedWorldCount; 46 47 } 47 48 -
trunk/Source/WebCore/bindings/v8/IsolatedWorld.h
r126065 r126066 29 29 */ 30 30 31 #ifndef DOMWrapperWorld_h32 #define DOMWrapperWorld_h31 #ifndef IsolatedWorld_h 32 #define IsolatedWorld_h 33 33 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" 38 36 39 37 namespace WebCore { 40 38 41 // This class represent a collection of DOM wrappers for a specificworld.42 class DOMWrapperWorld : public RefCounted<DOMWrapperWorld>{39 // An DOMWrapperWorld other than the thread's normal world. 40 class IsolatedWorld : public DOMWrapperWorld { 43 41 public: 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)); } 51 43 static int count() { return isolatedWorldCount; } 52 44 53 int worldId() const { return m_worldId; }45 int id() const { return m_id; } 54 46 DOMDataStore* domDataStore() const { return m_domDataStore.getStore(); } 55 47 48 protected: 49 explicit IsolatedWorld(int id); 50 ~IsolatedWorld(); 51 56 52 private: 57 DOMWrapperWorld(int worldId) 58 : m_worldId(worldId) 59 { 60 if (m_worldId != mainWorldId) 61 isolatedWorldCount++; 62 } 53 int m_id; 63 54 64 // The backing store for the isolated world's DOM wrappers. This class65 // doesn't have visibility into the wrappers. This handle simply helps55 // The backing store for the isolated world's DOM wrappers. This class 56 // doesn't have visibility into the wrappers. This handle simply helps 66 57 // manage their lifetime. 67 58 DOMDataStoreHandle m_domDataStore; 68 59 69 const int m_worldId;70 60 static int isolatedWorldCount; 71 61 }; 72 62 73 DOMWrapperWorld* mainThreadNormalWorld();74 75 63 } // namespace WebCore 76 64 77 #endif // DOMWrapperWorld_h65 #endif // IsolatedWorld_h -
trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h
r125884 r126066 34 34 #include "DOMDataStore.h" 35 35 #include "Event.h" 36 #include "IsolatedWorld.h" 36 37 #include "Node.h" 37 38 #include "NodeFilter.h" … … 130 131 { 131 132 ASSERT(isMainThread()); 132 if (LIKELY(! DOMWrapperWorld::count())) {133 if (LIKELY(!IsolatedWorld::count())) { 133 134 v8::Persistent<v8::Object>* wrapper = node->wrapper(); 134 135 if (LIKELY(!!wrapper)) -
trunk/Source/WebCore/bindings/v8/V8IsolatedContext.cpp
r126005 r126066 67 67 68 68 V8IsolatedContext::V8IsolatedContext(V8Proxy* proxy, int extensionGroup, int worldId) 69 : m_world( DOMWrapperWorld::create(worldId)),69 : m_world(IsolatedWorld::create(worldId)), 70 70 m_frame(proxy->frame()) 71 71 { … … 76 76 77 77 // 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())); 79 79 if (m_context->get().IsEmpty()) 80 80 return; … … 101 101 m_context->get()->UseDefaultSecurityToken(); 102 102 103 m_frame->loader()->client()->didCreateScriptContext(context(), extensionGroup, m_world-> worldId());103 m_frame->loader()->client()->didCreateScriptContext(context(), extensionGroup, m_world->id()); 104 104 } 105 105 … … 107 107 { 108 108 m_perContextData.clear(); 109 m_frame->loader()->client()->willReleaseScriptContext(context(), m_world-> worldId());109 m_frame->loader()->client()->willReleaseScriptContext(context(), m_world->id()); 110 110 m_context->get().MakeWeak(this, &contextWeakReferenceCallback); 111 111 m_frame = 0; -
trunk/Source/WebCore/bindings/v8/V8IsolatedContext.h
r125884 r126066 32 32 #define V8IsolatedContext_h 33 33 34 #include " DOMWrapperWorld.h"34 #include "IsolatedWorld.h" 35 35 #include "ScriptSourceCode.h" // for WebCore::ScriptSourceCode 36 36 #include "SharedPersistent.h" … … 83 83 // Until then, we optimize the common case of not having any isolated 84 84 // worlds at all. 85 if (! DOMWrapperWorld::count())85 if (!IsolatedWorld::count()) 86 86 return 0; 87 87 if (!v8::Context::InContext()) … … 93 93 PassRefPtr<SharedPersistent<v8::Context> > sharedContext() { return m_context; } 94 94 95 DOMWrapperWorld* world() const { return m_world.get(); }95 IsolatedWorld* world() const { return m_world.get(); } 96 96 97 97 SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); } … … 116 116 RefPtr<SharedPersistent<v8::Context> > m_context; 117 117 118 RefPtr< DOMWrapperWorld> m_world;118 RefPtr<IsolatedWorld> m_world; 119 119 120 120 RefPtr<SecurityOrigin> m_securityOrigin; -
trunk/Source/WebCore/bindings/v8/V8PerIsolateData.h
r125884 r126066 91 91 void registerDOMDataStore(DOMDataStore* domDataStore) 92 92 { 93 ASSERT(m_domDataList.find(domDataStore) == notFound);94 93 m_domDataList.append(domDataStore); 95 94 } … … 97 96 void unregisterDOMDataStore(DOMDataStore* domDataStore) 98 97 { 99 ASSERT(m_domDataList.find(domDataStore) != notFound);98 ASSERT(m_domDataList.find(domDataStore)); 100 99 m_domDataList.remove(m_domDataList.find(domDataStore)); 101 100 }
Note: See TracChangeset
for help on using the changeset viewer.