| Index: Source/bindings/v8/custom/V8DataViewCustom.cpp
|
| diff --git a/Source/bindings/v8/custom/V8DataViewCustom.cpp b/Source/bindings/v8/custom/V8DataViewCustom.cpp
|
| index 4988fdb94f02fd231fa650fcd4ae14bad851671d..e07dfa5d8ad6d5fbf7ee50f27dc478b1cf6d8889 100644
|
| --- a/Source/bindings/v8/custom/V8DataViewCustom.cpp
|
| +++ b/Source/bindings/v8/custom/V8DataViewCustom.cpp
|
| @@ -24,37 +24,29 @@
|
| */
|
|
|
| #include "config.h"
|
| -#include "core/html/canvas/DataView.h"
|
| +#include "bindings/v8/custom/V8DataViewCustom.h"
|
|
|
| -#include "V8DataView.h"
|
| #include "bindings/v8/V8Binding.h"
|
| #include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
|
| +#include "core/html/canvas/DataView.h"
|
|
|
| namespace WebCore {
|
|
|
| -void V8DataView::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
|
| +static void initializeScriptWrappableForInterface(DataView* object)
|
| {
|
| - if (!args.Length()) {
|
| - // see constructWebGLArray -- we don't seem to be able to distingish between
|
| - // 'new DataView()' and the call used to construct the cached DataView object.
|
| - RefPtr<DataView> dataView = DataView::create(0);
|
| - v8::Handle<v8::Object> wrapper = args.Holder();
|
| - V8DOMWrapper::associateObjectWithWrapper<V8DataView>(dataView.release(), &info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
|
| - args.GetReturnValue().Set(wrapper);
|
| - return;
|
| - }
|
| - if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) {
|
| - throwTypeError(0, args.GetIsolate());
|
| - return;
|
| - }
|
| - constructWebGLArrayWithArrayBufferArgument<DataView, char, V8DataView>(args, &info, v8::kExternalByteArray, false);
|
| + if (ScriptWrappable::wrapperCanBeStoredInObject(object))
|
| + ScriptWrappable::setTypeInfoInObject(object, &V8DataView::info);
|
| + else
|
| + ASSERT_NOT_REACHED();
|
| }
|
|
|
| -// FIXME: Don't need this override.
|
| -v8::Handle<v8::Object> wrap(DataView* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
|
| +} // namespace WebCore
|
| +
|
| +// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
|
| +// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
|
| +// in the global namespace.
|
| +// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
|
| +void webCoreInitializeScriptWrappableForInterface(WebCore::DataView* object)
|
| {
|
| - ASSERT(impl);
|
| - return V8DataView::createWrapper(impl, creationContext, isolate);
|
| + WebCore::initializeScriptWrappableForInterface(object);
|
| }
|
| -
|
| -} // namespace WebCore
|
|
|