OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 case V8DOMConfiguration::ConstantTypeUnsignedShort: | 148 case V8DOMConfiguration::ConstantTypeUnsignedShort: |
149 value = v8::Integer::New(isolate, constant.ivalue); | 149 value = v8::Integer::New(isolate, constant.ivalue); |
150 break; | 150 break; |
151 case V8DOMConfiguration::ConstantTypeUnsignedLong: | 151 case V8DOMConfiguration::ConstantTypeUnsignedLong: |
152 value = v8::Integer::NewFromUnsigned(isolate, constant.ivalue); | 152 value = v8::Integer::NewFromUnsigned(isolate, constant.ivalue); |
153 break; | 153 break; |
154 case V8DOMConfiguration::ConstantTypeFloat: | 154 case V8DOMConfiguration::ConstantTypeFloat: |
155 case V8DOMConfiguration::ConstantTypeDouble: | 155 case V8DOMConfiguration::ConstantTypeDouble: |
156 value = v8::Number::New(isolate, constant.dvalue); | 156 value = v8::Number::New(isolate, constant.dvalue); |
157 break; | 157 break; |
158 case V8DOMConfiguration::ConstantTypeString: | |
159 value = v8AtomicString(isolate, constant.svalue); | |
160 break; | |
161 default: | 158 default: |
162 ASSERT_NOT_REACHED(); | 159 ASSERT_NOT_REACHED(); |
163 } | 160 } |
164 functionDescriptor->Set(constantName, value, attributes); | 161 functionDescriptor->Set(constantName, value, attributes); |
165 prototypeTemplate->Set(constantName, value, attributes); | 162 prototypeTemplate->Set(constantName, value, attributes); |
166 } | 163 } |
167 | 164 |
168 void doInstallMethodInternal(v8::Local<v8::ObjectTemplate> target, v8::Local<v8:
:Name> name, v8::Local<v8::FunctionTemplate> functionTemplate, v8::PropertyAttri
bute attribute) | 165 void doInstallMethodInternal(v8::Local<v8::ObjectTemplate> target, v8::Local<v8:
:Name> name, v8::Local<v8::FunctionTemplate> functionTemplate, v8::PropertyAttri
bute attribute) |
169 { | 166 { |
170 target->Set(name, functionTemplate, attribute); | 167 target->Set(name, functionTemplate, attribute); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 return result; | 298 return result; |
302 | 299 |
303 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); | 300 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); |
304 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); | 301 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); |
305 configureDOMClassTemplate(result, isolate); | 302 configureDOMClassTemplate(result, isolate); |
306 data->setDOMTemplate(wrapperTypeInfo, result); | 303 data->setDOMTemplate(wrapperTypeInfo, result); |
307 return result; | 304 return result; |
308 } | 305 } |
309 | 306 |
310 } // namespace blink | 307 } // namespace blink |
OLD | NEW |