Title: [135497] trunk/Source/WebCore
Revision
135497
Author
hara...@chromium.org
Date
2012-11-22 01:47:53 -0800 (Thu, 22 Nov 2012)

Log Message

[V8] Move AddMessageListener() from WorkerContextExecutionProxy::initializeIfNeeded() to WorkerContextExecutionProxy::initIsolate()
https://bugs.webkit.org/show_bug.cgi?id=102998

Reviewed by Adam Barth.

This is an incremental step for moving initializeIfNeeded()
to V8Initializer.h. Given that AddMessageListener() needs to
be called once per Isolate, we can move AddMessageListener()
from initializeIfNeeded() to initIsolate().

No tests. No change in behavior.

* bindings/v8/WorkerContextExecutionProxy.cpp:
(WebCore::WorkerContextExecutionProxy::initIsolate):
(WebCore::WorkerContextExecutionProxy::initializeIfNeeded):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135496 => 135497)


--- trunk/Source/WebCore/ChangeLog	2012-11-22 09:44:45 UTC (rev 135496)
+++ trunk/Source/WebCore/ChangeLog	2012-11-22 09:47:53 UTC (rev 135497)
@@ -1,3 +1,21 @@
+2012-11-22  Kentaro Hara  <hara...@chromium.org>
+
+        [V8] Move AddMessageListener() from WorkerContextExecutionProxy::initializeIfNeeded() to WorkerContextExecutionProxy::initIsolate()
+        https://bugs.webkit.org/show_bug.cgi?id=102998
+
+        Reviewed by Adam Barth.
+
+        This is an incremental step for moving initializeIfNeeded()
+        to V8Initializer.h. Given that AddMessageListener() needs to
+        be called once per Isolate, we can move AddMessageListener()
+        from initializeIfNeeded() to initIsolate().
+
+        No tests. No change in behavior.
+
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::WorkerContextExecutionProxy::initIsolate):
+        (WebCore::WorkerContextExecutionProxy::initializeIfNeeded):
+
 2012-11-22  Michael Saboff  <msab...@apple.com>
 
         HTML integer parsing functions don't natively handle 8 bit strings

Modified: trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp (135496 => 135497)


--- trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp	2012-11-22 09:44:45 UTC (rev 135496)
+++ trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp	2012-11-22 09:47:53 UTC (rev 135497)
@@ -104,6 +104,9 @@
 
 void WorkerContextExecutionProxy::initIsolate()
 {
+    // Setup the security handlers and message listener.
+    v8::V8::AddMessageListener(&v8MessageHandler);
+
     // Tell V8 not to call the default OOM handler, binding code will handle it.
     v8::V8::IgnoreOutOfMemoryException();
     v8::V8::SetFatalErrorHandler(reportFatalErrorInV8);
@@ -129,12 +132,6 @@
     if (!m_context.isEmpty())
         return true;
 
-    // Setup the security handlers and message listener. This only has
-    // to be done once.
-    static bool isV8Initialized = false;
-    if (!isV8Initialized)
-        v8::V8::AddMessageListener(&v8MessageHandler);
-
     // Create a new environment
     v8::Persistent<v8::ObjectTemplate> globalTemplate;
     m_context.adopt(v8::Context::New(0, globalTemplate));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to