[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

japhet at chromium.org japhet at chromium.org
Thu Apr 8 01:02:48 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 1327f7718b768ba9f45103d0995986a829d8f0fc
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 12 22:12:28 2010 +0000

    2010-01-12  Nate Chapin  <japhet at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Remove static const ints from V8CustomBinding.h
    
            https://bugs.webkit.org/show_bug.cgi?id=33547
    
            * bindings/scripts/CodeGeneratorV8.pm: Generate and use custom
                internal field indices from lists of custom internal fields.
            * bindings/v8/NPV8Object.cpp:
            * bindings/v8/NPV8Object.h:
            * bindings/v8/V8Binding.cpp:
            * bindings/v8/V8DOMWindowShell.cpp:
            * bindings/v8/V8DOMWindowShell.h:
            * bindings/v8/V8DOMWrapper.cpp: Remove a bunch of now unnecessary
                manually calls to setInternalFieldCount().
            * bindings/v8/V8DOMWrapper.h:
            * bindings/v8/V8Index.h:
            * bindings/v8/V8IsolatedContext.cpp:
            * bindings/v8/V8IsolatedContext.h:
            * bindings/v8/V8NPObject.cpp:
            * bindings/v8/custom/V8AbstractWorkerCustom.cpp:
            * bindings/v8/custom/V8CustomBinding.h: Remove the static const ints.
            * bindings/v8/custom/V8DOMApplicationCacheCustom.cpp:
            * bindings/v8/custom/V8DOMWindowCustom.cpp:
            * bindings/v8/custom/V8DocumentCustom.cpp:
            * bindings/v8/custom/V8HTMLAudioElementConstructor.cpp:
            * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
            * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
            * bindings/v8/custom/V8HTMLOptionElementConstructor.cpp:
            * bindings/v8/custom/V8MessageChannelConstructor.cpp:
            * bindings/v8/custom/V8MessagePortCustom.cpp:
            * bindings/v8/custom/V8NodeCustom.cpp:
            * bindings/v8/custom/V8NotificationCenterCustom.cpp:
            * bindings/v8/custom/V8SVGElementInstanceCustom.cpp:
            * bindings/v8/custom/V8WebSocketCustom.cpp:
            * bindings/v8/custom/V8WorkerContextCustom.cpp:
            * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
            * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53164 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ee50ead..b76c73a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,44 @@
+2010-01-12  Nate Chapin  <japhet at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Remove static const ints from V8CustomBinding.h
+
+        https://bugs.webkit.org/show_bug.cgi?id=33547
+
+        * bindings/scripts/CodeGeneratorV8.pm: Generate and use custom 
+            internal field indices from lists of custom internal fields.
+        * bindings/v8/NPV8Object.cpp:
+        * bindings/v8/NPV8Object.h:
+        * bindings/v8/V8Binding.cpp:
+        * bindings/v8/V8DOMWindowShell.cpp:
+        * bindings/v8/V8DOMWindowShell.h:
+        * bindings/v8/V8DOMWrapper.cpp: Remove a bunch of now unnecessary
+            manually calls to setInternalFieldCount().
+        * bindings/v8/V8DOMWrapper.h:
+        * bindings/v8/V8Index.h:
+        * bindings/v8/V8IsolatedContext.cpp:
+        * bindings/v8/V8IsolatedContext.h:
+        * bindings/v8/V8NPObject.cpp:
+        * bindings/v8/custom/V8AbstractWorkerCustom.cpp:
+        * bindings/v8/custom/V8CustomBinding.h: Remove the static const ints.
+        * bindings/v8/custom/V8DOMApplicationCacheCustom.cpp:
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        * bindings/v8/custom/V8DocumentCustom.cpp:
+        * bindings/v8/custom/V8HTMLAudioElementConstructor.cpp:
+        * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+        * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
+        * bindings/v8/custom/V8HTMLOptionElementConstructor.cpp:
+        * bindings/v8/custom/V8MessageChannelConstructor.cpp:
+        * bindings/v8/custom/V8MessagePortCustom.cpp:
+        * bindings/v8/custom/V8NodeCustom.cpp:
+        * bindings/v8/custom/V8NotificationCenterCustom.cpp:
+        * bindings/v8/custom/V8SVGElementInstanceCustom.cpp:
+        * bindings/v8/custom/V8WebSocketCustom.cpp:
+        * bindings/v8/custom/V8WorkerContextCustom.cpp:
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp:
+
 2010-01-12  Darin Fisher  <darin at chromium.org>
 
         Fixing chromium build bustage.
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index e73b1bd..d325238 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -265,9 +265,8 @@ sub GenerateHeader
     push(@headerContent, "#include <v8.h>\n");
     push(@headerContent, "#include <wtf/HashMap.h>\n");
     push(@headerContent, "#include \"StringHash.h\"\n");
-
-    push(@headerContent, "\nnamespace WebCore {\n\n");
-    push(@headerContent, "class V8ClassIndex;\n");
+    push(@headerContent, "#include \"V8Index.h\"\n");
+    push(@headerContent, "\nnamespace WebCore {\n");
     push(@headerContent, "\nclass $className {\n");
     push(@headerContent, <<END);
 
@@ -320,6 +319,7 @@ END
     GenerateHeaderRuntimeEnablerDeclarations(@enabledAtRuntime);
     GenerateHeaderNamedAndIndexedPropertyAccessors($dataNode);
     GenerateHeaderCustomCall($dataNode);
+    GenerateHeaderCustomInternalFieldIndices($dataNode);
     
     if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) {
         push(@headerContent, <<END);
@@ -344,6 +344,53 @@ END
     push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString;
 }
 
+sub GetInternalFields
+{
+    my $dataNode = shift;
+    my $name = $dataNode->name;
+    
+    # FIXME: I am hideous and hard-coded.  Make me beautiful.
+    return ("cacheIndex", "implementationIndex") if ($name eq "Document") || ($name eq "SVGDocument");
+    return ("cacheIndex", "implementationIndex", "markerIndex", "shadowIndex") if $name eq "HTMLDocument";
+    return ("cacheIndex") if IsNodeSubType($dataNode);
+    return ("cacheIndex") if $name eq "XMLHttpRequest";
+    return ("cacheIndex") if $name eq "XMLHttpRequestUpload";
+    return ("cacheIndex") if $name eq "MessagePort";
+    return ("port1Index", "port2Index") if ($name eq "MessageChannel");
+    return ("cacheIndex") if $name eq "AbstractWorker";
+    return ("abstractWorkerCacheIndex", "cacheIndex") if $name eq "Worker";
+    return ("abstractWorkerCacheIndex", "cacheIndex") if $name eq "WorkerContext";
+    return ("abstractWorkerCacheIndex", "workerContextCacheIndex", "cacheIndex") if $name eq "DedicatedWorkerContext";
+    return ("abstractWorkerCacheIndex", "cacheIndex") if $name eq "SharedWorker";
+    return ("abstractWorkerCacheIndex", "workerContextCacheIndex", "cacheIndex") if $name eq "SharedWorkerContext";
+    return ("cacheIndex") if $name eq "Notification";
+    return ("cacheIndex") if $name eq "SVGElementInstance";
+    return ("consoleIndex", "historyIndex", "locationbarIndex", "menubarIndex", "navigatorIndex", "personalbarIndex",
+        "screenIndex", "scrollbarsIndex", "selectionIndex", "statusbarIndex", "toolbarIndex", "locationIndex",
+        "domSelectionIndex", "cacheIndex", "enteredIsolatedWorldIndex") if $name eq "DOMWindow";
+    return ("cacheIndex") if $name eq "DOMApplicationCache";
+    return ("cacheIndex") if $name eq "WebSocket";
+    return ("ownerNodeIndex") if ($name eq "StyleSheet") || ($name eq "CSSStyleSheet");
+    return ("ownerNodeIndex") if ($name eq "NamedNodeMap");
+    return ();
+}
+
+sub GenerateHeaderCustomInternalFieldIndices
+{
+    my $dataNode = shift;
+    my @customInternalFields = GetInternalFields($dataNode);
+    my $customFieldCounter = 0;
+    foreach my $customInternalField (@customInternalFields) {
+        push(@headerContent, <<END);
+  static const int ${customInternalField} = v8DefaultWrapperInternalFieldCount + ${customFieldCounter};
+END
+        $customFieldCounter++;
+    }
+    push(@headerContent, <<END);
+  static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + ${customFieldCounter};
+END
+}
+
 sub GenerateHeaderRuntimeEnablerDeclarations
 {
     my @enabledAtRuntime = @_;
@@ -474,28 +521,6 @@ sub IsNodeSubType
     return 0;
 }
 
-sub GetHiddenDependencyIndex
-{
-    my $dataNode = shift;
-    my $attribute = shift;
-    my $name = $dataNode->name;
-    return "V8Custom::kNodeEventListenerCacheIndex" if IsNodeSubType($dataNode);
-    return "V8Custom::kSVGElementInstanceEventListenerCacheIndex" if $name eq "SVGElementInstance";
-    return "V8Custom::kAbstractWorkerRequestCacheIndex" if $name eq "AbstractWorker";
-    return "V8Custom::kWorkerRequestCacheIndex" if $name eq "Worker";
-    return "V8Custom::kDedicatedWorkerContextRequestCacheIndex" if $name eq "DedicatedWorkerContext";
-    return "V8Custom::kWorkerContextRequestCacheIndex" if $name eq "WorkerContext";
-    return "V8Custom::kWorkerContextRequestCacheIndex" if $name eq "SharedWorkerContext";
-    return "V8Custom::kMessagePortRequestCacheIndex" if $name eq "MessagePort";
-    return "V8Custom::kWebSocketCacheIndex" if $name eq "WebSocket";
-    return "V8Custom::kXMLHttpRequestCacheIndex" if $name eq "XMLHttpRequest";
-    return "V8Custom::kXMLHttpRequestCacheIndex" if $name eq "XMLHttpRequestUpload";
-    return "V8Custom::kDOMApplicationCacheCacheIndex" if $name eq "DOMApplicationCache";
-    return "V8Custom::kNotificationRequestCacheIndex" if $name eq "Notification";
-    return "V8Custom::kDOMWindowEventListenerCacheIndex" if $name eq "DOMWindow";
-    die "Unexpected name " . $name . " when generating " . $attribute;
-}
-
 sub HolderToNative
 {
     my $dataNode = shift;
@@ -941,8 +966,7 @@ END
         } elsif ($attribute->signature->type eq "EventListener") {
             $implIncludes{"V8AbstractEventListener.h"} = 1;
             $implIncludes{"V8CustomBinding.h"} = 1;
-            $cacheIndex = GetHiddenDependencyIndex($dataNode, $attrName);
-            push(@implContentDecls, "    transferHiddenDependency(holder, imp->$attrName(), value, $cacheIndex);\n");
+            push(@implContentDecls, "    transferHiddenDependency(holder, imp->$attrName(), value, V8${interfaceName}::cacheIndex);\n");
             push(@implContentDecls, "    imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(imp, value, true, ListenerFindOrCreate)");
         } else {
             push(@implContentDecls, "    imp->set$implSetterFunctionName($result");
@@ -1670,18 +1694,12 @@ END
         $parentClassIndex = uc($codeGenerator->StripModule($parent));
         last;
     }
-
-    # find the field count
-    my $fieldCount = "V8Custom::kDefaultWrapperInternalFieldCount";
-    if (IsNodeSubType($dataNode)) {
-        $fieldCount = "V8Custom::kNodeMinimumInternalFieldCount";
-    }
     
     # Generate the template configuration method
     push(@implContent,  <<END);
 static v8::Persistent<v8::FunctionTemplate> Configure${className}Template(v8::Persistent<v8::FunctionTemplate> desc) {
   v8::Local<v8::Signature> default_signature = configureTemplate(desc, \"${interfaceName}\",
-      V8ClassIndex::$parentClassIndex, $fieldCount,
+      V8ClassIndex::$parentClassIndex, V8${interfaceName}::internalFieldCount,
 END
 
     # Set up our attributes if we have them
diff --git a/WebCore/bindings/v8/NPV8Object.cpp b/WebCore/bindings/v8/NPV8Object.cpp
index 2910bd7..c5db79b 100644
--- a/WebCore/bindings/v8/NPV8Object.cpp
+++ b/WebCore/bindings/v8/NPV8Object.cpp
@@ -37,6 +37,7 @@
 #include "V8CustomBinding.h"
 #include "V8GCController.h"
 #include "V8Helpers.h"
+#include "V8Index.h"
 #include "V8NPUtils.h"
 #include "V8Proxy.h"
 #include "bindings/npruntime.h"
@@ -47,6 +48,7 @@
 #include <v8.h>
 #include <wtf/StringExtras.h>
 
+using WebCore::npObjectInternalFieldCount;
 using WebCore::toV8Context;
 using WebCore::toV8Proxy;
 using WebCore::V8ClassIndex;
@@ -104,8 +106,8 @@ NPClass* npScriptObjectClass = &V8NPObjectClass;
 NPObject* npCreateV8ScriptObject(NPP npp, v8::Handle<v8::Object> object, WebCore::DOMWindow* root)
 {
     // Check to see if this object is already wrapped.
-    if (object->InternalFieldCount() == V8Custom::kNPObjectInternalFieldCount) {
-        v8::Local<v8::Value> typeIndex = object->GetInternalField(V8Custom::kDOMWrapperTypeIndex);
+    if (object->InternalFieldCount() == npObjectInternalFieldCount) {
+        v8::Local<v8::Value> typeIndex = object->GetInternalField(WebCore::v8DOMWrapperTypeIndex);
         if (typeIndex->IsNumber() && typeIndex->Uint32Value() == V8ClassIndex::NPOBJECT) {
 
             NPObject* returnValue = V8DOMWrapper::convertToNativeObject<NPObject>(V8ClassIndex::NPOBJECT, object);
diff --git a/WebCore/bindings/v8/NPV8Object.h b/WebCore/bindings/v8/NPV8Object.h
index 65a7ccf..eec07ea 100644
--- a/WebCore/bindings/v8/NPV8Object.h
+++ b/WebCore/bindings/v8/NPV8Object.h
@@ -30,11 +30,14 @@
 #ifndef NPV8Object_h
 #define NPV8Object_h
 
+#include "V8Index.h"
 #include "bindings/npruntime.h"
 #include <v8.h>
 
 namespace WebCore {
     class DOMWindow;
+
+    static const int npObjectInternalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
 }
 
 extern NPClass* npScriptObjectClass;
diff --git a/WebCore/bindings/v8/V8Binding.cpp b/WebCore/bindings/v8/V8Binding.cpp
index ca7cab3..c82ebb2 100644
--- a/WebCore/bindings/v8/V8Binding.cpp
+++ b/WebCore/bindings/v8/V8Binding.cpp
@@ -128,11 +128,11 @@ private:
 
 
 void* v8DOMWrapperToNative(v8::Handle<v8::Object> object) {
-    return object->GetPointerFromInternalField(V8Custom::kDOMWrapperObjectIndex);
+    return object->GetPointerFromInternalField(v8DOMWrapperObjectIndex);
 }
     
 void* v8DOMWrapperToNative(const v8::AccessorInfo& info) {
-    return info.Holder()->GetPointerFromInternalField(V8Custom::kDOMWrapperObjectIndex);
+    return info.Holder()->GetPointerFromInternalField(v8DOMWrapperObjectIndex);
 }
     
 
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.cpp b/WebCore/bindings/v8/V8DOMWindowShell.cpp
index cc8b7dc..3b4a901 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -329,7 +329,7 @@ v8::Persistent<v8::Context> V8DOMWindowShell::createNewContext(v8::Handle<v8::Ob
 
     // Install a security handler with V8.
     globalTemplate->SetAccessCheckCallbacks(V8DOMWindow::namedSecurityCheck, V8DOMWindow::indexedSecurityCheck, v8::Integer::New(V8ClassIndex::DOMWINDOW));
-    globalTemplate->SetInternalFieldCount(V8Custom::kDOMWindowInternalFieldCount);
+    globalTemplate->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
 
     // Used to avoid sleep calls in unload handlers.
     if (!V8Proxy::registeredExtensionWithV8(DateExtension::get()))
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.h b/WebCore/bindings/v8/V8DOMWindowShell.h
index 16f907a..29dd517 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.h
+++ b/WebCore/bindings/v8/V8DOMWindowShell.h
@@ -32,13 +32,16 @@
 #define V8DOMWindowShell_h
 
 #include "V8CustomBinding.h"
+#include "V8Index.h"
 #include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 
 class DOMWindow;
 class Frame;
+class String;
 
 // V8WindowShell represents all the per-global object state for a Frame that
 // persist between navigations.
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index a5de061..87926c5 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -48,11 +48,15 @@
 #include "V8DOMWindow.h"
 #include "V8EventListenerList.h"
 #include "V8HTMLCollection.h"
+#include "V8HTMLDocument.h"
 #include "V8Index.h"
 #include "V8IsolatedContext.h"
+#include "V8MessageChannel.h"
 #include "V8Location.h"
+#include "V8NamedNodeMap.h"
 #include "V8NodeList.h"
 #include "V8Proxy.h"
+#include "V8StyleSheet.h"
 #include "WebGLArray.h"
 #include "WebGLUniformLocation.h"
 #include "WorkerContextExecutionProxy.h"
@@ -288,56 +292,14 @@ v8::Persistent<v8::FunctionTemplate> V8DOMWrapper::getTemplate(V8ClassIndex::V8W
         toStringTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(ConstructorToString));
     descriptor->Set(GetToStringName(), toStringTemplate);
     switch (type) {
-    case V8ClassIndex::HTMLDOCUMENT: {
-        // We add an extra internal field to all Document wrappers for
-        // storing a per document DOMImplementation wrapper.
-        //
-        // Additionally, we add two extra internal fields for
-        // HTMLDocuments to implement temporary shadowing of
-        // document.all. One field holds an object that is used as a
-        // marker. The other field holds the marker object if
-        // document.all is not shadowed and some other value if
-        // document.all is shadowed.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kNodeMinimumInternalFieldCount);
-        instanceTemplate->SetInternalFieldCount(V8Custom::kHTMLDocumentInternalFieldCount);
-        break;
-    }
-#if ENABLE(SVG)
-    case V8ClassIndex::SVGDOCUMENT:  // fall through
-#endif
-    case V8ClassIndex::DOCUMENT: {
-        // We add an extra internal field to all Document wrappers for
-        // storing a per document DOMImplementation wrapper.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kNodeMinimumInternalFieldCount);
-        instanceTemplate->SetInternalFieldCount( V8Custom::kDocumentMinimumInternalFieldCount);
-        break;
-    }
-    case V8ClassIndex::STYLESHEET:  // fall through
-    case V8ClassIndex::CSSSTYLESHEET: {
-        // We add an extra internal field to hold a reference to
-        // the owner node.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kDefaultWrapperInternalFieldCount);
-        instanceTemplate->SetInternalFieldCount(V8Custom::kStyleSheetInternalFieldCount);
-        break;
-    }
-    case V8ClassIndex::NAMEDNODEMAP: {
-        // We add an extra internal field to hold a reference to the owner node.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kDefaultWrapperInternalFieldCount);
-        instanceTemplate->SetInternalFieldCount(V8Custom::kNamedNodeMapInternalFieldCount);
-        break;
-    }
     case V8ClassIndex::DOMWINDOW: {
-        descriptor->PrototypeTemplate()->SetInternalFieldCount(V8Custom::kDOMWindowInternalFieldCount);
+        descriptor->PrototypeTemplate()->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
         descriptor->SetHiddenPrototype(true);
 
         // Reserve spaces for references to location, history and
         // navigator objects.
         v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kDOMWindowInternalFieldCount);
+        instanceTemplate->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
 
         // Set access check callbacks, but turned off initially.
         // When a context is detached from a frame, turn on the access check.
@@ -355,105 +317,25 @@ v8::Persistent<v8::FunctionTemplate> V8DOMWrapper::getTemplate(V8ClassIndex::V8W
         instance->SetAccessor(v8::String::New("assign"), V8Location::assignAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
         break;
     }
-    case V8ClassIndex::HISTORY:
-        break;
-
     case V8ClassIndex::MESSAGECHANNEL: {
-        // Reserve two more internal fields for referencing the port1
-        // and port2 wrappers. This ensures that the port wrappers are
-        // kept alive when the channel wrapper is.
         descriptor->SetCallHandler(USE_CALLBACK(MessageChannelConstructor));
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kMessageChannelInternalFieldCount);
-        break;
-    }
-
-    case V8ClassIndex::MESSAGEPORT: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kMessagePortInternalFieldCount);
-        break;
-    }
-
-#if ENABLE(NOTIFICATIONS)
-    case V8ClassIndex::NOTIFICATION: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kNotificationInternalFieldCount);
-        break;
-    }
-#endif // NOTIFICATIONS
-
-#if ENABLE(SVG)
-    case V8ClassIndex::SVGELEMENTINSTANCE: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kSVGElementInstanceInternalFieldCount);
         break;
     }
-#endif
 
 #if ENABLE(WORKERS)
-    case V8ClassIndex::ABSTRACTWORKER: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kAbstractWorkerInternalFieldCount);
-        break;
-    }
-
-    case V8ClassIndex::DEDICATEDWORKERCONTEXT: {
-        // Reserve internal fields for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kDefaultWrapperInternalFieldCount);
-        instanceTemplate->SetInternalFieldCount(V8Custom::kDedicatedWorkerContextInternalFieldCount);
-        break;
-    }
-
     case V8ClassIndex::WORKER: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kWorkerInternalFieldCount);
         descriptor->SetCallHandler(USE_CALLBACK(WorkerConstructor));
         break;
     }
-
-    case V8ClassIndex::WORKERCONTEXT: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kDefaultWrapperInternalFieldCount);
-        instanceTemplate->SetInternalFieldCount(V8Custom::kWorkerContextMinimumInternalFieldCount);
-        break;
-    }
-
 #endif // WORKERS
 
 #if ENABLE(SHARED_WORKERS)
     case V8ClassIndex::SHAREDWORKER: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kSharedWorkerInternalFieldCount);
         descriptor->SetCallHandler(USE_CALLBACK(SharedWorkerConstructor));
         break;
     }
-
-    case V8ClassIndex::SHAREDWORKERCONTEXT: {
-        // Reserve internal fields for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kDefaultWrapperInternalFieldCount);
-        instanceTemplate->SetInternalFieldCount(V8Custom::kSharedWorkerContextInternalFieldCount);
-        break;
-    }
 #endif // SHARED_WORKERS
 
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-    case V8ClassIndex::DOMAPPLICATIONCACHE: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kDOMApplicationCacheFieldCount);
-        break;
-    }
-#endif
-
 #if ENABLE(3D_CANVAS)
     // The following objects are created from JavaScript.
     case V8ClassIndex::WEBGLARRAYBUFFER:
@@ -492,9 +374,6 @@ v8::Persistent<v8::FunctionTemplate> V8DOMWrapper::getTemplate(V8ClassIndex::V8W
         break;
 #if ENABLE(WEB_SOCKETS)
     case V8ClassIndex::WEBSOCKET: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kWebSocketInternalFieldCount);
         descriptor->SetCallHandler(USE_CALLBACK(WebSocketConstructor));
         break;
     }
@@ -503,18 +382,9 @@ v8::Persistent<v8::FunctionTemplate> V8DOMWrapper::getTemplate(V8ClassIndex::V8W
         descriptor->SetCallHandler(USE_CALLBACK(XMLSerializerConstructor));
         break;
     case V8ClassIndex::XMLHTTPREQUEST: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kXMLHttpRequestInternalFieldCount);
         descriptor->SetCallHandler(USE_CALLBACK(XMLHttpRequestConstructor));
         break;
     }
-    case V8ClassIndex::XMLHTTPREQUESTUPLOAD: {
-        // Reserve one more internal field for keeping event listeners.
-        v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
-        instanceTemplate->SetInternalFieldCount(V8Custom::kXMLHttpRequestInternalFieldCount);
-        break;
-    }
     case V8ClassIndex::XPATHEVALUATOR:
         descriptor->SetCallHandler(USE_CALLBACK(XPathEvaluatorConstructor));
         break;
@@ -719,44 +589,44 @@ v8::Handle<v8::Value> V8DOMWrapper::convertToV8Object(V8ClassIndex::V8WrapperTyp
             // reused by a new page.
             switch (type) {
             case V8ClassIndex::CONSOLE:
-                setHiddenWindowReference(static_cast<Console*>(impl)->frame(), V8Custom::kDOMWindowConsoleIndex, result);
+                setHiddenWindowReference(static_cast<Console*>(impl)->frame(), V8DOMWindow::consoleIndex, result);
                 break;
             case V8ClassIndex::HISTORY:
-                setHiddenWindowReference(static_cast<History*>(impl)->frame(), V8Custom::kDOMWindowHistoryIndex, result);
+                setHiddenWindowReference(static_cast<History*>(impl)->frame(), V8DOMWindow::historyIndex, result);
                 break;
             case V8ClassIndex::NAVIGATOR:
-                setHiddenWindowReference(static_cast<Navigator*>(impl)->frame(), V8Custom::kDOMWindowNavigatorIndex, result);
+                setHiddenWindowReference(static_cast<Navigator*>(impl)->frame(), V8DOMWindow::navigatorIndex, result);
                 break;
             case V8ClassIndex::SCREEN:
-                setHiddenWindowReference(static_cast<Screen*>(impl)->frame(), V8Custom::kDOMWindowScreenIndex, result);
+                setHiddenWindowReference(static_cast<Screen*>(impl)->frame(), V8DOMWindow::screenIndex, result);
                 break;
             case V8ClassIndex::LOCATION:
-                setHiddenWindowReference(static_cast<Location*>(impl)->frame(), V8Custom::kDOMWindowLocationIndex, result);
+                setHiddenWindowReference(static_cast<Location*>(impl)->frame(), V8DOMWindow::locationIndex, result);
                 break;
             case V8ClassIndex::DOMSELECTION:
-                setHiddenWindowReference(static_cast<DOMSelection*>(impl)->frame(), V8Custom::kDOMWindowDOMSelectionIndex, result);
+                setHiddenWindowReference(static_cast<DOMSelection*>(impl)->frame(), V8DOMWindow::domSelectionIndex, result);
                 break;
             case V8ClassIndex::BARINFO: {
                 BarInfo* barInfo = static_cast<BarInfo*>(impl);
                 Frame* frame = barInfo->frame();
                 switch (barInfo->type()) {
                 case BarInfo::Locationbar:
-                    setHiddenWindowReference(frame, V8Custom::kDOMWindowLocationbarIndex, result);
+                    setHiddenWindowReference(frame, V8DOMWindow::locationbarIndex, result);
                     break;
                 case BarInfo::Menubar:
-                    setHiddenWindowReference(frame, V8Custom::kDOMWindowMenubarIndex, result);
+                    setHiddenWindowReference(frame, V8DOMWindow::menubarIndex, result);
                     break;
                 case BarInfo::Personalbar:
-                    setHiddenWindowReference(frame, V8Custom::kDOMWindowPersonalbarIndex, result);
+                    setHiddenWindowReference(frame, V8DOMWindow::personalbarIndex, result);
                     break;
                 case BarInfo::Scrollbars:
-                    setHiddenWindowReference(frame, V8Custom::kDOMWindowScrollbarsIndex, result);
+                    setHiddenWindowReference(frame, V8DOMWindow::scrollbarsIndex, result);
                     break;
                 case BarInfo::Statusbar:
-                    setHiddenWindowReference(frame, V8Custom::kDOMWindowStatusbarIndex, result);
+                    setHiddenWindowReference(frame, V8DOMWindow::statusbarIndex, result);
                     break;
                 case BarInfo::Toolbar:
-                    setHiddenWindowReference(frame, V8Custom::kDOMWindowToolbarIndex, result);
+                    setHiddenWindowReference(frame, V8DOMWindow::toolbarIndex, result);
                     break;
                 }
                 break;
@@ -778,7 +648,7 @@ void V8DOMWrapper::setHiddenWindowReference(Frame* frame, const int internalInde
     if (context.IsEmpty())
         return;
 
-    ASSERT(internalIndex < V8Custom::kDOMWindowInternalFieldCount);
+    ASSERT(internalIndex < V8DOMWindow::internalFieldCount);
 
     v8::Handle<v8::Object> global = context->Global();
     // Look for real DOM wrapper.
@@ -791,7 +661,7 @@ void V8DOMWrapper::setHiddenWindowReference(Frame* frame, const int internalInde
 V8ClassIndex::V8WrapperType V8DOMWrapper::domWrapperType(v8::Handle<v8::Object> object)
 {
     ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
-    v8::Handle<v8::Value> type = object->GetInternalField(V8Custom::kDOMWrapperTypeIndex);
+    v8::Handle<v8::Value> type = object->GetInternalField(v8DOMWrapperTypeIndex);
     return V8ClassIndex::FromInt(type->Int32Value());
 }
 
@@ -857,13 +727,13 @@ bool V8DOMWrapper::maybeDOMWrapper(v8::Handle<v8::Value> value)
     if (!object->InternalFieldCount())
         return false;
 
-    ASSERT(object->InternalFieldCount() >= V8Custom::kDefaultWrapperInternalFieldCount);
+    ASSERT(object->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount);
 
-    v8::Handle<v8::Value> type = object->GetInternalField(V8Custom::kDOMWrapperTypeIndex);
+    v8::Handle<v8::Value> type = object->GetInternalField(v8DOMWrapperTypeIndex);
     ASSERT(type->IsInt32());
     ASSERT(V8ClassIndex::INVALID_CLASS_INDEX < type->Int32Value() && type->Int32Value() < V8ClassIndex::CLASSINDEX_END);
 
-    v8::Handle<v8::Value> wrapper = object->GetInternalField(V8Custom::kDOMWrapperObjectIndex);
+    v8::Handle<v8::Value> wrapper = object->GetInternalField(v8DOMWrapperObjectIndex);
     ASSERT(wrapper->IsNumber() || wrapper->IsExternal());
 
     return true;
@@ -886,12 +756,12 @@ bool V8DOMWrapper::isWrapperOfType(v8::Handle<v8::Value> value, V8ClassIndex::V8
     if (!object->InternalFieldCount())
         return false;
 
-    ASSERT(object->InternalFieldCount() >= V8Custom::kDefaultWrapperInternalFieldCount);
+    ASSERT(object->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount);
 
-    v8::Handle<v8::Value> wrapper = object->GetInternalField(V8Custom::kDOMWrapperObjectIndex);
+    v8::Handle<v8::Value> wrapper = object->GetInternalField(v8DOMWrapperObjectIndex);
     ASSERT(wrapper->IsNumber() || wrapper->IsExternal());
 
-    v8::Handle<v8::Value> type = object->GetInternalField(V8Custom::kDOMWrapperTypeIndex);
+    v8::Handle<v8::Value> type = object->GetInternalField(v8DOMWrapperTypeIndex);
     ASSERT(type->IsInt32());
     ASSERT(V8ClassIndex::INVALID_CLASS_INDEX < type->Int32Value() && type->Int32Value() < V8ClassIndex::CLASSINDEX_END);
 
@@ -1336,10 +1206,10 @@ v8::Handle<v8::Value> V8DOMWrapper::convertNewNodeToV8Object(Node* node, V8Proxy
             // Create marker object and insert it in two internal fields.
             // This is used to implement temporary shadowing of
             // document.all.
-            ASSERT(result->InternalFieldCount() == V8Custom::kHTMLDocumentInternalFieldCount);
+            ASSERT(result->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
             v8::Local<v8::Object> marker = v8::Object::New();
-            result->SetInternalField(V8Custom::kHTMLDocumentMarkerIndex, marker);
-            result->SetInternalField(V8Custom::kHTMLDocumentShadowIndex, marker);
+            result->SetInternalField(V8HTMLDocument::markerIndex, marker);
+            result->SetInternalField(V8HTMLDocument::shadowIndex, marker);
         }
     }
 
@@ -1537,7 +1407,7 @@ v8::Handle<v8::Value> V8DOMWrapper::convertStyleSheetToV8Object(StyleSheet* shee
     Node* ownerNode = sheet->ownerNode();
     if (ownerNode) {
         v8::Handle<v8::Object> owner = v8::Handle<v8::Object>::Cast(convertNodeToV8Object(ownerNode));
-        result->SetInternalField(V8Custom::kStyleSheetOwnerNodeIndex, owner);
+        result->SetInternalField(V8StyleSheet::ownerNodeIndex, owner);
     }
 
     return result;
@@ -1685,7 +1555,7 @@ v8::Handle<v8::Value> V8DOMWrapper::convertNamedNodeMapToV8Object(NamedNodeMap*
     // Add a hidden reference from named node map to its owner node.
     if (Element* element = map->element()) {
         v8::Handle<v8::Object> owner = v8::Handle<v8::Object>::Cast(convertNodeToV8Object(element));
-        result->SetInternalField(V8Custom::kNamedNodeMapOwnerNodeIndex, owner);
+        result->SetInternalField(V8NamedNodeMap::ownerNodeIndex, owner);
     }
 
     return result;
diff --git a/WebCore/bindings/v8/V8DOMWrapper.h b/WebCore/bindings/v8/V8DOMWrapper.h
index 3a9fed9..606c2de 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.h
+++ b/WebCore/bindings/v8/V8DOMWrapper.h
@@ -112,8 +112,8 @@ namespace WebCore {
         static void setDOMWrapper(v8::Handle<v8::Object> object, int type, void* cptr)
         {
             ASSERT(object->InternalFieldCount() >= 2);
-            object->SetPointerInInternalField(V8Custom::kDOMWrapperObjectIndex, cptr);
-            object->SetInternalField(V8Custom::kDOMWrapperTypeIndex, v8::Integer::New(type));
+            object->SetPointerInInternalField(v8DOMWrapperObjectIndex, cptr);
+            object->SetInternalField(v8DOMWrapperTypeIndex, v8::Integer::New(type));
         }
 
         static v8::Handle<v8::Object> lookupDOMWrapper(V8ClassIndex::V8WrapperType type, v8::Handle<v8::Object> object)
@@ -130,7 +130,7 @@ namespace WebCore {
             v8::HandleScope handleScope;
             ASSERT(maybeDOMWrapper(object));
 #endif
-            return reinterpret_cast<C*>(object->GetPointerFromInternalField(V8Custom::kDOMWrapperObjectIndex));
+            return reinterpret_cast<C*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
         }
 
         template <class C>
diff --git a/WebCore/bindings/v8/V8Index.h b/WebCore/bindings/v8/V8Index.h
index 2c6948b..8cacd7a 100644
--- a/WebCore/bindings/v8/V8Index.h
+++ b/WebCore/bindings/v8/V8Index.h
@@ -32,10 +32,13 @@
 #define V8Index_h
 
 #include <v8.h>
-#include "PlatformString.h"  // for WebCore::String
 
 namespace WebCore {
 
+static const int v8DOMWrapperTypeIndex = 0;
+static const int v8DOMWrapperObjectIndex = 1;
+static const int v8DefaultWrapperInternalFieldCount = 2;
+
 typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)();
 
 #if ENABLE(DATAGRID)
diff --git a/WebCore/bindings/v8/V8IsolatedContext.cpp b/WebCore/bindings/v8/V8IsolatedContext.cpp
index e8a51cb..4db1efe 100644
--- a/WebCore/bindings/v8/V8IsolatedContext.cpp
+++ b/WebCore/bindings/v8/V8IsolatedContext.cpp
@@ -62,7 +62,7 @@ V8IsolatedContext::V8IsolatedContext(V8Proxy* proxy, int extensionGroup)
     // Run code in the new context.
     v8::Context::Scope contextScope(m_context->get());
 
-    getGlobalObject(m_context->get())->SetPointerInInternalField(V8Custom::kDOMWindowEnteredIsolatedWorldIndex, this);
+    getGlobalObject(m_context->get())->SetPointerInInternalField(V8DOMWindow::enteredIsolatedWorldIndex, this);
 
     V8DOMWindowShell::installHiddenObjectPrototype(m_context->get());
     // FIXME: This will go away once we have a windowShell for the isolated world.
diff --git a/WebCore/bindings/v8/V8IsolatedContext.h b/WebCore/bindings/v8/V8IsolatedContext.h
index 4f9a5b8..3844b57 100644
--- a/WebCore/bindings/v8/V8IsolatedContext.h
+++ b/WebCore/bindings/v8/V8IsolatedContext.h
@@ -33,6 +33,7 @@
 
 #include "IsolatedWorld.h"
 #include "ScriptSourceCode.h" // for WebCore::ScriptSourceCode
+#include "V8DOMWindow.h"
 #include "V8Index.h"
 #include "V8Proxy.h"
 #include "V8Utilities.h"
@@ -85,7 +86,7 @@ public:
             return 0;
         if (!v8::Context::InContext())
             return 0;
-        return reinterpret_cast<V8IsolatedContext*>(getGlobalObject(v8::Context::GetEntered())->GetPointerFromInternalField(V8Custom::kDOMWindowEnteredIsolatedWorldIndex));
+        return reinterpret_cast<V8IsolatedContext*>(getGlobalObject(v8::Context::GetEntered())->GetPointerFromInternalField(V8DOMWindow::enteredIsolatedWorldIndex));
     }
 
     v8::Handle<v8::Context> context() { return m_context->get(); }
diff --git a/WebCore/bindings/v8/V8NPObject.cpp b/WebCore/bindings/v8/V8NPObject.cpp
index bab3688..539f5b5 100644
--- a/WebCore/bindings/v8/V8NPObject.cpp
+++ b/WebCore/bindings/v8/V8NPObject.cpp
@@ -74,7 +74,7 @@ static v8::Handle<v8::Value> npObjectInvokeImpl(const v8::Arguments& args, Invok
     } else {
         // The holder object is not a subtype of HTMLPlugInElement, it must be an NPObject which has three
         // internal fields.
-        if (args.Holder()->InternalFieldCount() != V8Custom::kNPObjectInternalFieldCount)
+        if (args.Holder()->InternalFieldCount() != npObjectInternalFieldCount)
           return throwError("NPMethod called on non-NPObject", V8Proxy::ReferenceError);
 
         npObject = V8DOMWrapper::convertToNativeObject<NPObject>(V8ClassIndex::NPOBJECT, args.Holder());
@@ -357,7 +357,7 @@ v8::Local<v8::Object> createV8ObjectForNPObject(NPObject* object, NPObject* root
     // can be used by DOM bindings.
     if (npObjectDesc.IsEmpty()) {
         npObjectDesc = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New());
-        npObjectDesc->InstanceTemplate()->SetInternalFieldCount(V8Custom::kNPObjectInternalFieldCount);
+        npObjectDesc->InstanceTemplate()->SetInternalFieldCount(npObjectInternalFieldCount);
         npObjectDesc->InstanceTemplate()->SetNamedPropertyHandler(npObjectNamedPropertyGetter, npObjectNamedPropertySetter, 0, 0, npObjectNamedPropertyEnumerator);
         npObjectDesc->InstanceTemplate()->SetIndexedPropertyHandler(npObjectIndexedPropertyGetter, npObjectIndexedPropertySetter, 0, 0, npObjectIndexedPropertyEnumerator);
         npObjectDesc->InstanceTemplate()->SetCallAsFunctionHandler(npObjectInvokeDefaultHandler);
diff --git a/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp b/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp
index 0fd9e6d..ca9bb65 100644
--- a/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp
@@ -55,7 +55,7 @@ v8::Handle<v8::Value> V8AbstractWorker::addEventListenerCallback(const v8::Argum
         bool useCapture = args[2]->BooleanValue();
         worker->addEventListener(type, listener, useCapture);
 
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kAbstractWorkerRequestCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
     return v8::Undefined();
 }
@@ -71,7 +71,7 @@ v8::Handle<v8::Value> V8AbstractWorker::removeEventListenerCallback(const v8::Ar
         bool useCapture = args[2]->BooleanValue();
         worker->removeEventListener(type, listener.get(), useCapture);
 
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kAbstractWorkerRequestCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
index bb685c6..82ff825 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.h
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.h
@@ -37,97 +37,6 @@
 namespace WebCore {
     class V8Custom {
     public:
-        // Constants.
-        static const int kDOMWrapperTypeIndex = 0;
-        static const int kDOMWrapperObjectIndex = 1;
-        static const int kDefaultWrapperInternalFieldCount = 2;
-
-        static const int kNPObjectInternalFieldCount = kDefaultWrapperInternalFieldCount + 0;
-
-        static const int kNodeEventListenerCacheIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kNodeMinimumInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-
-        static const int kDocumentImplementationIndex = kNodeMinimumInternalFieldCount + 0;
-        static const int kDocumentMinimumInternalFieldCount = kNodeMinimumInternalFieldCount + 1;
-
-        static const int kHTMLDocumentMarkerIndex = kDocumentMinimumInternalFieldCount + 0;
-        static const int kHTMLDocumentShadowIndex = kDocumentMinimumInternalFieldCount + 1;
-        static const int kHTMLDocumentInternalFieldCount = kDocumentMinimumInternalFieldCount + 2;
-
-        static const int kXMLHttpRequestCacheIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kXMLHttpRequestInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-
-        static const int kMessageChannelPort1Index = kDefaultWrapperInternalFieldCount + 0;
-        static const int kMessageChannelPort2Index = kDefaultWrapperInternalFieldCount + 1;
-        static const int kMessageChannelInternalFieldCount = kDefaultWrapperInternalFieldCount + 2;
-
-        static const int kMessagePortRequestCacheIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kMessagePortInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-
-#if ENABLE(WORKERS)
-        static const int kAbstractWorkerRequestCacheIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kAbstractWorkerInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-
-        static const int kWorkerRequestCacheIndex = kAbstractWorkerInternalFieldCount + 0;
-        static const int kWorkerInternalFieldCount = kAbstractWorkerInternalFieldCount + 1;
-
-        static const int kWorkerContextRequestCacheIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kWorkerContextMinimumInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-
-        static const int kDedicatedWorkerContextRequestCacheIndex = kWorkerContextMinimumInternalFieldCount + 0;
-        static const int kDedicatedWorkerContextInternalFieldCount = kWorkerContextMinimumInternalFieldCount + 1;
-#endif
-
-#if ENABLE(SHARED_WORKERS)
-        static const int kSharedWorkerRequestCacheIndex = kAbstractWorkerInternalFieldCount + 0;
-        static const int kSharedWorkerInternalFieldCount = kAbstractWorkerInternalFieldCount + 1;
-
-        static const int kSharedWorkerContextRequestCacheIndex = kWorkerContextMinimumInternalFieldCount + 0;
-        static const int kSharedWorkerContextInternalFieldCount = kWorkerContextMinimumInternalFieldCount + 1;
-#endif
-
-#if ENABLE(NOTIFICATIONS)
-        static const int kNotificationRequestCacheIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kNotificationInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-#endif
-
-#if ENABLE(SVG)
-        static const int kSVGElementInstanceEventListenerCacheIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kSVGElementInstanceInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-#endif
-
-        static const int kDOMWindowConsoleIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kDOMWindowHistoryIndex = kDefaultWrapperInternalFieldCount + 1;
-        static const int kDOMWindowLocationbarIndex = kDefaultWrapperInternalFieldCount + 2;
-        static const int kDOMWindowMenubarIndex = kDefaultWrapperInternalFieldCount + 3;
-        static const int kDOMWindowNavigatorIndex = kDefaultWrapperInternalFieldCount + 4;
-        static const int kDOMWindowPersonalbarIndex = kDefaultWrapperInternalFieldCount + 5;
-        static const int kDOMWindowScreenIndex = kDefaultWrapperInternalFieldCount + 6;
-        static const int kDOMWindowScrollbarsIndex = kDefaultWrapperInternalFieldCount + 7;
-        static const int kDOMWindowSelectionIndex = kDefaultWrapperInternalFieldCount + 8;
-        static const int kDOMWindowStatusbarIndex = kDefaultWrapperInternalFieldCount + 9;
-        static const int kDOMWindowToolbarIndex = kDefaultWrapperInternalFieldCount + 10;
-        static const int kDOMWindowLocationIndex = kDefaultWrapperInternalFieldCount + 11;
-        static const int kDOMWindowDOMSelectionIndex = kDefaultWrapperInternalFieldCount + 12;
-        static const int kDOMWindowEventListenerCacheIndex = kDefaultWrapperInternalFieldCount + 13;
-        static const int kDOMWindowEnteredIsolatedWorldIndex = kDefaultWrapperInternalFieldCount + 14;
-        static const int kDOMWindowInternalFieldCount = kDefaultWrapperInternalFieldCount + 15;
-
-        static const int kStyleSheetOwnerNodeIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kStyleSheetInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-        static const int kNamedNodeMapOwnerNodeIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kNamedNodeMapInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-        static const int kDOMApplicationCacheCacheIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kDOMApplicationCacheFieldCount = kDefaultWrapperInternalFieldCount + 1;
-#endif
-
-#if ENABLE(WEB_SOCKETS)
-        static const int kWebSocketCacheIndex = kDefaultWrapperInternalFieldCount + 0;
-        static const int kWebSocketInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
-#endif
-
 #define DECLARE_CALLBACK(NAME) static v8::Handle<v8::Value> v8##NAME##Callback(const v8::Arguments& args)
 #define USE_CALLBACK(NAME) V8Custom::v8##NAME##Callback
 
@@ -168,7 +77,6 @@ namespace WebCore {
 
 #undef DECLARE_CALLBACK
     };
-
 } // namespace WebCore
 
 #endif // V8CustomBinding_h
diff --git a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp b/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
index 1976975..2316526 100644
--- a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
@@ -52,7 +52,7 @@ v8::Handle<v8::Value> V8DOMApplicationCache::addEventListenerCallback(const v8::
 
     RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(appcache, args[1], false, ListenerFindOrCreate);
     if (listener) {
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kDOMApplicationCacheCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
         String eventType = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
         appcache->addEventListener(eventType, listener, useCapture);
@@ -68,7 +68,7 @@ v8::Handle<v8::Value> V8DOMApplicationCache::removeEventListenerCallback(const v
 
     RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(appcache, args[1], false, ListenerFindOnly);
     if (listener) {
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kDOMApplicationCacheCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
         String eventType = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
         appcache->removeEventListener(eventType, listener.get(), useCapture);
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 9b7ef51..aa5b6a6 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -363,7 +363,7 @@ v8::Handle<v8::Value> V8DOMWindow::addEventListenerCallback(const v8::Arguments&
 
     if (listener) {
         imp->addEventListener(eventType, listener, useCapture);
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kDOMWindowEventListenerCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
@@ -395,7 +395,7 @@ v8::Handle<v8::Value> V8DOMWindow::removeEventListenerCallback(const v8::Argumen
 
     if (listener) {
         imp->removeEventListener(eventType, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kDOMWindowEventListenerCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
diff --git a/WebCore/bindings/v8/custom/V8DocumentCustom.cpp b/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
index bee5709..f7e5966 100644
--- a/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
@@ -115,10 +115,10 @@ v8::Handle<v8::Value> V8Document::getCSSCanvasContextCallback(const v8::Argument
 // for the lifetime of the wrapper.
 v8::Handle<v8::Value> V8Document::implementationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
-    ASSERT(info.Holder()->InternalFieldCount() >= V8Custom::kDocumentMinimumInternalFieldCount);
+    ASSERT(info.Holder()->InternalFieldCount() >= internalFieldCount);
 
     // Check if the internal field already contains a wrapper.
-    v8::Local<v8::Value> implementation = info.Holder()->GetInternalField(V8Custom::kDocumentImplementationIndex);
+    v8::Local<v8::Value> implementation = info.Holder()->GetInternalField(V8Document::implementationIndex);
     if (!implementation->IsUndefined())
         return implementation;
 
@@ -127,7 +127,7 @@ v8::Handle<v8::Value> V8Document::implementationAccessorGetter(v8::Local<v8::Str
     v8::Handle<v8::Value> wrapper = V8DOMWrapper::convertDOMImplementationToV8Object(document->implementation());
 
     // Store the wrapper in the internal field.
-    info.Holder()->SetInternalField(V8Custom::kDocumentImplementationIndex, wrapper);
+    info.Holder()->SetInternalField(implementationIndex, wrapper);
 
     return wrapper;
 }
diff --git a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
index 902fbb6..e634003 100644
--- a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
@@ -35,8 +35,8 @@
 #include "Document.h"
 #include "Frame.h"
 #include "HTMLNames.h"
-
 #include "V8Binding.h"
+#include "V8HTMLAudioElement.h"
 #include "V8Proxy.h"
 
 #include <wtf/RefPtr.h>
@@ -53,7 +53,7 @@ v8::Persistent<v8::FunctionTemplate> V8HTMLAudioElementConstructor::GetTemplate(
     v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(USE_CALLBACK(HTMLAudioElementConstructor));
 
     v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
-    instance->SetInternalFieldCount(V8Custom::kNodeMinimumInternalFieldCount);
+    instance->SetInternalFieldCount(V8HTMLAudioElement::internalFieldCount);
     result->SetClassName(v8::String::New("HTMLAudioElement"));
     result->Inherit(V8DOMWrapper::getTemplate(V8ClassIndex::HTMLAUDIOELEMENT));
 
diff --git a/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
index ea59ad7..cee145d 100644
--- a/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
@@ -37,11 +37,8 @@
 #include "HTMLCollection.h"
 #include "HTMLIFrameElement.h"
 #include "HTMLNames.h"
-
 #include "V8Binding.h"
-#include "V8CustomBinding.h"
 #include "V8Proxy.h"
-
 #include <wtf/RefPtr.h>
 #include <wtf/StdLibExtras.h>
 
@@ -57,9 +54,9 @@ v8::Handle<v8::Boolean> V8HTMLDocument::namedPropertyDeleter(v8::Local<v8::Strin
     if (key != all)
         return deletionNotHandledByInterceptor();
 
-    ASSERT(info.Holder()->InternalFieldCount() == V8Custom::kHTMLDocumentInternalFieldCount);
-    v8::Local<v8::Value> marker = info.Holder()->GetInternalField(V8Custom::kHTMLDocumentMarkerIndex);
-    info.Holder()->SetInternalField(V8Custom::kHTMLDocumentShadowIndex, marker);
+    ASSERT(info.Holder()->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
+    v8::Local<v8::Value> marker = info.Holder()->GetInternalField(V8HTMLDocument::markerIndex);
+    info.Holder()->SetInternalField(V8HTMLDocument::shadowIndex, marker);
     return v8::True();
 }
 
@@ -73,9 +70,9 @@ v8::Handle<v8::Value> V8HTMLDocument::namedPropertyGetter(v8::Local<v8::String>
     // been temporarily shadowed and we return the value.
     DEFINE_STATIC_LOCAL(const AtomicString, all, ("all"));
     if (key == all) {
-        ASSERT(info.Holder()->InternalFieldCount() == V8Custom::kHTMLDocumentInternalFieldCount);
-        v8::Local<v8::Value> marker = info.Holder()->GetInternalField(V8Custom::kHTMLDocumentMarkerIndex);
-        v8::Local<v8::Value> value = info.Holder()->GetInternalField(V8Custom::kHTMLDocumentShadowIndex);
+        ASSERT(info.Holder()->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
+        v8::Local<v8::Value> marker = info.Holder()->GetInternalField(V8HTMLDocument::markerIndex);
+        v8::Local<v8::Value> value = info.Holder()->GetInternalField(V8HTMLDocument::shadowIndex);
         if (marker != value)
             return value;
     }
@@ -187,8 +184,8 @@ void V8HTMLDocument::allAccessorSetter(v8::Local<v8::String> name, v8::Local<v8:
 {
     INC_STATS("DOM.HTMLDocument.all._set");
     v8::Handle<v8::Object> holder = info.Holder();
-    ASSERT(info.Holder()->InternalFieldCount() == V8Custom::kHTMLDocumentInternalFieldCount);
-    info.Holder()->SetInternalField(V8Custom::kHTMLDocumentShadowIndex, value);
+    ASSERT(info.Holder()->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
+    info.Holder()->SetInternalField(V8HTMLDocument::shadowIndex, value);
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
index 6676821..57efa34 100644
--- a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
@@ -35,8 +35,8 @@
 #include "Document.h"
 #include "Frame.h"
 #include "HTMLNames.h"
-
 #include "V8Binding.h"
+#include "V8HTMLImageElement.h"
 #include "V8Proxy.h"
 
 #include <wtf/RefPtr.h>
@@ -53,7 +53,7 @@ v8::Persistent<v8::FunctionTemplate> V8HTMLImageElementConstructor::GetTemplate(
     v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(USE_CALLBACK(HTMLImageElementConstructor));
 
     v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
-    instance->SetInternalFieldCount(V8Custom::kNodeMinimumInternalFieldCount);
+    instance->SetInternalFieldCount(V8HTMLImageElement::internalFieldCount);
     result->SetClassName(v8::String::New("HTMLImageElement"));
     result->Inherit(V8DOMWrapper::getTemplate(V8ClassIndex::HTMLIMAGEELEMENT));
 
diff --git a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
index 9fff6b7..5325933 100644
--- a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
@@ -36,8 +36,8 @@
 #include "Frame.h"
 #include "HTMLNames.h"
 #include "Text.h"
-
 #include "V8Binding.h"
+#include "V8HTMLOptionElement.h"
 #include "V8Proxy.h"
 
 #include <wtf/RefPtr.h>
@@ -54,7 +54,7 @@ v8::Persistent<v8::FunctionTemplate> V8HTMLOptionElementConstructor::GetTemplate
     v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(USE_CALLBACK(HTMLOptionElementConstructor));
 
     v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
-    instance->SetInternalFieldCount(V8Custom::kNodeMinimumInternalFieldCount);
+    instance->SetInternalFieldCount(V8HTMLOptionElement::internalFieldCount);
     result->SetClassName(v8::String::New("HTMLOptionElement"));
     result->Inherit(V8DOMWrapper::getTemplate(V8ClassIndex::HTMLOPTIONELEMENT));
 
diff --git a/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp b/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
index fe7351c..7a3ed4b 100644
--- a/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
@@ -29,13 +29,13 @@
  */
 
 #include "config.h"
-#include "MessageChannel.h"
-
-#include "V8Binding.h"
-#include "V8Proxy.h"
+#include "V8MessageChannel.h"
 
 #include "Document.h"
 #include "Frame.h"
+#include "MessageChannel.h"
+#include "V8Binding.h"
+#include "V8Proxy.h"
 #include "V8Utilities.h"
 #include "WorkerContext.h"
 #include "WorkerContextExecutionProxy.h"
@@ -66,8 +66,8 @@ v8::Handle<v8::Value> V8Custom::v8MessageChannelConstructorCallback(const v8::Ar
     // Create references from the MessageChannel wrapper to the two
     // MessagePort wrappers to make sure that the MessagePort wrappers
     // stay alive as long as the MessageChannel wrapper is around.
-    messageChannel->SetInternalField(kMessageChannelPort1Index, V8DOMWrapper::convertToV8Object(V8ClassIndex::MESSAGEPORT, obj->port1()));
-    messageChannel->SetInternalField(kMessageChannelPort2Index, V8DOMWrapper::convertToV8Object(V8ClassIndex::MESSAGEPORT, obj->port2()));
+    messageChannel->SetInternalField(V8MessageChannel::port1Index, V8DOMWrapper::convertToV8Object(V8ClassIndex::MESSAGEPORT, obj->port1()));
+    messageChannel->SetInternalField(V8MessageChannel::port2Index, V8DOMWrapper::convertToV8Object(V8ClassIndex::MESSAGEPORT, obj->port2()));
 
     // Setup the standard wrapper object internal fields.
     V8DOMWrapper::setDOMWrapper(messageChannel, V8ClassIndex::MESSAGECHANNEL, obj.get());
diff --git a/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp b/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
index 7879fb8..01be661 100644
--- a/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
@@ -53,7 +53,7 @@ v8::Handle<v8::Value> V8MessagePort::addEventListenerCallback(const v8::Argument
         bool useCapture = args[2]->BooleanValue();
         messagePort->addEventListener(type, listener, useCapture);
 
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kMessagePortRequestCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
     return v8::Undefined();
 }
@@ -68,7 +68,7 @@ v8::Handle<v8::Value> V8MessagePort::removeEventListenerCallback(const v8::Argum
         bool useCapture = args[2]->BooleanValue();
         messagePort->removeEventListener(type, listener.get(), useCapture);
 
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kMessagePortRequestCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
diff --git a/WebCore/bindings/v8/custom/V8NodeCustom.cpp b/WebCore/bindings/v8/custom/V8NodeCustom.cpp
index 03b2c32..52f6fc0 100644
--- a/WebCore/bindings/v8/custom/V8NodeCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NodeCustom.cpp
@@ -55,7 +55,7 @@ v8::Handle<v8::Value> V8Node::addEventListenerCallback(const v8::Arguments& args
         String type = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
         node->addEventListener(type, listener, useCapture);
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kNodeEventListenerCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
     return v8::Undefined();
 }
@@ -73,7 +73,7 @@ v8::Handle<v8::Value> V8Node::removeEventListenerCallback(const v8::Arguments& a
         AtomicString type = v8ValueToAtomicWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
         node->removeEventListener(type, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kNodeEventListenerCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
diff --git a/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp b/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
index e901395..5e464ea 100644
--- a/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
@@ -58,7 +58,7 @@ v8::Handle<v8::Value> V8Notification::addEventListenerCallback(const v8::Argumen
         String type = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
         notification->addEventListener(type, listener, useCapture);
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kNotificationRequestCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
@@ -74,7 +74,7 @@ v8::Handle<v8::Value> V8Notification::removeEventListenerCallback(const v8::Argu
         String type = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
         notification->removeEventListener(type, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kNotificationRequestCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
diff --git a/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp b/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp
index e3c5ddc..b1df0df 100644
--- a/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp
@@ -54,7 +54,7 @@ v8::Handle<v8::Value> V8SVGElementInstance::addEventListenerCallback(const v8::A
         String type = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
         instance->addEventListener(type, listener, useCapture);
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kNodeEventListenerCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
@@ -70,7 +70,7 @@ v8::Handle<v8::Value> V8SVGElementInstance::removeEventListenerCallback(const v8
         String type = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
         instance->removeEventListener(type, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kNodeEventListenerCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
diff --git a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
index 855ab7d..1d9e991 100644
--- a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
@@ -56,7 +56,7 @@ v8::Handle<v8::Value> V8WebSocket::addEventListenerCallback(const v8::Arguments&
         bool useCapture = args[2]->BooleanValue();
         webSocket->addEventListener(type, listener, useCapture);
 
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kWebSocketCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
     return v8::Undefined();
 }
@@ -71,7 +71,7 @@ v8::Handle<v8::Value> V8WebSocket::removeEventListenerCallback(const v8::Argumen
         String type = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
         webSocket->removeEventListener(type, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kWebSocketCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
     return v8::Undefined();
 }
diff --git a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
index ed54a1d..09affb4 100644
--- a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
@@ -153,7 +153,7 @@ v8::Handle<v8::Value> V8WorkerContext::addEventListenerCallback(const v8::Argume
         bool useCapture = args[2]->BooleanValue();
         workerContext->addEventListener(type, listener, useCapture);
 
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kWorkerContextRequestCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
     return v8::Undefined();
 }
@@ -169,7 +169,7 @@ v8::Handle<v8::Value> V8WorkerContext::removeEventListenerCallback(const v8::Arg
         bool useCapture = args[2]->BooleanValue();
         workerContext->removeEventListener(type, listener.get(), useCapture);
 
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kWorkerContextRequestCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
     return v8::Undefined();
 }
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index a75e261..9cc44cd 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -63,7 +63,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::addEventListenerCallback(const v8::Argum
         bool useCapture = args[2]->BooleanValue();
         xmlHttpRequest->addEventListener(type, listener, useCapture);
 
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kXMLHttpRequestCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
     return v8::Undefined();
 }
@@ -79,7 +79,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::removeEventListenerCallback(const v8::Ar
         bool useCapture = args[2]->BooleanValue();
         xmlHttpRequest->removeEventListener(type, listener.get(), useCapture);
 
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kXMLHttpRequestCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp
index 2d00729..08a4426 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp
@@ -56,7 +56,7 @@ v8::Handle<v8::Value> V8XMLHttpRequestUpload::addEventListenerCallback(const v8:
         bool useCapture = args[2]->BooleanValue();
         xmlHttpRequestUpload->addEventListener(type, listener, useCapture);
 
-        createHiddenDependency(args.Holder(), args[1], V8Custom::kXMLHttpRequestCacheIndex);
+        createHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
     return v8::Undefined();
 }
@@ -74,7 +74,7 @@ v8::Handle<v8::Value> V8XMLHttpRequestUpload::removeEventListenerCallback(const
         bool useCapture = args[2]->BooleanValue();
         xmlHttpRequestUpload->removeEventListener(type, listener.get(), useCapture);
 
-        removeHiddenDependency(args.Holder(), args[1], V8Custom::kXMLHttpRequestCacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
     }
 
     return v8::Undefined();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list