Title: [124716] trunk/Source/WebCore
Revision
124716
Author
[email protected]
Date
2012-08-05 08:39:28 -0700 (Sun, 05 Aug 2012)

Log Message

[V8] Remove V8Proxy::registerExtensionWithV8()
https://bugs.webkit.org/show_bug.cgi?id=93115

Reviewed by Adam Barth.

V8Proxy::registerExtensionWithV8() is used by V8Proxy::registerExtension()
only. We can remove the redundant method.

In a follow-up patch, I will implement V8Proxy::registerExtentionIfNeeded()
and remove registerExtensionWithV8() and registerExtension().

No tests. No change in behavior.

* bindings/v8/V8Proxy.cpp:
(WebCore::staticExtensionsList): Just moved to near related methods.
(WebCore):
(WebCore::V8Proxy::extensions):
(WebCore::V8Proxy::registerExtension):
* bindings/v8/V8Proxy.h:
(V8Proxy):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124715 => 124716)


--- trunk/Source/WebCore/ChangeLog	2012-08-05 15:37:01 UTC (rev 124715)
+++ trunk/Source/WebCore/ChangeLog	2012-08-05 15:39:28 UTC (rev 124716)
@@ -1,5 +1,28 @@
 2012-08-05  Kentaro Hara  <[email protected]>
 
+        [V8] Remove V8Proxy::registerExtensionWithV8()
+        https://bugs.webkit.org/show_bug.cgi?id=93115
+
+        Reviewed by Adam Barth.
+
+        V8Proxy::registerExtensionWithV8() is used by V8Proxy::registerExtension()
+        only. We can remove the redundant method.
+
+        In a follow-up patch, I will implement V8Proxy::registerExtentionIfNeeded()
+        and remove registerExtensionWithV8() and registerExtension().
+
+        No tests. No change in behavior.
+
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::staticExtensionsList): Just moved to near related methods.
+        (WebCore):
+        (WebCore::V8Proxy::extensions):
+        (WebCore::V8Proxy::registerExtension):
+        * bindings/v8/V8Proxy.h:
+        (V8Proxy):
+
+2012-08-05  Kentaro Hara  <[email protected]>
+
         [V8] Remove unused enum and typedefs in V8Proxy
         https://bugs.webkit.org/show_bug.cgi?id=93105
 

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.cpp (124715 => 124716)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-05 15:37:01 UTC (rev 124715)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-05 15:39:28 UTC (rev 124716)
@@ -78,12 +78,6 @@
 
 namespace WebCore {
 
-static V8Extensions& staticExtensionsList()
-{
-    DEFINE_STATIC_LOCAL(V8Extensions, extensions, ());
-    return extensions;
-}
-
 void batchConfigureAttributes(v8::Handle<v8::ObjectTemplate> instance, 
                               v8::Handle<v8::ObjectTemplate> proto, 
                               const BatchedAttribute* attributes, 
@@ -670,11 +664,10 @@
     return args.This();
 }
 
-void V8Proxy::registerExtensionWithV8(v8::Extension* extension)
+V8Extensions& V8Proxy::extensions()
 {
-    // If the extension exists in our list, it was already registered with V8.
-    if (!registeredExtensionWithV8(extension))
-        v8::RegisterExtension(extension);
+    DEFINE_STATIC_LOCAL(V8Extensions, extensions, ());
+    return extensions;
 }
 
 bool V8Proxy::registeredExtensionWithV8(v8::Extension* extension)
@@ -690,15 +683,12 @@
 
 void V8Proxy::registerExtension(v8::Extension* extension)
 {
-    registerExtensionWithV8(extension);
-    staticExtensionsList().append(extension);
+    // If the extension exists in our list, it was already registered with V8.
+    if (!registeredExtensionWithV8(extension))
+        v8::RegisterExtension(extension);
+    extensions().append(extension);
 }
 
-const V8Extensions& V8Proxy::extensions()
-{
-    return staticExtensionsList();
-}
-
 bool V8Proxy::setContextDebugId(int debugId)
 {
     ASSERT(debugId > 0);

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.h (124715 => 124716)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-08-05 15:37:01 UTC (rev 124715)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-08-05 15:39:28 UTC (rev 124716)
@@ -218,11 +218,9 @@
         // affect v8 contexts initialized after this call. Takes ownership of
         // the v8::Extension object passed.
         static void registerExtension(v8::Extension*);
-
-        static void registerExtensionWithV8(v8::Extension*);
         static bool registeredExtensionWithV8(v8::Extension*);
 
-        static const V8Extensions& extensions();
+        static V8Extensions& extensions();
 
         static void reportUnsafeAccessTo(Document* targetDocument);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to