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

Side by Side Diff: Source/bindings/v8/V8DOMConfiguration.h

Issue 116983005: Use v8AtomicString instead of v8::String::NewFromUtf8 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 v8::AccessControl settings; 68 v8::AccessControl settings;
69 v8::PropertyAttribute attribute; 69 v8::PropertyAttribute attribute;
70 }; 70 };
71 71
72 static void installAttributes(v8::Handle<v8::ObjectTemplate>, v8::Handle<v8: :ObjectTemplate>, const AttributeConfiguration*, size_t attributeCount, v8::Isol ate*, WrapperWorldType currentWorldType); 72 static void installAttributes(v8::Handle<v8::ObjectTemplate>, v8::Handle<v8: :ObjectTemplate>, const AttributeConfiguration*, size_t attributeCount, v8::Isol ate*, WrapperWorldType currentWorldType);
73 73
74 template<class ObjectOrTemplate> 74 template<class ObjectOrTemplate>
75 static inline void installAttribute(v8::Handle<ObjectOrTemplate> instanceTem plate, v8::Handle<ObjectOrTemplate> prototype, const AttributeConfiguration& att ribute, v8::Isolate* isolate) 75 static inline void installAttribute(v8::Handle<ObjectOrTemplate> instanceTem plate, v8::Handle<ObjectOrTemplate> prototype, const AttributeConfiguration& att ribute, v8::Isolate* isolate)
76 { 76 {
77 (attribute.onPrototype ? prototype : instanceTemplate)->SetAccessor(v8:: String::NewFromUtf8(isolate, attribute.name, v8::String::kInternalizedString), 77 (attribute.onPrototype ? prototype : instanceTemplate)->SetAccessor(v8:: String::NewFromUtf8(isolate, attribute.name, v8::String::kInternalizedString),
78 attribute.ge tter, 78 attribute.getter,
79 attribute.se tter, 79 attribute.setter,
80 v8::External ::New(isolate, const_cast<WrapperTypeInfo*>(attribute.data)), 80 v8::External::New(isolate, const_cast<WrapperTypeInfo*>(attribute.da ta)),
81 attribute.se ttings, 81 attribute.settings,
82 attribute.at tribute); 82 attribute.attribute);
83 } 83 }
84 84
85 template<class ObjectOrTemplate> 85 template<class ObjectOrTemplate>
86 static inline void installAttribute(v8::Handle<ObjectOrTemplate> instanceTem plate, v8::Handle<ObjectOrTemplate> prototype, const AttributeConfiguration& att ribute, v8::Isolate* isolate, WrapperWorldType currentWorldType) 86 static inline void installAttribute(v8::Handle<ObjectOrTemplate> instanceTem plate, v8::Handle<ObjectOrTemplate> prototype, const AttributeConfiguration& att ribute, v8::Isolate* isolate, WrapperWorldType currentWorldType)
87 { 87 {
88 v8::AccessorGetterCallback getter = attribute.getter; 88 v8::AccessorGetterCallback getter = attribute.getter;
89 v8::AccessorSetterCallback setter = attribute.setter; 89 v8::AccessorSetterCallback setter = attribute.setter;
90 if (currentWorldType == MainWorld) { 90 if (currentWorldType == MainWorld) {
91 if (attribute.getterForMainWorld) 91 if (attribute.getterForMainWorld)
92 getter = attribute.getterForMainWorld; 92 getter = attribute.getterForMainWorld;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 static v8::Local<v8::Signature> installDOMClassTemplate(v8::Handle<v8::Funct ionTemplate>, const char* interfaceName, v8::Handle<v8::FunctionTemplate> parent Class, size_t fieldCount, 127 static v8::Local<v8::Signature> installDOMClassTemplate(v8::Handle<v8::Funct ionTemplate>, const char* interfaceName, v8::Handle<v8::FunctionTemplate> parent Class, size_t fieldCount,
128 const AttributeConfiguration*, size_t attributeCount, 128 const AttributeConfiguration*, size_t attributeCount,
129 const AccessorConfiguration*, size_t accessorCount, 129 const AccessorConfiguration*, size_t accessorCount,
130 const MethodConfiguration*, size_t callbackCount, 130 const MethodConfiguration*, size_t callbackCount,
131 v8::Isolate*, WrapperWorldType); 131 v8::Isolate*, WrapperWorldType);
132 }; 132 };
133 133
134 } // namespace WebCore 134 } // namespace WebCore
135 135
136 #endif // V8DOMConfiguration_h 136 #endif // V8DOMConfiguration_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698