Title: [121326] trunk/Source/WebCore
Revision
121326
Author
[email protected]
Date
2012-06-27 00:28:31 -0700 (Wed, 27 Jun 2012)

Log Message

[V8] Refactor V8BindingPerIsolateData::current() and V8BindingPerIsolateData::get()
https://bugs.webkit.org/show_bug.cgi?id=90044

Reviewed by Adam Barth.

'static_cast<V8BindingPerIsolateData*>(isolate->GetData())' is duplicated
in V8BindingPerIsolateData::current() and V8BindingPerIsolateData::get().
This patch removes the duplication.

No tests. No change in behavior.

* bindings/v8/V8Binding.h:
(WebCore::V8BindingPerIsolateData::current):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121325 => 121326)


--- trunk/Source/WebCore/ChangeLog	2012-06-27 07:26:35 UTC (rev 121325)
+++ trunk/Source/WebCore/ChangeLog	2012-06-27 07:28:31 UTC (rev 121326)
@@ -1,3 +1,19 @@
+2012-06-27  Kentaro Hara  <[email protected]>
+
+        [V8] Refactor V8BindingPerIsolateData::current() and V8BindingPerIsolateData::get()
+        https://bugs.webkit.org/show_bug.cgi?id=90044
+
+        Reviewed by Adam Barth.
+
+        'static_cast<V8BindingPerIsolateData*>(isolate->GetData())' is duplicated
+        in V8BindingPerIsolateData::current() and V8BindingPerIsolateData::get().
+        This patch removes the duplication.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/V8Binding.h:
+        (WebCore::V8BindingPerIsolateData::current):
+
 2012-06-26  Yoshifumi Inoue  <[email protected]>
 
         [Platform] Change implementation of LocaleICU class to support more UDateFormat.

Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (121325 => 121326)


--- trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-06-27 07:26:35 UTC (rev 121325)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-06-27 07:28:31 UTC (rev 121326)
@@ -120,16 +120,13 @@
     public:
         static V8BindingPerIsolateData* create(v8::Isolate*);
         static void ensureInitialized(v8::Isolate*);
-        static V8BindingPerIsolateData* get(v8::Isolate* isolate)
+        static V8BindingPerIsolateData* current(v8::Isolate* isolate = 0)
         {
+            if (UNLIKELY(!isolate))
+                isolate = v8::Isolate::GetCurrent();
             ASSERT(isolate->GetData());
             return static_cast<V8BindingPerIsolateData*>(isolate->GetData()); 
         }
-
-        static V8BindingPerIsolateData* current(v8::Isolate* isolate = 0)
-        {
-            return isolate ? static_cast<V8BindingPerIsolateData*>(isolate->GetData()) : get(v8::Isolate::GetCurrent());
-        }
         static void dispose(v8::Isolate*);
 
         typedef HashMap<WrapperTypeInfo*, v8::Persistent<v8::FunctionTemplate> > TemplateMap;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to