Changeset 145502 in webkit
- Timestamp:
- Mar 12, 2013 2:11:24 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r145501 r145502 1 2013-03-12 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r145494. 4 http://trac.webkit.org/changeset/145494 5 https://bugs.webkit.org/show_bug.cgi?id=112117 6 7 Breaks Chromium Mac (Requested by pfeldman on #webkit). 8 9 * bindings/scripts/CodeGeneratorV8.pm: 10 (GenerateDomainSafeFunctionGetter): 11 * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: 12 (WebCore::TestActiveDOMObjectV8Internal::postMessageAttrGetter): 13 * bindings/v8/V8PerIsolateData.cpp: 14 (WebCore::V8PerIsolateData::V8PerIsolateData): 15 * bindings/v8/V8PerIsolateData.h: 16 (V8PerIsolateData): 17 * bindings/v8/custom/V8LocationCustom.cpp: 18 (WebCore::V8Location::reloadAttrGetterCustom): 19 (WebCore::V8Location::replaceAttrGetterCustom): 20 (WebCore::V8Location::assignAttrGetterCustom): 21 1 22 2013-03-12 Yury Semikhatsky <yurys@chromium.org> 2 23 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r145494 r145502 787 787 } 788 788 789 my $newTemplate Params = "${interfaceName}V8Internal::${funcName}MethodCallback, v8Undefined(), $signature";789 my $newTemplateString = "v8::FunctionTemplate::New(${interfaceName}V8Internal::${funcName}MethodCallback, v8Undefined(), $signature)"; 790 790 791 791 AddToImplIncludes("Frame.h"); … … 793 793 static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 794 794 { 795 // This is only for getting a unique pointer which we can pass to privateTemplate. 796 static String privateTemplateUniqueKey = "${funcName}PrivateTemplate"; 797 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); 798 v8::Persistent<v8::FunctionTemplate> privateTemplate = V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType, &privateTemplateUniqueKey, $newTemplateParams); 799 800 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8InterfaceName}::GetTemplate(info.GetIsolate(), currentWorldType)); 795 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), $newTemplateString); 796 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8InterfaceName}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate()))); 801 797 if (holder.IsEmpty()) { 802 798 // can only reach here by 'object.__proto__.func', and it should passed … … 806 802 ${interfaceName}* imp = ${v8InterfaceName}::toNative(holder); 807 803 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 808 static String sharedTemplateUniqueKey = "${funcName}SharedTemplate"; 809 v8::Persistent<v8::FunctionTemplate> sharedTemplate = V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, $newTemplateParams); 804 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), $newTemplateString); 810 805 return sharedTemplate->GetFunction(); 811 806 } -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
r145494 r145502 129 129 static v8::Handle<v8::Value> postMessageAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 130 130 { 131 // This is only for getting a unique pointer which we can pass to privateTemplate. 132 static String privateTemplateUniqueKey = "postMessagePrivateTemplate"; 133 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); 134 v8::Persistent<v8::FunctionTemplate> privateTemplate = V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate()))); 135 136 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestActiveDOMObject::GetTemplate(info.GetIsolate(), currentWorldType)); 131 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate())))); 132 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestActiveDOMObject::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate()))); 137 133 if (holder.IsEmpty()) { 138 134 // can only reach here by 'object.__proto__.func', and it should passed … … 142 138 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder); 143 139 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 144 static String sharedTemplateUniqueKey = "postMessageSharedTemplate"; 145 v8::Persistent<v8::FunctionTemplate> sharedTemplate = V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate()))); 140 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate())))); 146 141 return sharedTemplate->GetFunction(); 147 142 } -
trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp
r145494 r145502 45 45 46 46 V8PerIsolateData::V8PerIsolateData(v8::Isolate* isolate) 47 : m_isolate(isolate) 48 , m_stringCache(adoptPtr(new StringCache())) 47 : m_stringCache(adoptPtr(new StringCache())) 49 48 , m_integerCache(adoptPtr(new IntegerCache())) 50 49 , m_domDataStore(0) … … 123 122 } 124 123 125 v8::Persistent<v8::FunctionTemplate> V8PerIsolateData::privateTemplate(WrapperWorldType, void* privatePointer, v8::InvocationCallback callback, v8::Handle<v8::Value> data, v8::Handle<v8::Signature> signature, int length)126 {127 v8::Persistent<v8::FunctionTemplate> privateTemplate;128 V8PerIsolateData::TemplateMap::iterator result = m_templates.find(privatePointer);129 if (result != m_templates.end())130 return result->value;131 v8::Persistent<v8::FunctionTemplate> newPrivateTemplate = v8::Persistent<v8::FunctionTemplate>::New(m_isolate, v8::FunctionTemplate::New(callback, data, signature, length));132 m_templates.add(privatePointer, newPrivateTemplate);133 return newPrivateTemplate;134 }135 136 124 #if ENABLE(INSPECTOR) 137 125 void V8PerIsolateData::visitExternalStrings(ExternalStringVisitor* visitor) -
trunk/Source/WebCore/bindings/v8/V8PerIsolateData.h
r145494 r145502 28 28 29 29 #include "ScopedPersistent.h" 30 #include "WrapperTypeInfo.h"31 30 #include <v8.h> 32 31 #include <wtf/Forward.h> … … 66 65 static void dispose(v8::Isolate*); 67 66 68 typedef HashMap< void*, v8::Persistent<v8::FunctionTemplate> > TemplateMap;67 typedef HashMap<WrapperTypeInfo*, v8::Persistent<v8::FunctionTemplate> > TemplateMap; 69 68 70 69 TemplateMap& rawTemplateMap() { return m_rawTemplates; } … … 129 128 bool shouldCollectGarbageSoon() const { return m_shouldCollectGarbageSoon; } 130 129 131 v8::Persistent<v8::FunctionTemplate> privateTemplate(WrapperWorldType, void* privatePointer, v8::InvocationCallback, v8::Handle<v8::Value> data, v8::Handle<v8::Signature>, int length = 0);132 133 130 private: 134 131 explicit V8PerIsolateData(v8::Isolate*); … … 136 133 static v8::Handle<v8::Value> constructorOfToString(const v8::Arguments&); 137 134 138 v8::Isolate* m_isolate;139 135 TemplateMap m_rawTemplates; 140 136 TemplateMap m_templates; -
trunk/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp
r145494 r145502 140 140 { 141 141 v8::Isolate* isolate = info.GetIsolate(); 142 // This is only for getting a unique pointer which we can pass to privateTemplate. 143 static String privateTemplateUniqueKey = "reloadPrivateTemplate"; 144 WrapperWorldType currentWorldType = worldType(isolate); 145 v8::Persistent<v8::FunctionTemplate> privateTemplate = V8PerIsolateData::from(isolate)->privateTemplate(currentWorldType, &privateTemplateUniqueKey, V8Location::reloadMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))); 146 147 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate, currentWorldType)); 142 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::reloadMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 143 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate, worldType(isolate))); 148 144 if (holder.IsEmpty()) { 149 145 // can only reach here by 'object.__proto__.func', and it should passed … … 153 149 Location* imp = V8Location::toNative(holder); 154 150 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 155 static String sharedTemplateUniqueKey = "reloadSharedTemplate"; 156 v8::Persistent<v8::FunctionTemplate> sharedTemplate = V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, V8Location::reloadMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))); 151 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::reloadMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 157 152 return sharedTemplate->GetFunction(); 158 153 } … … 163 158 { 164 159 v8::Isolate* isolate = info.GetIsolate(); 165 // This is only for getting a unique pointer which we can pass to privateTemplateMap. 166 static String privateTemplateUniqueKey = "replacePrivateTemplate"; 167 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); 168 v8::Persistent<v8::FunctionTemplate> privateTemplate = V8PerIsolateData::from(isolate)->privateTemplate(currentWorldType, &privateTemplateUniqueKey, V8Location::replaceMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))); 169 170 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate, currentWorldType)); 160 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::replaceMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 161 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate, worldType(isolate))); 171 162 if (holder.IsEmpty()) { 172 163 // can only reach here by 'object.__proto__.func', and it should passed … … 176 167 Location* imp = V8Location::toNative(holder); 177 168 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 178 static String sharedTemplateUniqueKey = "replaceSharedTemplate"; 179 v8::Persistent<v8::FunctionTemplate> sharedTemplate = V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, V8Location::replaceMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))); 169 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::replaceMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 180 170 return sharedTemplate->GetFunction(); 181 171 } … … 186 176 { 187 177 v8::Isolate* isolate = info.GetIsolate(); 188 // This is only for getting a unique pointer which we can pass to privateTemplateMap. 189 static String privateTemplateUniqueKey = "assignPrivateTemplate"; 190 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); 191 v8::Persistent<v8::FunctionTemplate> privateTemplate = V8PerIsolateData::from(isolate)->privateTemplate(currentWorldType, &privateTemplateUniqueKey, V8Location::assignMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))); 192 193 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate, currentWorldType)); 178 static v8::Persistent<v8::FunctionTemplate> privateTemplate = 179 v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::assignMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 180 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate, worldType(isolate))); 194 181 if (holder.IsEmpty()) { 195 182 // can only reach here by 'object.__proto__.func', and it should passed … … 199 186 Location* imp = V8Location::toNative(holder); 200 187 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 201 static String sharedTemplateUniqueKey = "assignSharedTemplate"; 202 v8::Persistent<v8::FunctionTemplate> sharedTemplate = V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, V8Location::assignMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))); 188 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::assignMethodCustom, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 203 189 return sharedTemplate->GetFunction(); 204 190 }
Note: See TracChangeset
for help on using the changeset viewer.