Changeset 145502 in webkit


Ignore:
Timestamp:
Mar 12, 2013 2:11:24 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r145494.
http://trac.webkit.org/changeset/145494
https://bugs.webkit.org/show_bug.cgi?id=112117

Breaks Chromium Mac (Requested by pfeldman on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-03-12

  • bindings/scripts/CodeGeneratorV8.pm:

(GenerateDomainSafeFunctionGetter):

  • bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:

(WebCore::TestActiveDOMObjectV8Internal::postMessageAttrGetter):

  • bindings/v8/V8PerIsolateData.cpp:

(WebCore::V8PerIsolateData::V8PerIsolateData):

  • bindings/v8/V8PerIsolateData.h:

(V8PerIsolateData):

  • bindings/v8/custom/V8LocationCustom.cpp:

(WebCore::V8Location::reloadAttrGetterCustom):
(WebCore::V8Location::replaceAttrGetterCustom):
(WebCore::V8Location::assignAttrGetterCustom):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r145501 r145502  
     12013-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
    1222013-03-12  Yury Semikhatsky  <yurys@chromium.org>
    223
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r145494 r145502  
    787787    }
    788788
    789     my $newTemplateParams = "${interfaceName}V8Internal::${funcName}MethodCallback, v8Undefined(), $signature";
     789    my $newTemplateString = "v8::FunctionTemplate::New(${interfaceName}V8Internal::${funcName}MethodCallback, v8Undefined(), $signature)";
    790790
    791791    AddToImplIncludes("Frame.h");
     
    793793static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    794794{
    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())));
    801797    if (holder.IsEmpty()) {
    802798        // can only reach here by 'object.__proto__.func', and it should passed
     
    806802    ${interfaceName}* imp = ${v8InterfaceName}::toNative(holder);
    807803    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);
    810805        return sharedTemplate->GetFunction();
    811806    }
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp

    r145494 r145502  
    129129static v8::Handle<v8::Value> postMessageAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    130130{
    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())));
    137133    if (holder.IsEmpty()) {
    138134        // can only reach here by 'object.__proto__.func', and it should passed
     
    142138    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder);
    143139    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()))));
    146141        return sharedTemplate->GetFunction();
    147142    }
  • trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp

    r145494 r145502  
    4545
    4646V8PerIsolateData::V8PerIsolateData(v8::Isolate* isolate)
    47     : m_isolate(isolate)
    48     , m_stringCache(adoptPtr(new StringCache()))
     47    : m_stringCache(adoptPtr(new StringCache()))
    4948    , m_integerCache(adoptPtr(new IntegerCache()))
    5049    , m_domDataStore(0)
     
    123122}
    124123
    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 
    136124#if ENABLE(INSPECTOR)
    137125void V8PerIsolateData::visitExternalStrings(ExternalStringVisitor* visitor)
  • trunk/Source/WebCore/bindings/v8/V8PerIsolateData.h

    r145494 r145502  
    2828
    2929#include "ScopedPersistent.h"
    30 #include "WrapperTypeInfo.h"
    3130#include <v8.h>
    3231#include <wtf/Forward.h>
     
    6665    static void dispose(v8::Isolate*);
    6766
    68     typedef HashMap<void*, v8::Persistent<v8::FunctionTemplate> > TemplateMap;
     67    typedef HashMap<WrapperTypeInfo*, v8::Persistent<v8::FunctionTemplate> > TemplateMap;
    6968
    7069    TemplateMap& rawTemplateMap() { return m_rawTemplates; }
     
    129128    bool shouldCollectGarbageSoon() const { return m_shouldCollectGarbageSoon; }
    130129
    131     v8::Persistent<v8::FunctionTemplate> privateTemplate(WrapperWorldType, void* privatePointer, v8::InvocationCallback, v8::Handle<v8::Value> data, v8::Handle<v8::Signature>, int length = 0);
    132 
    133130private:
    134131    explicit V8PerIsolateData(v8::Isolate*);
     
    136133    static v8::Handle<v8::Value> constructorOfToString(const v8::Arguments&);
    137134
    138     v8::Isolate* m_isolate;
    139135    TemplateMap m_rawTemplates;
    140136    TemplateMap m_templates;
  • trunk/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp

    r145494 r145502  
    140140{
    141141    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)));
    148144    if (holder.IsEmpty()) {
    149145        // can only reach here by 'object.__proto__.func', and it should passed
     
    153149    Location* imp = V8Location::toNative(holder);
    154150    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))));
    157152        return sharedTemplate->GetFunction();
    158153    }
     
    163158{
    164159    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)));
    171162    if (holder.IsEmpty()) {
    172163        // can only reach here by 'object.__proto__.func', and it should passed
     
    176167    Location* imp = V8Location::toNative(holder);
    177168    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))));
    180170        return sharedTemplate->GetFunction();
    181171    }
     
    186176{
    187177    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)));
    194181    if (holder.IsEmpty()) {
    195182        // can only reach here by 'object.__proto__.func', and it should passed
     
    199186    Location* imp = V8Location::toNative(holder);
    200187    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))));
    203189        return sharedTemplate->GetFunction();
    204190    }
Note: See TracChangeset for help on using the changeset viewer.