[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 00:53:38 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 9819adce577472924961a767196be27177b58a07
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 4 18:46:47 2010 +0000

    2010-01-04  Nate Chapin  <japhet at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Generate declarations for V8 runtime enablers.
    
            https://bugs.webkit.org/show_bug.cgi?id=33156
    
            * bindings/scripts/CodeGeneratorV8.pm: Generate runtime enabler declarations.
            * bindings/v8/custom/V8CustomBinding.h: Remove manual declarations of runtime enablers.
            * bindings/v8/custom/V8DOMWindowCustom.cpp:
            * bindings/v8/custom/V8WebSocketCustom.cpp: Remove closeCallback(), which isn't actually being used.
            * bindings/v8/custom/V8WorkerContextCustom.cpp:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52747 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 17ee815..7e275fd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-04  Nate Chapin  <japhet at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Generate declarations for V8 runtime enablers.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33156
+
+        * bindings/scripts/CodeGeneratorV8.pm: Generate runtime enabler declarations.
+        * bindings/v8/custom/V8CustomBinding.h: Remove manual declarations of runtime enablers.
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        * bindings/v8/custom/V8WebSocketCustom.cpp: Remove closeCallback(), which isn't actually being used.
+        * bindings/v8/custom/V8WorkerContextCustom.cpp:
+
 2010-01-04  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Not reviewed. Forgot to add SVGMarkerData.h / SVGMarkerLayoutInfo.(cpp,h) to Chromium build.
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 7e49843..b999aa6 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -282,11 +282,17 @@ END
 END
     }
 
+    my @enabledAtRuntime;
     foreach my $function (@{$dataNode->functions}) {
         my $name = $function->signature->name;
+        my $attrExt = $function->signature->extendedAttributes;
+
         push(@headerContent, <<END);
   static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments&);
 END
+        if ($attrExt->{"EnabledAtRuntime"}) {
+            push(@enabledAtRuntime, $function);
+        }
     }
     
     foreach my $attribute (@{$dataNode->attributes}) {
@@ -304,8 +310,12 @@ END
   static void ${name}AccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
 END
         }
+        if ($attrExt->{"EnabledAtRuntime"}) {
+            push(@enabledAtRuntime, $attribute);
+        }
     }
 
+    GenerateHeaderRuntimeEnablerDeclarations(@enabledAtRuntime);
     GenerateHeaderCustomCall($dataNode);
 
     push(@headerContent, <<END);
@@ -324,6 +334,25 @@ END
     push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString;
 }
 
+sub GenerateHeaderRuntimeEnablerDeclarations
+{
+    my @enabledAtRuntime = @_;
+    
+    foreach my $runtime_attr (@enabledAtRuntime) {
+        my $enabledAtRuntimeConditionalString = GenerateConditionalString($runtime_attr->signature);
+        my $enabler = $codeGenerator->WK_ucfirst($runtime_attr->signature->name);
+        if ($enabledAtRuntimeConditionalString) {
+            push(@headerContent, "\n#if ${enabledAtRuntimeConditionalString}\n");
+        }
+        push(@headerContent, <<END);
+  static bool ${enabler}Enabled();
+END
+        if ($enabledAtRuntimeConditionalString) {
+            push(@headerContent, "#endif\n");
+        }
+    }
+}
+
 sub GenerateHeaderCustomCall
 {
     my $dataNode = shift;
@@ -1610,10 +1639,10 @@ END
     
     # Setup the enable-at-runtime attrs if we have them
     foreach my $runtime_attr (@enabledAtRuntime) {
-        $enable_function = $interfaceName . $codeGenerator->WK_ucfirst($runtime_attr->signature->name);
+        $enable_function = $interfaceName . "::" . $codeGenerator->WK_ucfirst($runtime_attr->signature->name);
         my $conditionalString = GenerateConditionalString($runtime_attr->signature);
         push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString;
-        push(@implContent, "    if (V8Custom::v8${enable_function}Enabled()) {\n");
+        push(@implContent, "    if (V8${enable_function}Enabled()) {\n");
         push(@implContent, "        static const BatchedAttribute attrData =\\\n");
         GenerateSingleBatchedAttribute($interfaceName, $runtime_attr, ";", "    ");
         push(@implContent, <<END);
@@ -1653,8 +1682,8 @@ END
         my $conditional = "";
         if ($attrExt->{"EnabledAtRuntime"}) {
             # Only call Set()/SetAccessor() if this method should be enabled
-            $enable_function = $interfaceName . $codeGenerator->WK_ucfirst($function->signature->name);
-            $conditional = "if (V8Custom::v8${enable_function}Enabled())\n";
+            $enable_function = $interfaceName . "::" . $codeGenerator->WK_ucfirst($function->signature->name);
+            $conditional = "if (V8${enable_function}Enabled())\n";
         }
 
         if ($attrExt->{"DoNotCheckDomainSecurity"} &&
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
index e375eb6..4461d6a 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.h
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.h
@@ -68,8 +68,6 @@ struct NPObject;
     bool V8Custom::v8##NAME##IndexedSecurityCheck(v8::Local<v8::Object> host, \
         uint32_t index, v8::AccessType type, v8::Local<v8::Value> data)
 
-#define ACCESSOR_RUNTIME_ENABLER(NAME) bool V8Custom::v8##NAME##Enabled()
-
 namespace WebCore {
 
     class DOMWindow;
@@ -224,16 +222,6 @@ namespace WebCore {
     static bool v8##NAME##IndexedSecurityCheck(v8::Local<v8::Object> host, \
         uint32_t index, v8::AccessType type, v8::Local<v8::Value> data)
 
-#define DECLARE_ACCESSOR_RUNTIME_ENABLER(NAME) static bool v8##NAME##Enabled()
-
-#if ENABLE(VIDEO)
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowAudio);
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowHTMLMediaElement);
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowHTMLAudioElement);
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowHTMLVideoElement);
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowMediaError);
-#endif
-
         DECLARE_NAMED_ACCESS_CHECK(Location);
         DECLARE_INDEXED_ACCESS_CHECK(History);
 
@@ -328,13 +316,7 @@ namespace WebCore {
         DECLARE_NAMED_PROPERTY_GETTER(DataGridColumnList);
 #endif
 
-#if ENABLE(DATABASE)
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowOpenDatabase);
-#endif
-
 #if ENABLE(DOM_STORAGE)
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowLocalStorage);
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowSessionStorage);
         DECLARE_INDEXED_PROPERTY_GETTER(Storage);
         DECLARE_INDEXED_PROPERTY_SETTER(Storage);
         DECLARE_INDEXED_PROPERTY_DELETER(Storage);
@@ -346,28 +328,14 @@ namespace WebCore {
 
 #if ENABLE(WORKERS)
         DECLARE_CALLBACK(WorkerConstructor);
-
-#if ENABLE(NOTIFICATIONS)
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(WorkerContextWebkitNotifications);
-#endif
-#endif // ENABLE(WORKERS)
-
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowApplicationCache);
 #endif
 
 #if ENABLE(SHARED_WORKERS)
         DECLARE_CALLBACK(SharedWorkerConstructor);
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowSharedWorker);
-#endif
-
-#if ENABLE(NOTIFICATIONS)
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowWebkitNotifications);
 #endif
 
 #if ENABLE(WEB_SOCKETS)
         DECLARE_CALLBACK(WebSocketConstructor);
-        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowWebSocket);
 #endif
 
 #undef DECLARE_INDEXED_ACCESS_CHECK
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 4d895c3..6177bc8 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -251,27 +251,27 @@ v8::Handle<v8::Value> V8DOMWindow::AudioAccessorGetter(v8::Local<v8::String> nam
     return V8DOMWrapper::getConstructor(V8ClassIndex::AUDIO, window);
 }
 
-ACCESSOR_RUNTIME_ENABLER(DOMWindowAudio)
+bool V8DOMWindow::AudioEnabled()
 {
     return MediaPlayer::isAvailable();
 }
 
-ACCESSOR_RUNTIME_ENABLER(DOMWindowHTMLMediaElement)
+bool V8DOMWindow::HTMLMediaElementEnabled()
 {
     return MediaPlayer::isAvailable();
 }
 
-ACCESSOR_RUNTIME_ENABLER(DOMWindowHTMLAudioElement)
+bool V8DOMWindow::HTMLAudioElementEnabled()
 {
     return MediaPlayer::isAvailable();
 }
 
-ACCESSOR_RUNTIME_ENABLER(DOMWindowHTMLVideoElement)
+bool V8DOMWindow::HTMLVideoElementEnabled()
 {
     return MediaPlayer::isAvailable();
 }
 
-ACCESSOR_RUNTIME_ENABLER(DOMWindowMediaError)
+bool V8DOMWindow::MediaErrorEnabled()
 {
     return MediaPlayer::isAvailable();
 }
@@ -279,47 +279,47 @@ ACCESSOR_RUNTIME_ENABLER(DOMWindowMediaError)
 #endif
 
 #if ENABLE(SHARED_WORKERS)
-ACCESSOR_RUNTIME_ENABLER(DOMWindowSharedWorker)
+bool V8DOMWindow::SharedWorkerEnabled()
 {
     return SharedWorkerRepository::isAvailable();
 }
 #endif
 
 #if ENABLE(WEB_SOCKETS)
-ACCESSOR_RUNTIME_ENABLER(DOMWindowWebSocket)
+bool V8DOMWindow::WebSocketEnabled()
 {
     return WebSocket::isAvailable();
 }
 #endif
 
 #if ENABLE(DATABASE)
-ACCESSOR_RUNTIME_ENABLER(DOMWindowOpenDatabase)
+bool V8DOMWindow::OpenDatabaseEnabled()
 {
     return WebCore::RuntimeEnabledFeatures::databaseEnabled();
 }
 #endif
 
 #if ENABLE(DOM_STORAGE)
-ACCESSOR_RUNTIME_ENABLER(DOMWindowLocalStorage)
+bool V8DOMWindow::LocalStorageEnabled()
 {
     return RuntimeEnabledFeatures::localStorageEnabled();
 }
 
-ACCESSOR_RUNTIME_ENABLER(DOMWindowSessionStorage)
+bool V8DOMWindow::SessionStorageEnabled()
 {
     return RuntimeEnabledFeatures::sessionStorageEnabled();
 }
 #endif
 
 #if ENABLE(NOTIFICATIONS)
-ACCESSOR_RUNTIME_ENABLER(DOMWindowWebkitNotifications)
+bool V8DOMWindow::WebkitNotificationsEnabled()
 {
     return RuntimeEnabledFeatures::notificationsEnabled();
 }
 #endif
 
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
-ACCESSOR_RUNTIME_ENABLER(DOMWindowApplicationCache)
+bool V8DOMWindow::ApplicationCacheEnabled()
 {
     return RuntimeEnabledFeatures::applicationCacheEnabled();
 }
diff --git a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
index ef1ae7b..c9b4136 100644
--- a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
@@ -147,15 +147,6 @@ v8::Handle<v8::Value> V8WebSocket::sendCallback(const v8::Arguments& args)
     return v8Boolean(ret);
 }
 
-v8::Handle<v8::Value> V8WebSocket::closeCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebSocket.close()");
-    WebSocket* webSocket = V8DOMWrapper::convertToNativeObject<WebSocket>(V8ClassIndex::WEBSOCKET, args.Holder());
-
-    webSocket->close();
-    return v8::Undefined();
-}
-
 }  // namespace WebCore
 
 #endif  // ENABLE(WEB_SOCKETS)
diff --git a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
index 235fc8e..b4a6381 100644
--- a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
@@ -48,7 +48,7 @@
 namespace WebCore {
 
 #if ENABLE(NOTIFICATIONS)
-ACCESSOR_RUNTIME_ENABLER(WorkerContextWebkitNotifications)
+bool V8WorkerContext::WebkitNotificationsEnabled()
 {
     return RuntimeEnabledFeatures::notificationsEnabled();
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list