Commit 6d7750ca authored by darin@apple.com's avatar darin@apple.com

Try to fix Windows build.

        * bindings/js/WebCoreTypedArrayController.cpp: Windows has a symbol named Handle, so we need
        to call JSC::Handle out by name. To fix that, I removed "using namespace JSC" entirely. And
        just for fun, sort of "rewrote" this file.
        (WebCore::WebCoreTypedArrayController::WebCoreTypedArrayController): Removed unneeded explicit
        initialization of m_owner.
        (WebCore::WebCoreTypedArrayController::~WebCoreTypedArrayController): Fixed formatting.
        (WebCore::WebCoreTypedArrayController::toJS): Added lots of explicit JSC and got rid of local.
        (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): Cut
        down on locals, used auto& for type, and called it "wrapper" since that's what JSArrayBuffer is.
        (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize): More of the same.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8cdf7124
2013-09-29 Darin Adler <darin@apple.com>
Try to fix Windows build.
* bindings/js/WebCoreTypedArrayController.cpp: Windows has a symbol named Handle, so we need
to call JSC::Handle out by name. To fix that, I removed "using namespace JSC" entirely. And
just for fun, sort of "rewrote" this file.
(WebCore::WebCoreTypedArrayController::WebCoreTypedArrayController): Removed unneeded explicit
initialization of m_owner.
(WebCore::WebCoreTypedArrayController::~WebCoreTypedArrayController): Fixed formatting.
(WebCore::WebCoreTypedArrayController::toJS): Added lots of explicit JSC and got rid of local.
(WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): Cut
down on locals, used auto& for type, and called it "wrapper" since that's what JSArrayBuffer is.
(WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize): More of the same.
2013-09-29 Darin Adler <darin@apple.com>
Use RenderElement instead of RenderObject in many places
......@@ -34,39 +34,33 @@
namespace WebCore {
using namespace JSC;
WebCoreTypedArrayController::WebCoreTypedArrayController()
: m_owner()
{
}
WebCoreTypedArrayController::~WebCoreTypedArrayController() { }
JSArrayBuffer* WebCoreTypedArrayController::toJS(
ExecState* exec, JSGlobalObject* globalObject, ArrayBuffer* native)
WebCoreTypedArrayController::~WebCoreTypedArrayController()
{
return jsCast<JSArrayBuffer*>(
WebCore::toJS(exec, jsCast<JSDOMGlobalObject*>(globalObject), native));
}
bool WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots(
Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
JSC::JSArrayBuffer* WebCoreTypedArrayController::toJS(JSC::ExecState* state, JSC::JSGlobalObject* globalObject, JSC::ArrayBuffer* buffer)
{
JSArrayBuffer* jsArrayBuffer = jsCast<JSArrayBuffer*>(handle.get().asCell());
if (!jsArrayBuffer->hasCustomProperties())
return JSC::jsCast<JSC::JSArrayBuffer*>(toJS(state, JSC::jsCast<JSDOMGlobalObject*>(globalObject), buffer));
}
bool WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor)
{
auto& wrapper = *JSC::jsCast<JSC::JSArrayBuffer*>(handle.get().asCell());
if (!wrapper.hasCustomProperties())
return false;
ArrayBuffer* root = jsArrayBuffer->impl();
return visitor.containsOpaqueRoot(root);
return visitor.containsOpaqueRoot(wrapper.impl());
}
void WebCoreTypedArrayController::JSArrayBufferOwner::finalize(
Handle<JSC::Unknown> handle, void* context)
void WebCoreTypedArrayController::JSArrayBufferOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
JSArrayBuffer* jsArrayBuffer = static_cast<JSArrayBuffer*>(handle.get().asCell());
DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
uncacheWrapper(world, jsArrayBuffer->impl(), jsArrayBuffer);
jsArrayBuffer->impl()->deref();
auto& wrapper = *static_cast<JSC::JSArrayBuffer*>(handle.get().asCell());
auto& buffer = *wrapper.impl();
uncacheWrapper(static_cast<DOMWrapperWorld*>(context), &buffer, &wrapper);
buffer.deref();
}
} // namespace WebCore
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment