Changeset 60932 in webkit


Ignore:
Timestamp:
Jun 9, 2010 8:01:40 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-06-09 Anton Muhin <antonm@chromium.org>

Reviewed by Nate Chapin.

[v8] First phase of switching to new named property query API
https://bugs.webkit.org/show_bug.cgi?id=40303

To allow better management of attributes of intercepted properties,
we're starting to switch to new named property query API which
now could return attributes instead of simple property present/absent
flag. The next step would remove USE_NEW_QUERY_CALLBACK, then
v8 would have them enabled by default.

  • bindings/scripts/CodeGeneratorV8.pm:
  • bindings/v8/NPV8Object.cpp:
  • bindings/v8/ScriptArray.cpp:
  • bindings/v8/ScriptCallStack.cpp:
  • bindings/v8/SerializedScriptValue.cpp:
  • bindings/v8/V8Binding.cpp:
  • bindings/v8/V8DOMWrapper.cpp:
  • bindings/v8/V8GCController.cpp:
  • bindings/v8/V8IsolatedContext.cpp:
  • bindings/v8/V8NPObject.cpp: (WebCore::npObjectQueryProperty):
  • bindings/v8/V8Proxy.cpp:
  • bindings/v8/custom/V8PopStateEventCustom.cpp:
  • bindings/v8/custom/V8StorageCustom.cpp: (WebCore::V8Storage::namedPropertyQuery):
  • config.h:
Location:
trunk/WebCore
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r60931 r60932  
     12010-06-09  Anton Muhin  <antonm@chromium.org>
     2
     3        Reviewed by Nate Chapin.
     4
     5        [v8] First phase of switching to new named property query API
     6        https://bugs.webkit.org/show_bug.cgi?id=40303
     7
     8        To allow better management of attributes of intercepted properties,
     9        we're starting to switch to new named property query API which
     10        now could return attributes instead of simple property present/absent
     11        flag.  The next step would remove USE_NEW_QUERY_CALLBACK, then
     12        v8 would have them enabled by default.
     13
     14        * bindings/scripts/CodeGeneratorV8.pm:
     15        * bindings/v8/NPV8Object.cpp:
     16        * bindings/v8/ScriptArray.cpp:
     17        * bindings/v8/ScriptCallStack.cpp:
     18        * bindings/v8/SerializedScriptValue.cpp:
     19        * bindings/v8/V8Binding.cpp:
     20        * bindings/v8/V8DOMWrapper.cpp:
     21        * bindings/v8/V8GCController.cpp:
     22        * bindings/v8/V8IsolatedContext.cpp:
     23        * bindings/v8/V8NPObject.cpp:
     24        (WebCore::npObjectQueryProperty):
     25        * bindings/v8/V8Proxy.cpp:
     26        * bindings/v8/custom/V8PopStateEventCustom.cpp:
     27        * bindings/v8/custom/V8StorageCustom.cpp:
     28        (WebCore::V8Storage::namedPropertyQuery):
     29        * config.h:
     30
    1312010-06-09  Steve Block  <steveblock@google.com>
    232
  • trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r60931 r60932  
    470470        push(@headerContent, <<END);
    471471    static v8::Handle<v8::Array> namedPropertyEnumerator(const v8::AccessorInfo&);
    472     static v8::Handle<v8::Boolean> namedPropertyQuery(v8::Local<v8::String>, const v8::AccessorInfo&);
     472    static v8::Handle<v8::Integer> namedPropertyQuery(v8::Local<v8::String>, const v8::AccessorInfo&);
    473473END
    474474    }
     
    15491549    push(@implContent, $hasSetter ? "V8${interfaceName}::namedPropertySetter, " : "0, ");
    15501550    # If there is a custom enumerator, there MUST be custom query to properly communicate property attributes.
    1551     push(@implContent, $hasEnumerator ? "V8${interfaceName}::namedPropertyQuery," : "0, ");
     1551    push(@implContent, $hasEnumerator ? "V8${interfaceName}::namedPropertyQuery, " : "0, ");
    15521552    push(@implContent, $hasDeleter ? "V8${interfaceName}::namedPropertyDeleter, " : "0, ");
    15531553    push(@implContent, $hasEnumerator ? "V8${interfaceName}::namedPropertyEnumerator" : "0");
  • trunk/WebCore/bindings/v8/NPV8Object.cpp

    r59862 r60932  
    5050
    5151#include <stdio.h>
    52 #include <v8.h>
    5352#include <wtf/StringExtras.h>
    5453
  • trunk/WebCore/bindings/v8/ScriptArray.cpp

    r54421 r60932  
    3939#include "V8Binding.h"
    4040#include "V8Proxy.h"
    41 
    42 #include <v8.h>
    4341
    4442namespace WebCore {
  • trunk/WebCore/bindings/v8/ScriptCallStack.cpp

    r60266 r60932  
    3838
    3939#include <v8-debug.h>
    40 #include <v8.h>
    4140
    4241namespace WebCore {
  • trunk/WebCore/bindings/v8/SerializedScriptValue.cpp

    r57382 r60932  
    4545#include "V8Proxy.h"
    4646
    47 #include <v8.h>
    4847#include <wtf/Assertions.h>
    4948#include <wtf/RefCounted.h>
  • trunk/WebCore/bindings/v8/V8Binding.cpp

    r56825 r60932  
    4545#include <wtf/text/CString.h>
    4646
    47 #include <v8.h>
    48 
    4947namespace WebCore {
    5048
  • trunk/WebCore/bindings/v8/V8DOMWrapper.cpp

    r60670 r60932  
    8383#include <algorithm>
    8484#include <utility>
    85 #include <v8.h>
    8685#include <v8-debug.h>
    8786#include <wtf/Assertions.h>
  • trunk/WebCore/bindings/v8/V8GCController.cpp

    r58316 r60932  
    4747#include <algorithm>
    4848#include <utility>
    49 #include <v8.h>
    5049#include <v8-debug.h>
    5150#include <wtf/HashMap.h>
  • trunk/WebCore/bindings/v8/V8IsolatedContext.cpp

    r54051 r60932  
    3939#include "V8DOMWindow.h"
    4040#include "V8HiddenPropertyName.h"
    41 #include <v8.h>
    4241
    4342namespace WebCore {
  • trunk/WebCore/bindings/v8/V8NPObject.cpp

    r60531 r60932  
    244244}
    245245
    246 v8::Handle<v8::Boolean> npObjectQueryProperty(v8::Local<v8::String> name, const v8::AccessorInfo& info)
     246v8::Handle<v8::Integer> npObjectQueryProperty(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    247247{
    248248    NPIdentifier identifier = getStringIdentifier(name);
    249     return npObjectGetProperty(info.Holder(), identifier, name).IsEmpty() ? v8::Handle<v8::Boolean>() : v8::True();
     249    return npObjectGetProperty(info.Holder(), identifier, name).IsEmpty() ? v8::Handle<v8::Integer>() : v8::Integer::New(v8::None);
    250250}
    251251
  • trunk/WebCore/bindings/v8/V8Proxy.cpp

    r60728 r60932  
    6868#include <stdio.h>
    6969#include <utility>
    70 #include <v8.h>
    7170#include <wtf/Assertions.h>
    7271#include <wtf/OwnArrayPtr.h>
  • trunk/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp

    r58504 r60932  
    3636#include "V8Proxy.h"
    3737
    38 #include <v8.h>
    39 
    4038namespace WebCore {
    4139
  • trunk/WebCore/bindings/v8/custom/V8StorageCustom.cpp

    r60531 r60932  
    8080}
    8181
    82 v8::Handle<v8::Boolean> V8Storage::namedPropertyQuery(v8::Local<v8::String> v8Name, const v8::AccessorInfo& info)
     82v8::Handle<v8::Integer> V8Storage::namedPropertyQuery(v8::Local<v8::String> v8Name, const v8::AccessorInfo& info)
    8383{
    8484    INC_STATS("DOM.Storage.NamedPropertyQuery");
     
    8888
    8989    if (storage->contains(name) && name != "length")
    90         return v8::True();
     90        return v8::Integer::New(v8::None);
    9191
    92     return v8::Handle<v8::Boolean>();
     92    return v8::Handle<v8::Integer>();
    9393}
    9494
  • trunk/WebCore/config.h

    r59537 r60932  
    224224#define WTF_USE_SAFARI_THEME 1
    225225#endif
     226
     227#if defined(WTF_USE_V8)
     228#define USE_NEW_QUERY_CALLBACKS
     229#endif
Note: See TracChangeset for help on using the changeset viewer.