OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 void V8DataView::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& ar
gs) | 35 void V8DataView::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& ar
gs) |
36 { | 36 { |
37 if (!args.Length()) { | 37 if (!args.Length()) { |
38 // see constructWebGLArray -- we don't seem to be able to distingish bet
ween | 38 // see constructWebGLArray -- we don't seem to be able to distingish bet
ween |
39 // 'new DataView()' and the call used to construct the cached DataView o
bject. | 39 // 'new DataView()' and the call used to construct the cached DataView o
bject. |
40 RefPtr<DataView> dataView = DataView::create(0); | 40 RefPtr<DataView> dataView = DataView::create(0); |
41 v8::Handle<v8::Object> wrapper = args.Holder(); | 41 v8::Handle<v8::Object> wrapper = args.Holder(); |
42 V8DOMWrapper::associateObjectWithWrapper(dataView.release(), &info, wrap
per, args.GetIsolate(), WrapperConfiguration::Dependent); | 42 V8DOMWrapper::associateObjectWithWrapper<V8DataView>(dataView.release(),
&info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); |
43 args.GetReturnValue().Set(wrapper); | 43 args.GetReturnValue().Set(wrapper); |
44 return; | 44 return; |
45 } | 45 } |
46 if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate()))) { | 46 if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate()))) { |
47 throwTypeError(0, args.GetIsolate()); | 47 throwTypeError(0, args.GetIsolate()); |
48 return; | 48 return; |
49 } | 49 } |
50 constructWebGLArrayWithArrayBufferArgument<DataView, char>(args, &info, v8::
kExternalByteArray, false); | 50 constructWebGLArrayWithArrayBufferArgument<DataView, char, V8DataView>(args,
&info, v8::kExternalByteArray, false); |
51 } | 51 } |
52 | 52 |
53 // FIXME: Don't need this override. | 53 // FIXME: Don't need this override. |
54 v8::Handle<v8::Object> wrap(DataView* impl, v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) | 54 v8::Handle<v8::Object> wrap(DataView* impl, v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) |
55 { | 55 { |
56 ASSERT(impl); | 56 ASSERT(impl); |
57 return V8DataView::createWrapper(impl, creationContext, isolate); | 57 return V8DataView::createWrapper(impl, creationContext, isolate); |
58 } | 58 } |
59 | 59 |
60 } // namespace WebCore | 60 } // namespace WebCore |
OLD | NEW |