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

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

Issue 1315663004: [bindings] Bindings should only support the prescribed types for constants. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months 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
« no previous file with comments | « Source/bindings/core/v8/V8DOMConfiguration.h ('k') | Source/bindings/templates/constants.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8DOMConfiguration.h ('k') | Source/bindings/templates/constants.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698