[V8] V8DOMWindowShell should use ScopedPersistent
Created attachment 160297 [details] Work in progress
Created attachment 160323 [details] Patch
Comment on attachment 160323 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=160323&action=review > Source/WebCore/bindings/v8/V8DOMWindowShell.cpp:200 > + ASSERT(m_context.get().IsEmpty() || !m_global.get().IsEmpty()); Shall we implement ScopedContext::isEmpty() to avoid m_context.get().IsEmpty() repeatedly? > Source/WebCore/bindings/v8/V8DOMWindowShell.cpp:-201 > -#ifndef NDEBUG > - V8GCController::unregisterGlobalHandle(this, m_global); > -#endif Are you intending to remove this? > Source/WebCore/bindings/v8/V8DOMWindowShell.cpp:464 > + m_context.get()->Global()->ForceSet(v8::String::New("document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete)); Shall we implement ScopedPersistent::operator-> so that we can write this like m_context->Global() ?
(In reply to comment #3) > (From update of attachment 160323 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=160323&action=review > > > Source/WebCore/bindings/v8/V8DOMWindowShell.cpp:200 > > + ASSERT(m_context.get().IsEmpty() || !m_global.get().IsEmpty()); > > Shall we implement ScopedContext::isEmpty() to avoid m_context.get().IsEmpty() repeatedly? Sure. > > Source/WebCore/bindings/v8/V8DOMWindowShell.cpp:-201 > > -#ifndef NDEBUG > > - V8GCController::unregisterGlobalHandle(this, m_global); > > -#endif > > Are you intending to remove this? Yes. I've never found the registerGlobalHandle thing useful. We can add it to ScopedPersistent if we want. > > Source/WebCore/bindings/v8/V8DOMWindowShell.cpp:464 > > + m_context.get()->Global()->ForceSet(v8::String::New("document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete)); > > Shall we implement ScopedPersistent::operator-> so that we can write this like m_context->Global() ? Sure. Do you mind if I do those things in a followup patch? I'll deploy them to all the uses of ScopedPersistent.
Comment on attachment 160323 [details] Patch > Do you mind if I do those things in a followup patch? Sounds good.
Comment on attachment 160323 [details] Patch Clearing flags on attachment: 160323 Committed r126544: <http://trac.webkit.org/changeset/126544>
All reviewed patches have been landed. Closing bug.