OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "bindings/core/v8/WebGLAny.h" | 6 #include "bindings/core/v8/WebGLAny.h" |
7 | 7 |
8 #include "bindings/core/v8/ToV8.h" | 8 #include "bindings/core/v8/ToV8.h" |
9 #include "wtf/text/WTFString.h" | 9 #include "wtf/text/WTFString.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 ScriptValue WebGLAny(ScriptState* scriptState) | |
14 { | |
15 return ScriptValue(scriptState, v8::Null(scriptState->isolate())); | |
16 } | |
17 | |
18 ScriptValue WebGLAny(ScriptState* scriptState, bool value) | 13 ScriptValue WebGLAny(ScriptState* scriptState, bool value) |
19 { | 14 { |
20 return ScriptValue(scriptState, v8Boolean(value, scriptState->isolate())); | 15 return ScriptValue(scriptState, v8Boolean(value, scriptState->isolate())); |
21 } | 16 } |
22 | 17 |
23 ScriptValue WebGLAny(ScriptState* scriptState, const bool* value, size_t size) | 18 ScriptValue WebGLAny(ScriptState* scriptState, const bool* value, size_t size) |
24 { | 19 { |
25 v8::Local<v8::Array> array = v8::Array::New(scriptState->isolate(), size); | 20 v8::Local<v8::Array> array = v8::Array::New(scriptState->isolate(), size); |
26 for (size_t ii = 0; ii < size; ++ii) | 21 for (size_t ii = 0; ii < size; ++ii) |
27 array->Set(v8::Integer::New(scriptState->isolate(), ii), v8Boolean(value
[ii], scriptState->isolate())); | 22 array->Set(v8::Integer::New(scriptState->isolate(), ii), v8Boolean(value
[ii], scriptState->isolate())); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 { | 62 { |
68 return ScriptValue(scriptState, toV8(value, scriptState->context()->Global()
, scriptState->isolate())); | 63 return ScriptValue(scriptState, toV8(value, scriptState->context()->Global()
, scriptState->isolate())); |
69 } | 64 } |
70 | 65 |
71 ScriptValue WebGLAny(ScriptState* scriptState, PassRefPtr<DOMUint32Array> value) | 66 ScriptValue WebGLAny(ScriptState* scriptState, PassRefPtr<DOMUint32Array> value) |
72 { | 67 { |
73 return ScriptValue(scriptState, toV8(value, scriptState->context()->Global()
, scriptState->isolate())); | 68 return ScriptValue(scriptState, toV8(value, scriptState->context()->Global()
, scriptState->isolate())); |
74 } | 69 } |
75 | 70 |
76 } // namespace blink | 71 } // namespace blink |
OLD | NEW |