Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: Source/bindings/core/v8/WebGLAny.cpp

Issue 795833004: Use dictionaries for context creation attributes. Eliminate custom bindings. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/core/v8/WebGLAny.h ('k') | Source/bindings/core/v8/WrapCanvasContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/WebGLAny.h ('k') | Source/bindings/core/v8/WrapCanvasContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698