Title: [95166] trunk/Source/WebCore
Revision
95166
Author
jap...@chromium.org
Date
2011-09-14 22:12:51 -0700 (Wed, 14 Sep 2011)

Log Message

[V8] Null-check the v8::Context in
V8DOMWindowShell:namedItemAdded() before using it.
Also, add some logging to figure out how we're getting
into this bad state.
https://bugs.webkit.org/show_bug.cgi?id=68099

Reviewed by Adam Barth.

No new tests, no known repro.

* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::namedItemAdded):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (95165 => 95166)


--- trunk/Source/WebCore/ChangeLog	2011-09-15 04:46:29 UTC (rev 95165)
+++ trunk/Source/WebCore/ChangeLog	2011-09-15 05:12:51 UTC (rev 95166)
@@ -1,3 +1,18 @@
+2011-09-14  Nate Chapin  <jap...@chromium.org>
+
+        [V8] Null-check the v8::Context in 
+        V8DOMWindowShell:namedItemAdded() before using it.
+        Also, add some logging to figure out how we're getting
+        into this bad state.
+        https://bugs.webkit.org/show_bug.cgi?id=68099
+
+        Reviewed by Adam Barth.
+
+        No new tests, no known repro.
+
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::namedItemAdded):
+
 2011-09-14  Patrick Gansterer  <par...@webkit.org>
 
         Replace ENABLE_XHR_RESPONSE_BLOB preprocessor statements in IDL files with Conditional attribute

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (95165 => 95166)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2011-09-15 04:46:29 UTC (rev 95165)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2011-09-15 05:12:51 UTC (rev 95166)
@@ -572,6 +572,23 @@
 {
     initContextIfNeeded();
 
+    if (!isContextInitialized()) {
+#if PLATFORM(CHROMIUM)
+        // FIXME: Temporary diagnostics as to why V8 sometimes crashes with a null context below.
+        // See https://bugs.webkit.org/show_bug.cgi?id=68099.
+        PlatformSupport::incrementStatsCounter("V8Bindings.namedItemAdded.initContextFailed");
+        if (m_frame->settings() && !m_frame->settings()->isJavaScriptEnabled())
+            PlatformSupport::incrementStatsCounter("V8Bindings.namedItemAdded.scriptBlockedByWebCoreSettings");
+
+        if (!m_frame->script()->canExecuteScripts(NotAboutToExecuteScript))
+            PlatformSupport::incrementStatsCounter("V8Bindings.namedItemAdded.scriptBlockedByScriptController");
+
+        if (V8Proxy::handleOutOfMemory())
+            PlatformSupport::incrementStatsCounter("V8Bindings.namedItemAdded.outOfMemory");
+#endif
+        return;
+    }
+
     v8::HandleScope handleScope;
     v8::Context::Scope contextScope(m_context);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to