Changeset 125995 in webkit


Ignore:
Timestamp:
Aug 19, 2012 9:39:48 PM (12 years ago)
Author:
haraken@chromium.org
Message:

[V8] Rename SafeAllocation to V8ObjectConstructor
https://bugs.webkit.org/show_bug.cgi?id=94436

Reviewed by Adam Barth.

For clarification.

No tests. No change in behavior.

  • UseV8.cmake:
  • WebCore.gypi:
  • bindings/v8/ScriptFunctionCall.cpp:

(WebCore::ScriptFunctionCall::construct):

  • bindings/v8/V8Binding.cpp:

(WebCore::createRawTemplate):

  • bindings/v8/V8Binding.h:
  • bindings/v8/V8DOMWindowShell.cpp:

(WebCore::V8DOMWindowShell::installDOMWindow):

  • bindings/v8/V8DOMWrapper.cpp:

(WebCore::V8DOMWrapper::instantiateV8Object):

  • bindings/v8/V8NPObject.cpp:

(WebCore::createV8ObjectForNPObject):

  • bindings/v8/V8ObjectConstructor.cpp: Renamed from Source/WebCore/bindings/v8/SafeAllocation.cpp.

(WebCore):
(WebCore::V8ObjectConstructor::isValidConstructorMode):

  • bindings/v8/V8ObjectConstructor.h: Renamed from Source/WebCore/bindings/v8/SafeAllocation.h.

(WebCore):
(ConstructorMode):
(WebCore::ConstructorMode::ConstructorMode):
(WebCore::ConstructorMode::~ConstructorMode):
(WebCore::ConstructorMode::current):
(V8ObjectConstructor):
(WebCore::V8ObjectConstructor::newInstance):

  • bindings/v8/V8PerContextData.cpp:

(WebCore::V8PerContextData::createWrapperFromCacheSlowCase):

  • bindings/v8/WorkerContextExecutionProxy.cpp:

(WebCore::WorkerContextExecutionProxy::initContextIfNeeded):

  • bindings/v8/custom/V8InjectedScriptManager.cpp:

(WebCore::createInjectedScriptHostV8Wrapper):

  • bindings/v8/custom/V8ScriptProfileCustom.cpp:

(WebCore::toV8):

  • bindings/v8/custom/V8ScriptProfileNodeCustom.cpp:

(WebCore::toV8):

Location:
trunk/Source/WebCore
Files:
14 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r125993 r125995  
     12012-08-19  Kentaro Hara  <haraken@chromium.org>
     2
     3        [V8] Rename SafeAllocation to V8ObjectConstructor
     4        https://bugs.webkit.org/show_bug.cgi?id=94436
     5
     6        Reviewed by Adam Barth.
     7
     8        For clarification.
     9
     10        No tests. No change in behavior.
     11
     12        * UseV8.cmake:
     13        * WebCore.gypi:
     14        * bindings/v8/ScriptFunctionCall.cpp:
     15        (WebCore::ScriptFunctionCall::construct):
     16        * bindings/v8/V8Binding.cpp:
     17        (WebCore::createRawTemplate):
     18        * bindings/v8/V8Binding.h:
     19        * bindings/v8/V8DOMWindowShell.cpp:
     20        (WebCore::V8DOMWindowShell::installDOMWindow):
     21        * bindings/v8/V8DOMWrapper.cpp:
     22        (WebCore::V8DOMWrapper::instantiateV8Object):
     23        * bindings/v8/V8NPObject.cpp:
     24        (WebCore::createV8ObjectForNPObject):
     25        * bindings/v8/V8ObjectConstructor.cpp: Renamed from Source/WebCore/bindings/v8/SafeAllocation.cpp.
     26        (WebCore):
     27        (WebCore::V8ObjectConstructor::isValidConstructorMode):
     28        * bindings/v8/V8ObjectConstructor.h: Renamed from Source/WebCore/bindings/v8/SafeAllocation.h.
     29        (WebCore):
     30        (ConstructorMode):
     31        (WebCore::ConstructorMode::ConstructorMode):
     32        (WebCore::ConstructorMode::~ConstructorMode):
     33        (WebCore::ConstructorMode::current):
     34        (V8ObjectConstructor):
     35        (WebCore::V8ObjectConstructor::newInstance):
     36        * bindings/v8/V8PerContextData.cpp:
     37        (WebCore::V8PerContextData::createWrapperFromCacheSlowCase):
     38        * bindings/v8/WorkerContextExecutionProxy.cpp:
     39        (WebCore::WorkerContextExecutionProxy::initContextIfNeeded):
     40        * bindings/v8/custom/V8InjectedScriptManager.cpp:
     41        (WebCore::createInjectedScriptHostV8Wrapper):
     42        * bindings/v8/custom/V8ScriptProfileCustom.cpp:
     43        (WebCore::toV8):
     44        * bindings/v8/custom/V8ScriptProfileNodeCustom.cpp:
     45        (WebCore::toV8):
     46
    1472012-08-19  Kentaro Hara  <haraken@chromium.org>
    248
  • trunk/Source/WebCore/UseV8.cmake

    r125884 r125995  
    2929    bindings/v8/PageScriptDebugServer.cpp
    3030    bindings/v8/RetainedDOMInfo.cpp
    31     bindings/v8/SafeAllocation.cpp
    3231    bindings/v8/ScheduledAction.cpp
    3332    bindings/v8/ScopedDOMDataStore.cpp
     
    6059    bindings/v8/V8LazyEventListener.cpp
    6160    bindings/v8/V8NodeFilterCondition.cpp
     61    bindings/v8/V8ObjectConstructor.cpp
    6262    bindings/v8/V8PerContextData.cpp
    6363    bindings/v8/V8PerIsolateData.cpp
  • trunk/Source/WebCore/WebCore.gypi

    r125980 r125995  
    21972197            'bindings/v8/RetainedDOMInfo.h',
    21982198            'bindings/v8/RetainedObjectInfo.h',
    2199             'bindings/v8/SafeAllocation.cpp',
    2200             'bindings/v8/SafeAllocation.h',
    22012199            'bindings/v8/ScheduledAction.cpp',
    22022200            'bindings/v8/ScheduledAction.h',
     
    22792277            'bindings/v8/V8NodeFilterCondition.cpp',
    22802278            'bindings/v8/V8NodeFilterCondition.h',
     2279            'bindings/v8/V8ObjectConstructor.cpp',
     2280            'bindings/v8/V8ObjectConstructor.h',
    22812281            'bindings/v8/V8PerContextData.cpp',
    22822282            'bindings/v8/V8PerContextData.h',
  • trunk/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp

    r120791 r125995  
    3232#include "ScriptFunctionCall.h"
    3333
    34 #include "SafeAllocation.h"
    3534#include "ScriptScope.h"
    3635#include "ScriptState.h"
    3736#include "ScriptValue.h"
    3837#include "V8Binding.h"
     38#include "V8ObjectConstructor.h"
    3939#include "V8Proxy.h"
    4040#include "V8RecursionScope.h"
     
    169169        args[i] = m_arguments[i].v8Value();
    170170
    171     v8::Local<v8::Object> result = SafeAllocation::newInstance(constructor, m_arguments.size(), args.get());
     171    v8::Local<v8::Object> result = V8ObjectConstructor::newInstance(constructor, m_arguments.size(), args.get());
    172172    if (!scope.success()) {
    173173        hadException = true;
  • trunk/Source/WebCore/bindings/v8/V8Binding.cpp

    r125495 r125995  
    3838#include "PlatformString.h"
    3939#include "QualifiedName.h"
    40 #include "SafeAllocation.h"
    4140#include "V8DOMStringList.h"
    4241#include "V8Element.h"
     42#include "V8ObjectConstructor.h"
    4343#include "V8Proxy.h"
    4444
     
    318318{
    319319    v8::HandleScope scope;
    320     v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(SafeAllocation::isValidConstructorMode);
     320    v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(V8ObjectConstructor::isValidConstructorMode);
    321321    return v8::Persistent<v8::FunctionTemplate>::New(result);
    322322}       
  • trunk/Source/WebCore/bindings/v8/V8Binding.h

    r125993 r125995  
    3434#include "BindingSecurity.h"
    3535#include "Document.h"
    36 #include "SafeAllocation.h"
    3736#include "V8BindingMacros.h"
    3837#include "V8DOMConfiguration.h"
     
    4039#include "V8DOMWrapper.h"
    4140#include "V8HiddenPropertyName.h"
     41#include "V8ObjectConstructor.h"
    4242#include "V8PerIsolateData.h"
    4343#include "V8Proxy.h"
  • trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp

    r125656 r125995  
    4343#include "PlatformSupport.h"
    4444#include "RuntimeEnabledFeatures.h"
    45 #include "SafeAllocation.h"
    4645#include "ScriptCallStack.h"
    4746#include "ScriptCallStackFactory.h"
     
    6059#include "V8History.h"
    6160#include "V8Location.h"
     61#include "V8ObjectConstructor.h"
    6262#include "V8PerContextData.h"
    6363#include "V8Proxy.h"
     
    411411    // Create a new JS window object and use it as the prototype for the  shadow global object.
    412412    v8::Handle<v8::Function> windowConstructor = V8DOMWrapper::constructorForType(&V8DOMWindow::info, window);
    413     v8::Local<v8::Object> jsWindow = SafeAllocation::newInstance(windowConstructor);
     413    v8::Local<v8::Object> jsWindow = V8ObjectConstructor::newInstance(windowConstructor);
    414414    // Bail out if allocation failed.
    415415    if (jsWindow.IsEmpty())
  • trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp

    r125242 r125995  
    3838#include "Frame.h"
    3939#include "FrameLoaderClient.h"
    40 #include "SafeAllocation.h"
    4140#include "StylePropertySet.h"
    4241#include "V8AbstractEventListener.h"
     
    5251#include "V8NodeFilterCondition.h"
    5352#include "V8NodeList.h"
     53#include "V8ObjectConstructor.h"
    5454#include "V8PerContextData.h"
    5555#include "V8Proxy.h"
     
    206206    else {
    207207        v8::Local<v8::Function> function = type->getTemplate()->GetFunction();
    208         instance = SafeAllocation::newInstance(function);
     208        instance = V8ObjectConstructor::newInstance(function);
    209209    }
    210210
  • trunk/Source/WebCore/bindings/v8/V8NPObject.cpp

    r125495 r125995  
    3535#include "HTMLPlugInElement.h"
    3636#include "NPV8Object.h"
    37 #include "SafeAllocation.h"
    3837#include "V8Binding.h"
    3938#include "V8DOMMap.h"
     
    4241#include "V8HTMLObjectElement.h"
    4342#include "V8NPUtils.h"
     43#include "V8ObjectConstructor.h"
    4444#include "V8Proxy.h"
    4545#include "npruntime_impl.h"
     
    408408
    409409    v8::Handle<v8::Function> v8Function = npObjectDesc->GetFunction();
    410     v8::Local<v8::Object> value = SafeAllocation::newInstance(v8Function);
     410    v8::Local<v8::Object> value = V8ObjectConstructor::newInstance(v8Function);
    411411
    412412    // If we were unable to allocate the instance, we avoid wrapping and registering the NP object.
  • trunk/Source/WebCore/bindings/v8/V8ObjectConstructor.cpp

    r125994 r125995  
    2424
    2525#include "config.h"
    26 #include "SafeAllocation.h"
     26#include "V8ObjectConstructor.h"
    2727
    2828#include "V8Binding.h"
     
    3030namespace WebCore {
    3131
    32 v8::Handle<v8::Value> SafeAllocation::isValidConstructorMode(const v8::Arguments& args)
     32v8::Handle<v8::Value> V8ObjectConstructor::isValidConstructorMode(const v8::Arguments& args)
    3333{
    3434    if (ConstructorMode::current() == ConstructorMode::CreateNewObject)
  • trunk/Source/WebCore/bindings/v8/V8ObjectConstructor.h

    r125994 r125995  
    2929*/
    3030
    31 #ifndef SafeAllocation_h
    32 #define SafeAllocation_h
     31#ifndef V8ObjectConstructor_h
     32#define V8ObjectConstructor_h
    3333
    3434#include "V8PerIsolateData.h"
     
    6565};
    6666
    67 class SafeAllocation {
     67class V8ObjectConstructor {
    6868public:
    6969    static inline v8::Local<v8::Object> newInstance(v8::Handle<v8::Function>);
     
    7474};
    7575
    76 v8::Local<v8::Object> SafeAllocation::newInstance(v8::Handle<v8::Function> function)
     76v8::Local<v8::Object> V8ObjectConstructor::newInstance(v8::Handle<v8::Function> function)
    7777{
    7878    if (function.IsEmpty())
     
    8383}
    8484
    85 v8::Local<v8::Object> SafeAllocation::newInstance(v8::Handle<v8::ObjectTemplate> objectTemplate)
     85v8::Local<v8::Object> V8ObjectConstructor::newInstance(v8::Handle<v8::ObjectTemplate> objectTemplate)
    8686{
    8787    if (objectTemplate.IsEmpty())
     
    9292}
    9393
    94 v8::Local<v8::Object> SafeAllocation::newInstance(v8::Handle<v8::Function> function, int argc, v8::Handle<v8::Value> argv[])
     94v8::Local<v8::Object> V8ObjectConstructor::newInstance(v8::Handle<v8::Function> function, int argc, v8::Handle<v8::Value> argv[])
    9595{
    9696    if (function.IsEmpty())
     
    103103} // namespace WebCore
    104104
    105 #endif // SafeAllocation_h
     105#endif // V8ObjectConstructor_h
  • trunk/Source/WebCore/bindings/v8/V8PerContextData.cpp

    r125242 r125995  
    3232#include "V8PerContextData.h"
    3333
    34 #include "SafeAllocation.h"
     34#include "V8ObjectConstructor.h"
    3535
    3636namespace WebCore {
     
    9393    v8::Context::Scope scope(m_context);
    9494    v8::Local<v8::Function> function = constructorForType(type);
    95     v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
     95    v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
    9696    if (!instance.IsEmpty()) {
    9797        m_wrapperBoilerplates.set(type, v8::Persistent<v8::Object>::New(instance));
  • trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp

    r125495 r125995  
    3838#include "DedicatedWorkerContext.h"
    3939#include "Event.h"
    40 #include "SafeAllocation.h"
    4140#include "ScriptCallStack.h"
    4241#include "SharedWorker.h"
     
    4645#include "V8DOMWindowShell.h"
    4746#include "V8DedicatedWorkerContext.h"
     47#include "V8ObjectConstructor.h"
    4848#include "V8PerContextData.h"
    4949#include "V8Proxy.h"
     
    174174#endif
    175175    v8::Handle<v8::Function> workerContextConstructor = m_perContextData->constructorForType(contextType);
    176     v8::Local<v8::Object> jsWorkerContext = SafeAllocation::newInstance(workerContextConstructor);
     176    v8::Local<v8::Object> jsWorkerContext = V8ObjectConstructor::newInstance(workerContextConstructor);
    177177    // Bail out if allocation failed.
    178178    if (jsWorkerContext.IsEmpty()) {
  • trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp

    r124847 r125995  
    3636#include "DOMWindow.h"
    3737#include "InjectedScriptHost.h"
    38 #include "SafeAllocation.h"
    3938#include "ScriptObject.h"
    4039#include "V8Binding.h"
     
    6059        return v8::Local<v8::Object>();
    6160    }
    62     v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
     61    v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
    6362    if (instance.IsEmpty()) {
    6463        // Avoid setting the wrapper if allocation failed.
  • trunk/Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp

    r124938 r125995  
    3333#include "V8ScriptProfile.h"
    3434
    35 #include "SafeAllocation.h"
    3635#include "ScriptProfile.h"
    3736#include "V8Binding.h"
     
    5150        return v8Undefined();
    5251    }
    53     v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
     52    v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
    5453    if (instance.IsEmpty()) {
    5554        // Avoid setting the wrapper if allocation failed.
  • trunk/Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp

    r124938 r125995  
    3333#include "V8ScriptProfileNode.h"
    3434
    35 #include "SafeAllocation.h"
    3635#include "ScriptProfileNode.h"
    3736#include "V8Binding.h"
     
    5857        return v8Undefined();
    5958    }
    60     v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
     59    v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
    6160    if (instance.IsEmpty()) {
    6261        // Avoid setting the wrapper if allocation failed.
Note: See TracChangeset for help on using the changeset viewer.