2010-12-13 Yury Semikhatsky <yurys@chromium.org>
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 19:54:12 +0000 (19:54 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 19:54:12 +0000 (19:54 +0000)
        Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.

        REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
        https://bugs.webkit.org/show_bug.cgi?id=50950

        * fast/events/resources/window-onerror.js: Removed.
        * fast/events/window-onerror1-expected.txt: Removed.
        * fast/events/window-onerror1.html: Removed.
        * fast/events/window-onerror10-expected.txt: Removed.
        * fast/events/window-onerror10.html: Removed.
        * fast/events/window-onerror11-expected.txt: Removed.
        * fast/events/window-onerror11.html: Removed.
        * fast/events/window-onerror2-expected.txt: Removed.
        * fast/events/window-onerror2.html: Removed.
        * fast/events/window-onerror3-expected.txt: Removed.
        * fast/events/window-onerror3.html: Removed.
        * fast/events/window-onerror4-expected.txt: Removed.
        * fast/events/window-onerror4.html: Removed.
        * fast/events/window-onerror5-expected.txt: Removed.
        * fast/events/window-onerror5.html: Removed.
        * fast/events/window-onerror6-expected.txt: Removed.
        * fast/events/window-onerror6.html: Removed.
        * fast/events/window-onerror7-expected.txt: Removed.
        * fast/events/window-onerror7.html: Removed.
        * fast/events/window-onerror8-expected.txt: Removed.
        * fast/events/window-onerror8.html: Removed.
        * fast/events/window-onerror9-expected.txt: Removed.
        * fast/events/window-onerror9.html: Removed.
        * fast/workers/worker-script-error-expected.txt:
        * http/tests/security/resources/onerror-iframe.html: Removed.
        * http/tests/security/window-onerror-exception-in-iframe-expected.txt: Removed.
        * http/tests/security/window-onerror-exception-in-iframe.html: Removed.
        * platform/chromium-win/fast/workers/worker-script-error-expected.txt:
        * platform/chromium/fast/events/window-onerror1-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror10-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror11-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror2-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror3-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror4-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror5-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror6-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror7-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror8-expected.txt: Removed.
        * platform/chromium/fast/events/window-onerror9-expected.txt: Removed.
        * platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt: Removed.
        * platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt: Removed.
        * platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt: Removed.
        * platform/gtk/Skipped:
        * userscripts/window-onerror-for-isolated-world-1-expected.txt: Removed.
        * userscripts/window-onerror-for-isolated-world-1.html: Removed.
        * userscripts/window-onerror-for-isolated-world-2-expected.txt: Removed.
        * userscripts/window-onerror-for-isolated-world-2.html: Removed.
2010-12-13  Yury Semikhatsky  <yurys@chromium.org>

        Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.

        REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
        https://bugs.webkit.org/show_bug.cgi?id=50950

        * Android.jscbindings.mk:
        * CMakeLists.txt:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.order:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSDOMBinding.cpp:
        (WebCore::reportException):
        * bindings/js/JSWorkerContextErrorHandler.cpp: Renamed from WebCore/bindings/js/JSErrorHandler.cpp.
        (WebCore::JSWorkerContextErrorHandler::JSWorkerContextErrorHandler):
        (WebCore::JSWorkerContextErrorHandler::~JSWorkerContextErrorHandler):
        (WebCore::JSWorkerContextErrorHandler::handleEvent):
        * bindings/js/JSWorkerContextErrorHandler.h: Renamed from WebCore/bindings/js/JSErrorHandler.h.
        (WebCore::JSWorkerContextErrorHandler::create):
        (WebCore::createJSWorkerContextErrorHandler):
        * bindings/scripts/CodeGeneratorJS.pm:
        * bindings/scripts/CodeGeneratorV8.pm:
        * bindings/v8/V8ConsoleMessage.cpp:
        (WebCore::V8ConsoleMessage::dispatchNow):
        (WebCore::V8ConsoleMessage::handler):
        * bindings/v8/V8ConsoleMessage.h:
        * bindings/v8/V8WindowErrorHandler.cpp: Removed.
        * bindings/v8/V8WindowErrorHandler.h: Removed.
        * bindings/v8/WorkerContextExecutionProxy.cpp:
        (WebCore::v8MessageHandler):
        * bindings/v8/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::evaluate):
        * dom/Document.cpp:
        (WebCore::Document::reportException):
        (WebCore::Document::addMessage):
        * dom/Document.h:
        * dom/ErrorEvent.cpp:
        * dom/ErrorEvent.h:
        * dom/Event.cpp:
        * dom/Event.h:
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::ScriptExecutionContext):
        * dom/ScriptExecutionContext.h:
        * websockets/WebSocket.cpp:
        (WebCore::WebSocket::connect):
        * websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::didOpen):
        (WebCore::WebSocketChannel::appendToBuffer):
        * websockets/WebSocketHandshake.cpp:
        (WebCore::WebSocketHandshake::readServerHandshake):
        (WebCore::WebSocketHandshake::readStatusLine):
        (WebCore::WebSocketHandshake::readHTTPHeaders):
        (WebCore::WebSocketHandshake::checkResponseHeaders):
        * workers/DefaultSharedWorkerRepository.cpp:
        (WebCore::postExceptionTask):
        (WebCore::postConsoleMessageTask):
        * workers/WorkerContext.cpp:
        (WebCore::WorkerContext::WorkerContext):
        (WebCore::WorkerContext::reportException):
        (WebCore::WorkerContext::addMessage):
        * workers/WorkerContext.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerExceptionTask::performTask):
        (WebCore::postConsoleMessageTask):
        * xml/XMLHttpRequest.cpp:
        (WebCore::reportUnsafeUsage):
2010-12-13  Yury Semikhatsky  <yurys@chromium.org>

        Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.

        REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
        https://bugs.webkit.org/show_bug.cgi?id=50950

        * src/WebWorkerClientImpl.cpp:
        (WebKit::WebWorkerClientImpl::postExceptionToWorkerObject):
        (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObject):
        (WebKit::WebWorkerClientImpl::postExceptionToWorkerObjectTask):
        (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73939 268f45cc-cd09-0410-ab3c-d52691b4dbfc

87 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/resources/window-onerror.js [deleted file]
LayoutTests/fast/events/window-onerror1-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror1.html [deleted file]
LayoutTests/fast/events/window-onerror10-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror10.html [deleted file]
LayoutTests/fast/events/window-onerror11-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror11.html [deleted file]
LayoutTests/fast/events/window-onerror2-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror2.html [deleted file]
LayoutTests/fast/events/window-onerror3-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror3.html [deleted file]
LayoutTests/fast/events/window-onerror4-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror4.html [deleted file]
LayoutTests/fast/events/window-onerror5-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror5.html [deleted file]
LayoutTests/fast/events/window-onerror6-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror6.html [deleted file]
LayoutTests/fast/events/window-onerror7-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror7.html [deleted file]
LayoutTests/fast/events/window-onerror8-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror8.html [deleted file]
LayoutTests/fast/events/window-onerror9-expected.txt [deleted file]
LayoutTests/fast/events/window-onerror9.html [deleted file]
LayoutTests/fast/workers/worker-script-error-expected.txt
LayoutTests/http/tests/security/resources/onerror-iframe.html [deleted file]
LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt [deleted file]
LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html [deleted file]
LayoutTests/platform/chromium-win/fast/workers/worker-script-error-expected.txt
LayoutTests/platform/chromium/fast/events/window-onerror1-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror10-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror11-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror2-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror3-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror4-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror5-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror6-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror7-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror8-expected.txt [deleted file]
LayoutTests/platform/chromium/fast/events/window-onerror9-expected.txt [deleted file]
LayoutTests/platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt [deleted file]
LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt [deleted file]
LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt [deleted file]
LayoutTests/platform/gtk/Skipped
LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt [deleted file]
LayoutTests/userscripts/window-onerror-for-isolated-world-1.html [deleted file]
LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt [deleted file]
LayoutTests/userscripts/window-onerror-for-isolated-world-2.html [deleted file]
WebCore/Android.jscbindings.mk
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.gypi
WebCore/WebCore.order
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSBindingsAllInOne.cpp
WebCore/bindings/js/JSDOMBinding.cpp
WebCore/bindings/js/JSWorkerContextErrorHandler.cpp [moved from WebCore/bindings/js/JSErrorHandler.cpp with 86% similarity]
WebCore/bindings/js/JSWorkerContextErrorHandler.h [moved from WebCore/bindings/js/JSErrorHandler.h with 69% similarity]
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/bindings/scripts/CodeGeneratorV8.pm
WebCore/bindings/v8/V8ConsoleMessage.cpp
WebCore/bindings/v8/V8ConsoleMessage.h
WebCore/bindings/v8/V8WindowErrorHandler.cpp [deleted file]
WebCore/bindings/v8/V8WindowErrorHandler.h [deleted file]
WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
WebCore/bindings/v8/WorkerScriptController.cpp
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/dom/ErrorEvent.cpp
WebCore/dom/ErrorEvent.h
WebCore/dom/Event.cpp
WebCore/dom/Event.h
WebCore/dom/ScriptExecutionContext.cpp
WebCore/dom/ScriptExecutionContext.h
WebCore/websockets/WebSocket.cpp
WebCore/websockets/WebSocketChannel.cpp
WebCore/websockets/WebSocketHandshake.cpp
WebCore/workers/DefaultSharedWorkerRepository.cpp
WebCore/workers/WorkerContext.cpp
WebCore/workers/WorkerContext.h
WebCore/workers/WorkerMessagingProxy.cpp
WebCore/xml/XMLHttpRequest.cpp
WebKit/chromium/ChangeLog
WebKit/chromium/src/WebWorkerClientImpl.cpp

index 84116f9421c875643b234768fcbabd0a6518a6af..8c78220d863ecc4985603cb435ef97721b8c0171 100644 (file)
@@ -1,3 +1,58 @@
+2010-12-13  Yury Semikhatsky  <yurys@chromium.org>
+
+        Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
+
+        REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
+        https://bugs.webkit.org/show_bug.cgi?id=50950
+
+        * fast/events/resources/window-onerror.js: Removed.
+        * fast/events/window-onerror1-expected.txt: Removed.
+        * fast/events/window-onerror1.html: Removed.
+        * fast/events/window-onerror10-expected.txt: Removed.
+        * fast/events/window-onerror10.html: Removed.
+        * fast/events/window-onerror11-expected.txt: Removed.
+        * fast/events/window-onerror11.html: Removed.
+        * fast/events/window-onerror2-expected.txt: Removed.
+        * fast/events/window-onerror2.html: Removed.
+        * fast/events/window-onerror3-expected.txt: Removed.
+        * fast/events/window-onerror3.html: Removed.
+        * fast/events/window-onerror4-expected.txt: Removed.
+        * fast/events/window-onerror4.html: Removed.
+        * fast/events/window-onerror5-expected.txt: Removed.
+        * fast/events/window-onerror5.html: Removed.
+        * fast/events/window-onerror6-expected.txt: Removed.
+        * fast/events/window-onerror6.html: Removed.
+        * fast/events/window-onerror7-expected.txt: Removed.
+        * fast/events/window-onerror7.html: Removed.
+        * fast/events/window-onerror8-expected.txt: Removed.
+        * fast/events/window-onerror8.html: Removed.
+        * fast/events/window-onerror9-expected.txt: Removed.
+        * fast/events/window-onerror9.html: Removed.
+        * fast/workers/worker-script-error-expected.txt:
+        * http/tests/security/resources/onerror-iframe.html: Removed.
+        * http/tests/security/window-onerror-exception-in-iframe-expected.txt: Removed.
+        * http/tests/security/window-onerror-exception-in-iframe.html: Removed.
+        * platform/chromium-win/fast/workers/worker-script-error-expected.txt:
+        * platform/chromium/fast/events/window-onerror1-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror10-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror11-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror2-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror3-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror4-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror5-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror6-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror7-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror8-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror9-expected.txt: Removed.
+        * platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt: Removed.
+        * platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt: Removed.
+        * platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt: Removed.
+        * platform/gtk/Skipped:
+        * userscripts/window-onerror-for-isolated-world-1-expected.txt: Removed.
+        * userscripts/window-onerror-for-isolated-world-1.html: Removed.
+        * userscripts/window-onerror-for-isolated-world-2-expected.txt: Removed.
+        * userscripts/window-onerror-for-isolated-world-2.html: Removed.
+
 2010-12-09  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/fast/events/resources/window-onerror.js b/LayoutTests/fast/events/resources/window-onerror.js
deleted file mode 100644 (file)
index 344574b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-function throwException() {
-    throw new Error("An exception");
-}
diff --git a/LayoutTests/fast/events/window-onerror1-expected.txt b/LayoutTests/fast/events/window-onerror1-expected.txt
deleted file mode 100644 (file)
index fe51b72..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-This page tests setting onerror handlers through the DOM. If it passes, you will see "PASS" messages below.Bug 8519.
-
-PASS: caught global error: ReferenceError: Can't find variable: hahaha_good_luck_finding_me at window-onerror1.html:25
diff --git a/LayoutTests/fast/events/window-onerror1.html b/LayoutTests/fast/events/window-onerror1.html
deleted file mode 100644 (file)
index 59d2495..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<head>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function print(message, color)
-{
-    var paragraph = document.createElement("div");
-    paragraph.appendChild(document.createTextNode(message));
-    paragraph.style.fontFamily = "monospace";
-    if (color)
-        paragraph.style.color = color;
-    document.getElementById("console").appendChild(paragraph);
-}
-
-function test()
-{
-    // must be last because the exception ends JavaScript execution
-    window.onerror = function (error, url, line) {
-        url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-        print("PASS: caught global error: " + error + " at " + url + ":" + line, "green");
-        return false;
-    };
-    hahaha_good_luck_finding_me(); // caught by window.onerror
-}
-</script>
-</head>
-<body onload="test();">
-<p>This page tests setting onerror handlers through the DOM. If it passes, you will
-   see "PASS" messages below.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<hr>
-<div id='console'></div>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror10-expected.txt b/LayoutTests/fast/events/window-onerror10-expected.txt
deleted file mode 100644 (file)
index bff5636..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that "error" event listener added with window.addEventListener is invoked for uncaucht exceptions. Bug 8519.
-
-event passed to the listener is the same as window.event: true
-Event details:
-type: error
-phase: 2
-currentTarget is the global object: true
-message: Error: My fault.
-filename: window-onerror10.html
-lineno: 29
-
diff --git a/LayoutTests/fast/events/window-onerror10.html b/LayoutTests/fast/events/window-onerror10.html
deleted file mode 100644 (file)
index 26ed018..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>
-<body>
-<p>Test that "error" event listener added with window.addEventListener is invoked for uncaucht exceptions. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function lastPathComponent(url) {
-    return url ? url.match( /[^\/]+\/?$/ )[0] : url;
-}
-
-window.addEventListener("error", function(e) {
-    log("event passed to the listener is the same as window.event: " + (window.event === e));
-    log("Event details:");
-    log("type: " + e.type);
-    log("phase: " + e.eventPhase)
-    log("currentTarget is the global object: " + (e.currentTarget === window));
-    log("message: " + e.message);
-    log("filename: " + lastPathComponent(e.filename));
-    log("lineno: " + e.lineno);
-    e.preventDefault();
-}, false);
-
-throw new Error("My fault.");
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror11-expected.txt b/LayoutTests/fast/events/window-onerror11-expected.txt
deleted file mode 100644 (file)
index 96e20cc..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that window.onerror is called on window object. Bug 8519.
-
-Main frame window.onerror: Error: An exception at window-onerror.js:2
-
diff --git a/LayoutTests/fast/events/window-onerror11.html b/LayoutTests/fast/events/window-onerror11.html
deleted file mode 100644 (file)
index 7655fa7..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<html>
-<head>
-<script src="resources/window-onerror.js">
-</script>
-</head>
-<body>
-<p>Test that window.onerror is called on window object. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    return false;
-}
-
-throwException();
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror2-expected.txt b/LayoutTests/fast/events/window-onerror2-expected.txt
deleted file mode 100644 (file)
index 93a2d3f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Test that uncaught exceptions will be reported to the window.onerror handler. Bug 8519.
-
-Main frame window.onerror: Error: Inline script exception at window-onerror2.html:35
-Main frame window.onerror: Exception in onload at undefined:0
-Main frame window.onerror: Error: Exception in setTimeout at window-onerror2.html:29
-
diff --git a/LayoutTests/fast/events/window-onerror2.html b/LayoutTests/fast/events/window-onerror2.html
deleted file mode 100644 (file)
index db9fb75..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<html>
-<body onload="throw 'Exception in onload';">
-<p>Test that uncaught exceptions will be reported to the window.onerror handler. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="result"></div>
-<script>
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-}
-
-function log(msg) {
-    document.getElementById("result").innerHTML += msg + "<br>";
-}
-
-var unhandledErrorCount = 0;
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    
-    if (++unhandledErrorCount === 3 && window.layoutTestController)
-        layoutTestController.notifyDone();
-
-    return false;
-}
-
-function delayedThrowException()
-{
-    throw new Error("Exception in setTimeout");
-}
-setTimeout(delayedThrowException, 0);
-
-function throwException()
-{
-    throw new Error("Inline script exception");
-}
-throwException();
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror3-expected.txt b/LayoutTests/fast/events/window-onerror3-expected.txt
deleted file mode 100644 (file)
index 7025dbb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-You should see a message if window.onerror is working properly for this test.Bug 8519.
-
-Error caught successfully: ReferenceError: Can't find variable: unknownObject File: window-onerror3.html Line: 16
-
diff --git a/LayoutTests/fast/events/window-onerror3.html b/LayoutTests/fast/events/window-onerror3.html
deleted file mode 100644 (file)
index ee2893f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function test1()
-{
-    window.onerror = function (error, url, line) {
-        url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-        log("Error caught successfully: " + error + "\nFile: " + url + "\nLine: " + line)
-        return false;
-    };
-    unknownObject.unknownProperty++;
-}
-</script>
-<body onload="test1();">
-<p>You should see a message if window.onerror is working properly for this test.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<hr>
-<div id='console'></div>
-</body>
diff --git a/LayoutTests/fast/events/window-onerror4-expected.txt b/LayoutTests/fast/events/window-onerror4-expected.txt
deleted file mode 100644 (file)
index 26af8a1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-You should see a log record if window.onerror is working properly for this test.Bug 8519.
-
-Error caught successfully: ReferenceError: Left side of assignment is not a reference. File: undefined Line: 1
-
diff --git a/LayoutTests/fast/events/window-onerror4.html b/LayoutTests/fast/events/window-onerror4.html
deleted file mode 100644 (file)
index c51887d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function test1()
-{
-    window.onerror = function (error, url, line) {
-        url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-        log("Error caught successfully: " + error + "\nFile: " + url + "\nLine: " + line)
-        return false;
-    };
-    eval("1=2");
-}
-</script>
-<body onload="test1();">
-<p>You should see a log record if window.onerror is working properly for this test.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<hr>
-<div id='console'></div>
-</body>
diff --git a/LayoutTests/fast/events/window-onerror5-expected.txt b/LayoutTests/fast/events/window-onerror5-expected.txt
deleted file mode 100644 (file)
index 3ec7f5e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that window.onerror is invoked for syntax error in eval. You should see a log record if window.onerror is working properly for this test.Bug 8519.
-
-Error caught successfully: SyntaxError: Parse error File: undefined Line: 1
-
diff --git a/LayoutTests/fast/events/window-onerror5.html b/LayoutTests/fast/events/window-onerror5.html
deleted file mode 100644 (file)
index 932d438..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function test1()
-{
-    window.onerror = function (error, url, line) {
-        url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-        log("Error caught successfully: " + error + "\nFile: " + url + "\nLine: " + line)
-        return false;
-    };
-    eval("a(");
-}
-</script>
-<body onload="test1();">
-<p>Test that window.onerror is invoked for syntax error in eval. You should see a log record if window.onerror is working properly for this test.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<hr>
-<div id='console'></div>
-</body>
diff --git a/LayoutTests/fast/events/window-onerror6-expected.txt b/LayoutTests/fast/events/window-onerror6-expected.txt
deleted file mode 100644 (file)
index e7c27bb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that syntax error will be reported to the window.onerror handler. Bug 8519.
-
-Main frame window.onerror: SyntaxError: Parse error at window-onerror6.html:22
-
diff --git a/LayoutTests/fast/events/window-onerror6.html b/LayoutTests/fast/events/window-onerror6.html
deleted file mode 100644 (file)
index 1978436..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<html>
-<body>
-<p>Test that syntax error will be reported to the window.onerror handler. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    return false;
-}
-</script>
-<script>
-
-a) // syntax error
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror7-expected.txt b/LayoutTests/fast/events/window-onerror7-expected.txt
deleted file mode 100644 (file)
index 5d22e7e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 20: Error: Original error
-CONSOLE MESSAGE: line 17: Error: Nested error
-Test that exception in window.onerror won't lead to recursive window.onerror call. Bug 8519.
-
-Main frame window.onerror: Error: Original error at window-onerror7.html:20
-
diff --git a/LayoutTests/fast/events/window-onerror7.html b/LayoutTests/fast/events/window-onerror7.html
deleted file mode 100644 (file)
index f665686..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-<body>
-<p>Test that exception in window.onerror won't lead to recursive window.onerror call. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    throw new Error("Nested error");
-}
-
-throw new Error("Original error");
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror8-expected.txt b/LayoutTests/fast/events/window-onerror8-expected.txt
deleted file mode 100644 (file)
index efc6308..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Test that window.onerror is called on window object. Bug 8519.
-
-Main frame window.onerror: 2010 at undefined:0
-PASSED: this === window
-
diff --git a/LayoutTests/fast/events/window-onerror8.html b/LayoutTests/fast/events/window-onerror8.html
deleted file mode 100644 (file)
index bade538..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<html>
-<body>
-<p>Test that window.onerror is called on window object. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    if (this === window) 
-        log("PASSED: this === window");
-    else
-        log("FAILED: this === window");
-    return false;
-}
-
-throw 2010;
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror9-expected.txt b/LayoutTests/fast/events/window-onerror9-expected.txt
deleted file mode 100644 (file)
index 94316d3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Test that when window.onerror handler is called, window.event is the corresponding ErrorEvent object. Bug 8519.
-
-Main frame window.onerror: Error: 2010 at window-onerror9.html:31
-window.event.type = error
-window.event.message = Error: 2010
-window.event.filename = window-onerror9.html
-window.event.lineno = 31
-
diff --git a/LayoutTests/fast/events/window-onerror9.html b/LayoutTests/fast/events/window-onerror9.html
deleted file mode 100644 (file)
index 1086ace..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<body>
-<p>Test that when window.onerror handler is called, window.event is the corresponding ErrorEvent object. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-}
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function lastPathComponent(url) {
-    return url ? url.match( /[^\/]+\/?$/ )[0] : url;
-}
-
-window.onerror = function(msg, url, line)
-{
-    log("Main frame window.onerror: " + msg + " at " + lastPathComponent(url) + ":" + line);
-    log("window.event.type = " + window.event.type);
-    log("window.event.message = " + window.event.message);
-    log("window.event.filename = " + lastPathComponent(window.event.filename));
-    log("window.event.lineno = " + window.event.lineno);
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
-    return false;
-}
-
-throw new Error(2010);
-
-</script>
-</body>
-</html>
index 404164089e824a90e40de92c7e1249501b788719..10ab0493ab47a242ca6d73fcf04baf386e4f45f7 100644 (file)
@@ -4,10 +4,10 @@ Test Worker script error handling functionality. Should print a series of PASS m
 PASS: onerror invoked for a script that has invalid syntax.
 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
 PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
-PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: bar' at line 3.
 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
+PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
 PASS: message received from WorkerGlobalScope.onerror: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
 PASS: onerror invoked for an exception in setTimeout callback.
 DONE
diff --git a/LayoutTests/http/tests/security/resources/onerror-iframe.html b/LayoutTests/http/tests/security/resources/onerror-iframe.html
deleted file mode 100644 (file)
index 312fd12..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<script>
-function handleLoad()
-{
-    window.parent.postMessage("IFrameLoaded", "*");
-}
-
-throw "IframeException";
-
-</script>
-<body onload="handleLoad()">
-</body>
diff --git a/LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt b/LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt
deleted file mode 100644 (file)
index 8b17d92..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 0: IframeException
-Test that exceptions in iframe are not reported to the main frame window.onerror handler. window.onerror should print exactly one line.
-
-Main frame window.onerror: MainFrameException at undefined:0
-DONE
-
diff --git a/LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html b/LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html
deleted file mode 100644 (file)
index 0904e39..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<html>
-<body>
-<p>Test that exceptions in iframe are not reported to the main frame window.onerror handler.
-window.onerror should print exactly one line.</p>
-<div id="result"></div>
-<script>
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-}
-
-function log(msg) {
-    document.getElementById("result").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    return false;
-}
-
-function receiveMessage(event) {
-    if (event.data === "IFrameLoaded") {
-        log("DONE");
-        if (window.layoutTestController)
-            layoutTestController.notifyDone();
-    } else
-        log("FAIL " + event.data);
-}
-
-window.addEventListener("message", receiveMessage, false);
-
-throw "MainFrameException";
-
-</script>
-<iframe src="http://localhost:8000/security/resources/onerror-iframe.html"/>
-</body>
-</html>
index ef0a391e4787b33bbbb0d9f706038493fe318129..fdf660bd50c667d430f165a7fa837401641a1ca1 100644 (file)
@@ -3,10 +3,10 @@ Test Worker script error handling functionality. Should print a series of PASS m
 PASS: onerror invoked for a script that has invalid syntax.
 PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 1.
 PASS: event listener invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 1.
-PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
 PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: bar is not defined' at line 3.
 PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
 PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
+PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
 PASS: message received from WorkerGlobalScope.onerror: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
 PASS: onerror invoked for an exception in setTimeout callback.
 DONE
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror1-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror1-expected.txt
deleted file mode 100644 (file)
index 65b624b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-This page tests setting onerror handlers through the DOM. If it passes, you will see "PASS" messages below.Bug 8519.\r
-\r
-PASS: caught global error: Uncaught ReferenceError: hahaha_good_luck_finding_me is not defined at window-onerror1.html:25\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror10-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror10-expected.txt
deleted file mode 100644 (file)
index b3d2d39..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that "error" event listener added with window.addEventListener is invoked for uncaucht exceptions. Bug 8519.\r
-\r
-event passed to the listener is the same as window.event: true\r
-Event details:\r
-type: error\r
-phase: 2\r
-currentTarget is the global object: true\r
-message: Uncaught Error: My fault.\r
-filename: window-onerror10.html\r
-lineno: 29\r
-\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror11-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror11-expected.txt
deleted file mode 100644 (file)
index 92e3cf5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that window.onerror is called on window object. Bug 8519.\r
-\r
-Main frame window.onerror: Uncaught Error: An exception at window-onerror.js:2\r
-\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror2-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror2-expected.txt
deleted file mode 100644 (file)
index f7b1621..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Test that uncaught exceptions will be reported to the window.onerror handler. Bug 8519.\r
-\r
-Main frame window.onerror: Uncaught Error: Inline script exception at window-onerror2.html:35\r
-Main frame window.onerror: Uncaught Exception in onload at window-onerror2.html:2\r
-Main frame window.onerror: Uncaught Error: Exception in setTimeout at window-onerror2.html:29\r
-\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror3-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror3-expected.txt
deleted file mode 100644 (file)
index a1b8bd5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-You should see a message if window.onerror is working properly for this test.Bug 8519.\r
-\r
-Error caught successfully: Uncaught ReferenceError: unknownObject is not defined File: window-onerror3.html Line: 16\r
-\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror4-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror4-expected.txt
deleted file mode 100644 (file)
index 50f09e0..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-You should see a log record if window.onerror is working properly for this test.Bug 8519.\r
-\r
-Error caught successfully: Uncaught ReferenceError: Invalid left-hand side in assignment File: window-onerror4.html Line: 1\r
-\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror5-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror5-expected.txt
deleted file mode 100644 (file)
index e45369e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that window.onerror is invoked for syntax error in eval. You should see a log record if window.onerror is working properly for this test.Bug 8519.\r
-\r
-Error caught successfully: Uncaught SyntaxError: Unexpected end of input File: window-onerror5.html Line: 1\r
-\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror6-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror6-expected.txt
deleted file mode 100644 (file)
index 18ed81a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that syntax error will be reported to the window.onerror handler. Bug 8519.\r
-\r
-Main frame window.onerror: Uncaught SyntaxError: Unexpected token ) at window-onerror6.html:22\r
-\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror7-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror7-expected.txt
deleted file mode 100644 (file)
index 23d0407..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 20: Uncaught Error: Original error\r
-CONSOLE MESSAGE: line 17: Uncaught Error: Nested error\r
-Test that exception in window.onerror won't lead to recursive window.onerror call. Bug 8519.\r
-\r
-Main frame window.onerror: Uncaught Error: Original error at window-onerror7.html:20\r
-\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror8-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror8-expected.txt
deleted file mode 100644 (file)
index 13f2b32..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Test that window.onerror is called on window object. Bug 8519.\r
-\r
-Main frame window.onerror: Uncaught 2010 at window-onerror8.html:24\r
-PASSED: this === window\r
-\r
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror9-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror9-expected.txt
deleted file mode 100644 (file)
index 1677e50..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Test that when window.onerror handler is called, window.event is the corresponding ErrorEvent object. Bug 8519.\r
-\r
-Main frame window.onerror: Uncaught Error: 2010 at window-onerror9.html:31\r
-window.event.type = error\r
-window.event.message = Uncaught Error: 2010\r
-window.event.filename = window-onerror9.html\r
-window.event.lineno = 31\r
-\r
diff --git a/LayoutTests/platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt b/LayoutTests/platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt
deleted file mode 100644 (file)
index 9e9c2ea..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 7: Uncaught IframeException\r
-Test that exceptions in iframe are not reported to the main frame window.onerror handler. window.onerror should print exactly one line.\r
-\r
-Main frame window.onerror: Uncaught MainFrameException at window-onerror-exception-in-iframe.html:34\r
-DONE\r
-\r
diff --git a/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt b/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt
deleted file mode 100644 (file)
index 2a3d068..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Test that window.onerror and "error" event listeners from main world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.\r
-\r
-Main world window.onerror: Uncaught Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54\r
-Main world error event listener: Uncaught Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54\r
-Main world window.onerror: Uncaught Error: Error in user script inline script. at :12\r
-Main world error event listener: Uncaught Error: Error in user script inline script. at :12\r
-Main world window.onerror: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46\r
-Main world error event listener: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46\r
-Main world window.onerror: Uncaught Error: Error in user script load handler. at :4\r
-Main world error event listener: Uncaught Error: Error in user script load handler. at :4\r
-Main world window.onerror: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51\r
-Main world error event listener: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51\r
-Main world window.onerror: Uncaught Error: Error in user script setTimeout callback. at :9\r
-Main world error event listener: Uncaught Error: Error in user script setTimeout callback. at :9\r
diff --git a/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt b/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt
deleted file mode 100644 (file)
index 93994db..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-CONSOLE MESSAGE: line 30: Uncaught Error: Error in main world inline script.\r
-Test that window.onerror and "error" event listeners from isolated world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.\r
-\r
-user script window.onerror: Uncaught Error: Error in user script inline script. at :33\r
-user script error event listener: Uncaught Error: Error in user script inline script. at :33\r
-user script window.onerror: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23\r
-user script error event listener: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23\r
-user script window.onerror: Uncaught Error: Error in user script load handler. at :26\r
-user script error event listener: Uncaught Error: Error in user script load handler. at :26\r
-user script window.onerror: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27\r
-user script error event listener: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27\r
-user script window.onerror: Uncaught Error: Error in user script setTimeout callback. at :30\r
-user script error event listener: Uncaught Error: Error in user script setTimeout callback. at :30\r
index 0f9106b88405a9dc992b2b2e5e4a8fcfdb00ba3e..2b45241721032ceef24d14be6f10a12c1e7d6969 100644 (file)
@@ -4709,8 +4709,6 @@ userscripts/user-script-plugin-document.html
 userscripts/user-script-top-frame-only.html
 userscripts/user-script-video-document.html
 userscripts/user-style-top-frame-only.html
-userscripts/window-onerror-for-isolated-world-1.html
-userscripts/window-onerror-for-isolated-world-2.html
 
 # XHR sends sometimes yield null bytes sent instead of 0.
 http/tests/xmlhttprequest/workers/shared-worker-methods.html
diff --git a/LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt b/LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt
deleted file mode 100644 (file)
index 6895c41..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Test that window.onerror and "error" event listeners from main world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
-
-Main world window.onerror: Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
-Main world error event listener: Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
-Main world window.onerror: Error: Error in user script inline script. at undefined:11
-Main world error event listener: Error: Error in user script inline script. at undefined:11
-Main world window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
-Main world error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
-Main world window.onerror: Error: Error in user script load handler. at undefined:3
-Main world error event listener: Error: Error in user script load handler. at undefined:3
-Main world window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
-Main world error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
-Main world window.onerror: Error: Error in user script setTimeout callback. at undefined:8
-Main world error event listener: Error: Error in user script setTimeout callback. at undefined:8
diff --git a/LayoutTests/userscripts/window-onerror-for-isolated-world-1.html b/LayoutTests/userscripts/window-onerror-for-isolated-world-1.html
deleted file mode 100644 (file)
index 3c6bac2..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-</head>
-<body>
-<p>Test that window.onerror and "error" event listeners from main world are
-invoked for uncaught exceptions in user scripts running in isolate worlds as
-well as for exceptions in the main world.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519.</a>
-</p>
-<div id="console"></div>
-<script>
-
-var expectedRecordCount = 12;
-var recordCount = 0;
-document.getElementById("console").addEventListener("DOMNodeInserted", function(e) {
-    recordCount++;
-    if (recordCount === expectedRecordCount && window.layoutTestController)
-        layoutTestController.notifyDone();
-}, false);
-
-function log(msg) {
-    var record = document.createElement("div");
-    record.innerHTML = msg;
-    document.getElementById("console").appendChild(record);
-}
-
-function lastUrlComponent(url) {
-    return url ? url.match( /[^\/]+\/?$/ )[0] : url;
-}
-
-window.onerror = function(msg, url, line)
-{
-    log("Main world window.onerror: " + msg + " at " + lastUrlComponent(url) + ":" + line);
-    return false;
-}
-
-window.addEventListener("error", function(e)
-{
-    var url = lastUrlComponent(e.filename);
-    log("Main world error event listener: " + e.message + " at " + url + ":" + e.lineno);
-}, false);
-
-var exceptions = function(isolatedWorld)
-{
-    window.addEventListener("load", function(e) {
-        throw new Error("Error in " + isolatedWorld + " load handler.");
-    }, false);
-
-
-    setTimeout(function() {
-        throw new Error("Error in " + isolatedWorld + " setTimeout callback.");
-    }, 0);
-
-    throw new Error("Error in "+ isolatedWorld + " inline script.");
-}
-
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-    layoutTestController.addUserScript("(" + exceptions + ")('user script')", false, true);
-}
-
-exceptions("main world");
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt b/LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt
deleted file mode 100644 (file)
index b909a99..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-CONSOLE MESSAGE: line 30: Error: Error in main world inline script.
-Test that window.onerror and "error" event listeners from isolated world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
-
-user script window.onerror: Error: Error in user script inline script. at undefined:31
-user script error event listener: Error: Error in user script inline script. at undefined:31
-user script window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
-user script error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
-user script window.onerror: Error: Error in user script load handler. at undefined:24
-user script error event listener: Error: Error in user script load handler. at undefined:24
-user script window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
-user script error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
-user script window.onerror: Error: Error in user script setTimeout callback. at undefined:28
-user script error event listener: Error: Error in user script setTimeout callback. at undefined:28
diff --git a/LayoutTests/userscripts/window-onerror-for-isolated-world-2.html b/LayoutTests/userscripts/window-onerror-for-isolated-world-2.html
deleted file mode 100644 (file)
index a6ec699..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-</head>
-<body>
-<p>Test that window.onerror and "error" event listeners from isolated world are
-invoked for uncaught exceptions in user scripts running in isolate worlds as
-well as for exceptions in the main world.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519.</a>
-</p>
-<div id="console"></div>
-<script>
-
-var expectedRecordCount = 10;
-var recordCount = 0;
-document.getElementById("console").addEventListener("DOMNodeInserted", function(e) {
-    if (++recordCount === expectedRecordCount && window.layoutTestController)
-        layoutTestController.notifyDone();
-}, false);
-
-var throwExceptions = function(isolatedWorld)
-{
-    window.addEventListener("load", function(e) {
-        throw new Error("Error in " + isolatedWorld + " load handler.");
-    }, false);
-
-    setTimeout(function() {
-        throw new Error("Error in " + isolatedWorld + " setTimeout callback.");
-    }, 0);
-    
-    throw new Error("Error in "+ isolatedWorld + " inline script.");
-};
-
-var errorHandlers = function(isolatedWorld)
-{
-    function lastUrlComponent(url) {
-        return url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    }
-
-    function log(msg) {
-        var record = document.createElement("div");
-        record.innerHTML = msg;
-        document.getElementById("console").appendChild(record);
-    }
-
-    window.onerror = function(msg, url, line) {
-        log(isolatedWorld + " window.onerror: " + msg + " at " + lastUrlComponent(url) + ":" + line, "*");
-        return false;
-    }
-
-    window.addEventListener("error", function(e) {
-        var url = lastUrlComponent(e.filename);
-        log(isolatedWorld + " error event listener: " + e.message + " at " + url + ":" + e.lineno, "*");
-        e.preventDefault();
-    }, false);
-};
-
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-    layoutTestController.addUserScript("(" + errorHandlers + ")('user script'); (" + throwExceptions + ")('user script')", false, true);
-}
-
-throwExceptions("main world");
-
-</script>
-</body>
-</html>
index e7fd2fcc123acc926dc0528e3793da24ed65ae01..653dfece7f6a6e3103326321d764d3e2500f01d5 100644 (file)
@@ -102,7 +102,6 @@ LOCAL_SRC_FILES += \
        bindings/js/JSDeviceOrientationEventCustom.cpp \
        bindings/js/JSDocumentCustom.cpp \
        bindings/js/JSElementCustom.cpp \
-       bindings/js/JSErrorHandler.cpp \
        bindings/js/JSEventCustom.cpp \
        bindings/js/JSEventListener.cpp \
        bindings/js/JSEventTarget.cpp \
@@ -171,6 +170,7 @@ LOCAL_SRC_FILES += \
        bindings/js/JSWebKitPointCustom.cpp \
        bindings/js/JSWorkerContextBase.cpp \
        bindings/js/JSWorkerContextCustom.cpp \
+       bindings/js/JSWorkerContextErrorHandler.cpp \
        bindings/js/JSWorkerCustom.cpp \
        bindings/js/JSXMLHttpRequestCustom.cpp \
        bindings/js/JSXMLHttpRequestUploadCustom.cpp \
index e3ffc38f659447bea18ed5af2524ddf40e62309a..2b0ee30f31c8cd0a1703ea7ec1937aff881a30b0 100644 (file)
@@ -634,7 +634,6 @@ SET(WebCore_SOURCES
     bindings/js/JSDeviceOrientationEventCustom.cpp
     bindings/js/JSDocumentCustom.cpp
     bindings/js/JSElementCustom.cpp
-    bindings/js/JSErrorHandler.cpp
     bindings/js/JSEventCustom.cpp
     bindings/js/JSEventListener.cpp
     bindings/js/JSEventSourceCustom.cpp
@@ -704,6 +703,7 @@ SET(WebCore_SOURCES
     bindings/js/JSWebSocketCustom.cpp
     bindings/js/JSWorkerContextBase.cpp
     bindings/js/JSWorkerContextCustom.cpp
+    bindings/js/JSWorkerContextErrorHandler.cpp
     bindings/js/JSWorkerCustom.cpp
     bindings/js/JSXMLHttpRequestCustom.cpp
     bindings/js/JSXMLHttpRequestUploadCustom.cpp
index bdaa84c80a6491e80460fda536535b0e8c46bd2a..d1ace3c610c95aa9eb2d07eb77f27e7feb1b1b41 100644 (file)
@@ -1,3 +1,75 @@
+2010-12-13  Yury Semikhatsky  <yurys@chromium.org>
+
+        Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
+
+        REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
+        https://bugs.webkit.org/show_bug.cgi?id=50950
+
+        * Android.jscbindings.mk:
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.order:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::reportException):
+        * bindings/js/JSWorkerContextErrorHandler.cpp: Renamed from WebCore/bindings/js/JSErrorHandler.cpp.
+        (WebCore::JSWorkerContextErrorHandler::JSWorkerContextErrorHandler):
+        (WebCore::JSWorkerContextErrorHandler::~JSWorkerContextErrorHandler):
+        (WebCore::JSWorkerContextErrorHandler::handleEvent):
+        * bindings/js/JSWorkerContextErrorHandler.h: Renamed from WebCore/bindings/js/JSErrorHandler.h.
+        (WebCore::JSWorkerContextErrorHandler::create):
+        (WebCore::createJSWorkerContextErrorHandler):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/V8ConsoleMessage.cpp:
+        (WebCore::V8ConsoleMessage::dispatchNow):
+        (WebCore::V8ConsoleMessage::handler):
+        * bindings/v8/V8ConsoleMessage.h:
+        * bindings/v8/V8WindowErrorHandler.cpp: Removed.
+        * bindings/v8/V8WindowErrorHandler.h: Removed.
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::v8MessageHandler):
+        * bindings/v8/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::evaluate):
+        * dom/Document.cpp:
+        (WebCore::Document::reportException):
+        (WebCore::Document::addMessage):
+        * dom/Document.h:
+        * dom/ErrorEvent.cpp:
+        * dom/ErrorEvent.h:
+        * dom/Event.cpp:
+        * dom/Event.h:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::ScriptExecutionContext):
+        * dom/ScriptExecutionContext.h:
+        * websockets/WebSocket.cpp:
+        (WebCore::WebSocket::connect):
+        * websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::didOpen):
+        (WebCore::WebSocketChannel::appendToBuffer):
+        * websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::readServerHandshake):
+        (WebCore::WebSocketHandshake::readStatusLine):
+        (WebCore::WebSocketHandshake::readHTTPHeaders):
+        (WebCore::WebSocketHandshake::checkResponseHeaders):
+        * workers/DefaultSharedWorkerRepository.cpp:
+        (WebCore::postExceptionTask):
+        (WebCore::postConsoleMessageTask):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::WorkerContext):
+        (WebCore::WorkerContext::reportException):
+        (WebCore::WorkerContext::addMessage):
+        * workers/WorkerContext.h:
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::WorkerExceptionTask::performTask):
+        (WebCore::postConsoleMessageTask):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::reportUnsafeUsage):
+
 2010-12-13  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Alexey Proskuryakov.
index dcbe391efb4a1270e8037b59867c718eb6881913..4d95df7c949bf59df284ca28f62e89bc2bf0d6d0 100644 (file)
@@ -773,8 +773,6 @@ webcore_sources += \
        WebCore/bindings/js/JSElementCustom.cpp \
        WebCore/bindings/js/JSEntryCustom.cpp \
        WebCore/bindings/js/JSEntrySyncCustom.cpp \
-       WebCore/bindings/js/JSErrorHandler.cpp \
-       WebCore/bindings/js/JSErrorHandler.h \
        WebCore/bindings/js/JSEventCustom.cpp \
        WebCore/bindings/js/JSEventListener.cpp \
        WebCore/bindings/js/JSEventListener.h \
@@ -872,6 +870,8 @@ webcore_sources += \
        WebCore/bindings/js/JSWorkerContextBase.cpp \
        WebCore/bindings/js/JSWorkerContextBase.h \
        WebCore/bindings/js/JSWorkerContextCustom.cpp \
+       WebCore/bindings/js/JSWorkerContextErrorHandler.cpp \
+       WebCore/bindings/js/JSWorkerContextErrorHandler.h \
        WebCore/bindings/js/JSWorkerCustom.cpp \
        WebCore/bindings/js/JSXMLHttpRequestCustom.cpp \
        WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp \
index 237da0f30999e45e71256338f1b714c55a9c325c..00f719b4a5ce01904f6cd385d82e8a97bbd071f6 100644 (file)
             'bindings/js/JSElementCustom.cpp',
             'bindings/js/JSEntryCustom.cpp',
             'bindings/js/JSEntrySyncCustom.cpp',
-            'bindings/js/JSErrorHandler.cpp',
-            'bindings/js/JSErrorHandler.h',
             'bindings/js/JSEventCustom.cpp',
             'bindings/js/JSEventListener.cpp',
             'bindings/js/JSEventListener.h',
             'bindings/js/JSWorkerContextBase.cpp',
             'bindings/js/JSWorkerContextBase.h',
             'bindings/js/JSWorkerContextCustom.cpp',
+            'bindings/js/JSWorkerContextErrorHandler.cpp',
+            'bindings/js/JSWorkerContextErrorHandler.h',
             'bindings/js/JSWorkerCustom.cpp',
             'bindings/js/JSXMLHttpRequestCustom.cpp',
             'bindings/js/JSXMLHttpRequestUploadCustom.cpp',
             'bindings/v8/V8Proxy.h',
             'bindings/v8/V8Utilities.cpp',
             'bindings/v8/V8Utilities.h',
-            'bindings/v8/V8WindowErrorHandler.cpp',
-            'bindings/v8/V8WindowErrorHandler.h',
             'bindings/v8/V8WorkerContextErrorHandler.cpp',
             'bindings/v8/V8WorkerContextErrorHandler.h',
             'bindings/v8/V8WorkerContextEventListener.cpp',
index 2049fe1d5678641e63a077bb4f5ead591204faff..0fdabb13b3838281d7801af83424fffa79784c73 100644 (file)
@@ -25209,9 +25209,13 @@ __ZN7WebCore15JSWorkerContext10setTimeoutEPN3JSC9ExecStateERKNS1_7ArgListE
 __ZN7WebCore13WorkerContext10setTimeoutEPNS_15ScheduledActionEi
 __ZN7WebCore17WorkerSharedTimer11setFireTimeEd
 __ZN7WebCore15ScheduledAction7executeEPNS_13WorkerContextE
+__ZN7WebCore27JSWorkerContextErrorHandlerC1EPN3JSC8JSObjectES3_bPNS_15DOMWrapperWorldE
+__ZN7WebCore27JSWorkerContextErrorHandlerC2EPN3JSC8JSObjectES3_bPNS_15DOMWrapperWorldE
 __ZN7WebCore10ErrorEventC1ERKNS_6StringES3_j
 __ZN7WebCore10ErrorEventC2ERKNS_6StringES3_j
+__ZN7WebCore27JSWorkerContextErrorHandler11handleEventEPNS_22ScriptExecutionContextEPNS_5EventE
 __ZN7WebCore10ErrorEventD0Ev
+__ZN7WebCore27JSWorkerContextErrorHandlerD0Ev
 __ZN7WebCore17jsWorkerOnmessageEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE
 __ZN7WebCore34jsWorkerPrototypeFunctionTerminateEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
 __ZThn8_N7WebCore20WorkerMessagingProxy19workerContextClosedEv
index 64dd94dc22b51da80954857cc0b06d3d9a09aa1b..11bf5141797301be8fa88a5532b3e75f5adc85f7 100644 (file)
@@ -385,7 +385,6 @@ v8 {
         bindings/v8/V8NodeFilterCondition.cpp \
         bindings/v8/V8Proxy.cpp \
         bindings/v8/V8Utilities.cpp \
-        bindings/v8/V8WindowErrorHandler.cpp \
         bindings/v8/V8WorkerContextEventListener.cpp \
         bindings/v8/WorkerContextExecutionProxy.cpp \
         bindings/v8/WorkerScriptController.cpp \
@@ -530,7 +529,6 @@ v8 {
         bindings/js/JSDeviceOrientationEventCustom.cpp \
         bindings/js/JSDocumentCustom.cpp \
         bindings/js/JSElementCustom.cpp \
-        bindings/js/JSErrorHandler.cpp \
         bindings/js/JSEventCustom.cpp \
         bindings/js/JSEventListener.cpp \
         bindings/js/JSEventSourceCustom.cpp \
@@ -590,6 +588,7 @@ v8 {
         bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp \
         bindings/js/JSWebKitCSSMatrixCustom.cpp \
         bindings/js/JSWebKitPointCustom.cpp \
+        bindings/js/JSWorkerContextErrorHandler.cpp \
         bindings/js/JSXMLHttpRequestCustom.cpp \
         bindings/js/JSXMLHttpRequestUploadCustom.cpp \
         bindings/js/ScheduledAction.cpp \
@@ -1461,7 +1460,6 @@ v8 {
         bindings/v8/V8NPUtils.h \
         bindings/v8/V8Proxy.h \
         bindings/v8/V8Utilities.h \
-        bindings/v8/V8WindowErrorHandler.h \
         bindings/v8/V8WorkerContextEventListener.h \
         bindings/v8/WorkerContextExecutionProxy.h \
         bindings/v8/WorkerScriptController.h \
@@ -1488,7 +1486,6 @@ v8 {
         bindings/js/JSDOMWindowCustom.h \
         bindings/js/JSDOMWindowShell.h \
         bindings/js/JSDOMWrapper.h \
-        bindings/js/JSErrorHandler.h \
         bindings/js/JSEventListener.h \
         bindings/js/JSEventTarget.h \
         bindings/js/JSHistoryCustom.h \
@@ -1506,6 +1503,7 @@ v8 {
         bindings/js/JSPluginElementFunctions.h \
         bindings/js/JSStorageCustom.h \
         bindings/js/JSWorkerContextBase.h \
+        bindings/js/JSWorkerContextErrorHandler.h \
         bindings/js/JavaScriptCallFrame.h \
         bindings/js/ScheduledAction.h \
         bindings/js/ScriptCachedFrameData.h \
index 99ee999d61bf78255458b05c4b9498ca45a2080b..c072d5b0ca485c49db996573fc1cbb79811cc1c7 100755 (executable)
                                                        Name="VCCLCompilerTool"
                                                />
                                        </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Debug_Internal|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Debug_Cairo|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Release_Cairo|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Debug_All|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                               </File>
-                               <File
-                                       RelativePath="..\bindings\js\JSErrorHandler.cpp"
-                                       >
-                                       <FileConfiguration
-                                               Name="Debug|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Release|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Debug_Internal|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Debug_Cairo|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Release_Cairo|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Debug_All|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                               </File>
-                               <File
-                                       RelativePath="..\bindings\js\JSErrorHandler.h"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\bindings\js\JSEventCustom.cpp"
-                                       >
-                                       <FileConfiguration
-                                               Name="Debug|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Release|Win32"
-                                               ExcludedFromBuild="true"
-                                               >
-                                               <Tool
-                                                       Name="VCCLCompilerTool"
-                                               />
-                                       </FileConfiguration>
                                        <FileConfiguration
                                                Name="Debug_Cairo_CFLite|Win32"
                                                ExcludedFromBuild="true"
                                                />
                                        </FileConfiguration>
                                </File>
+                               <File
+                                       RelativePath="..\bindings\js\JSWorkerContextErrorHandler.cpp"
+                                       >
+                                       <FileConfiguration
+                                               Name="Debug|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug_Cairo_CFLite|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release_Cairo_CFLite|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug_All|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release_LTCG|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\bindings\js\JSWorkerContextErrorHandler.h"
+                                       >
+                               </File>
                                <File
                                        RelativePath="..\bindings\js\JSWorkerCustom.cpp"
                                        >
index b2cda1e9afdaf8cba9595f1cfb6051af9fc0355e..fa02cc988bb3084f76520c95d64015c489892ed6 100644 (file)
                F392249D126F11AE00A926D9 /* ScriptCallStackFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = F392249B126F11AE00A926D9 /* ScriptCallStackFactory.h */; };
                F39BE95B12673BF400E0A674 /* ScriptArguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F39BE95912673BF400E0A674 /* ScriptArguments.cpp */; };
                F39BE95C12673BF400E0A674 /* ScriptArguments.h in Headers */ = {isa = PBXBuildFile; fileRef = F39BE95A12673BF400E0A674 /* ScriptArguments.h */; };
-               F3D461481161D53200CA0D09 /* JSErrorHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */; };
-               F3D461491161D53200CA0D09 /* JSErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSErrorHandler.h */; };
+               F3D461481161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3D461461161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp */; };
+               F3D461491161D53200CA0D09 /* JSWorkerContextErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */; };
                F4EAF4AE10C742B1009100D3 /* OpenTypeSanitizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4EAF4AC10C742B1009100D3 /* OpenTypeSanitizer.cpp */; };
                F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */; };
                F55B3DAD1251F12D003EF269 /* BaseTextInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */; };
                F392249B126F11AE00A926D9 /* ScriptCallStackFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptCallStackFactory.h; sourceTree = "<group>"; };
                F39BE95912673BF400E0A674 /* ScriptArguments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArguments.cpp; sourceTree = "<group>"; };
                F39BE95A12673BF400E0A674 /* ScriptArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptArguments.h; sourceTree = "<group>"; };
-               F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorHandler.cpp; sourceTree = "<group>"; };
-               F3D461471161D53200CA0D09 /* JSErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorHandler.h; sourceTree = "<group>"; };
+               F3D461461161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerContextErrorHandler.cpp; sourceTree = "<group>"; };
+               F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerContextErrorHandler.h; sourceTree = "<group>"; };
                F4EAF4AC10C742B1009100D3 /* OpenTypeSanitizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenTypeSanitizer.cpp; path = opentype/OpenTypeSanitizer.cpp; sourceTree = "<group>"; };
                F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenTypeSanitizer.h; path = opentype/OpenTypeSanitizer.h; sourceTree = "<group>"; };
                F523D23B02DE4396018635CA /* HTMLDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDocument.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowShell.h */,
                                BC53DAC611433064000D817E /* JSDOMWrapper.cpp */,
                                65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */,
-                               F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */,
-                               F3D461471161D53200CA0D09 /* JSErrorHandler.h */,
                                BC60901E0E91B8EC000C68B5 /* JSEventTarget.cpp */,
                                BC60901D0E91B8EC000C68B5 /* JSEventTarget.h */,
                                3314ACE910892086000F0E56 /* JSExceptionBase.cpp */,
                                14CD8D81106B529000A46D23 /* JSSharedWorkerCustom.cpp */,
                                E1C36D320EB0A094007410BC /* JSWorkerContextBase.cpp */,
                                E1C36D330EB0A094007410BC /* JSWorkerContextBase.h */,
+                               F3D461461161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp */,
+                               F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */,
                                BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */,
                                BCA378BB0D15F64200B793D6 /* ScheduledAction.h */,
                                41F1D21E0EF35C2A00DA8753 /* ScriptCachedFrameData.cpp */,
                                E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */,
                                E18256900EF2B02D00933242 /* JSWorkerContext.h in Headers */,
                                E1C36D350EB0A094007410BC /* JSWorkerContextBase.h in Headers */,
-                               F3D461491161D53200CA0D09 /* JSErrorHandler.h in Headers */,
+                               F3D461491161D53200CA0D09 /* JSWorkerContextErrorHandler.h in Headers */,
                                E1C362EF0EAF2AA9007410BC /* JSWorkerLocation.h in Headers */,
                                E1271A580EEECDE400F61213 /* JSWorkerNavigator.h in Headers */,
                                BC348BD40DB7F804004ABAB9 /* JSXMLHttpRequest.h in Headers */,
                                E182568F0EF2B02D00933242 /* JSWorkerContext.cpp in Sources */,
                                E1C36D340EB0A094007410BC /* JSWorkerContextBase.cpp in Sources */,
                                E18258AC0EF3CD7000933242 /* JSWorkerContextCustom.cpp in Sources */,
-                               F3D461481161D53200CA0D09 /* JSErrorHandler.cpp in Sources */,
+                               F3D461481161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp in Sources */,
                                E1CA5CBC0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp in Sources */,
                                E1C362F00EAF2AA9007410BC /* JSWorkerLocation.cpp in Sources */,
                                E1271A590EEECDE400F61213 /* JSWorkerNavigator.cpp in Sources */,
index d2c27a992de07a35b820dc7b2cc302eab0129599..7fc57402b7de6382df5927f7603884084f2701e3 100644 (file)
@@ -72,7 +72,6 @@
 #include "JSDeviceOrientationEventCustom.cpp"
 #include "JSDocumentCustom.cpp"
 #include "JSElementCustom.cpp"
-#include "JSErrorHandler.cpp"
 #include "JSEventCustom.cpp"
 #include "JSEventListener.cpp"
 #include "JSEventSourceCustom.cpp"
 #include "JSWebSocketCustom.cpp"
 #include "JSWorkerContextBase.cpp"
 #include "JSWorkerContextCustom.cpp"
+#include "JSWorkerContextErrorHandler.cpp"
 #include "JSWorkerCustom.cpp"
 #include "JSXMLHttpRequestCustom.cpp"
 #include "JSXMLHttpRequestUploadCustom.cpp"
index 6d3e3c54b9393b08df18ff45c4217b4bf43c17b7..267d18ae75f76a2f7b0f76c4c6cdb28ab39affe0 100644 (file)
@@ -55,7 +55,6 @@
 #include "ProcessingInstruction.h"
 #include "RangeException.h"
 #include "ScriptCachedFrameData.h"
-#include "ScriptCallStack.h"
 #include "ScriptController.h"
 #include "Settings.h"
 #include "WebCoreJSClientData.h"
@@ -599,7 +598,7 @@ void reportException(ExecState* exec, JSValue exception)
     if (!scriptExecutionContext)
         return;
 
-    scriptExecutionContext->reportException(ustringToString(errorMessage), lineNumber, ustringToString(exceptionSourceURL), 0);
+    scriptExecutionContext->reportException(ustringToString(errorMessage), lineNumber, ustringToString(exceptionSourceURL));
 }
 
 void reportCurrentException(ExecState* exec)
similarity index 86%
rename from WebCore/bindings/js/JSErrorHandler.cpp
rename to WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
index b6f39c159b22464f1b0614cbf9331a03f0dd81b0..f7d2b02ac22370078f505d9380fbca98709ab575 100644 (file)
@@ -30,7 +30,9 @@
 
 #include "config.h"
 
-#include "JSErrorHandler.h"
+#if ENABLE(WORKERS)
+
+#include "JSWorkerContextErrorHandler.h"
 
 #include "ErrorEvent.h"
 #include "Event.h"
@@ -41,24 +43,21 @@ using namespace JSC;
 
 namespace WebCore {
 
-JSErrorHandler::JSErrorHandler(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
+JSWorkerContextErrorHandler::JSWorkerContextErrorHandler(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
     : JSEventListener(function, wrapper, isAttribute, isolatedWorld)
 {
 }
 
-JSErrorHandler::~JSErrorHandler()
+JSWorkerContextErrorHandler::~JSWorkerContextErrorHandler()
 {
 }
 
-void JSErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
+void JSWorkerContextErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
 {
     ASSERT(scriptExecutionContext);
     if (!scriptExecutionContext)
         return;
 
-    ASSERT(event->isErrorEvent());
-    ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
-
     JSLock lock(SilenceAssertionsOnly);
 
     JSObject* jsFunction = this->jsFunction(scriptExecutionContext);
@@ -75,11 +74,15 @@ void JSErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext,
     CallType callType = jsFunction->getCallData(callData);
 
     if (callType != CallTypeNone) {
-        RefPtr<JSErrorHandler> protectedctor(this);
+
+        ref();
 
         Event* savedEvent = globalObject->currentEvent();
         globalObject->setCurrentEvent(event);
 
+        ASSERT(event->isErrorEvent());
+        ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
+
         MarkedArgumentBuffer args;
         args.append(jsString(exec, errorEvent->message()));
         args.append(jsString(exec, errorEvent->filename()));
@@ -103,7 +106,11 @@ void JSErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext,
             if (returnValue.getBoolean(retvalbool) && !retvalbool)
                 event->preventDefault();
         }
+
+        deref();
     }
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WORKERS)
similarity index 69%
rename from WebCore/bindings/js/JSErrorHandler.h
rename to WebCore/bindings/js/JSWorkerContextErrorHandler.h
index 957fd81daa057469b2112e11d7e704ad4e29d7ed..a188299038c9cdfe72286b71feaeb3a49c2a0d81 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef JSErrorHandler_h
-#define JSErrorHandler_h
+#ifndef JSWorkerContextErrorHandler_h
+#define JSWorkerContextErrorHandler_h
 
 #include "JSEventListener.h"
 
 namespace WebCore {
 
-class JSErrorHandler : public JSEventListener {
+class JSWorkerContextErrorHandler : public JSEventListener {
 public:
-    static PassRefPtr<JSErrorHandler> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
+    static PassRefPtr<JSWorkerContextErrorHandler> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
     {
-        return adoptRef(new JSErrorHandler(listener, wrapper, isAttribute, isolatedWorld));
+        return adoptRef(new JSWorkerContextErrorHandler(listener, wrapper, isAttribute, isolatedWorld));
     }
 
-    virtual ~JSErrorHandler();
+    virtual ~JSWorkerContextErrorHandler();
 
 private:
-    JSErrorHandler(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld);
+    JSWorkerContextErrorHandler(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld);
     virtual void handleEvent(ScriptExecutionContext*, Event*);
 };
 
 // Creates a JS EventListener for "onerror" event handler in worker context. It has custom implementation because
 // unlike other event listeners it accepts three parameters.
-inline PassRefPtr<JSErrorHandler> createJSErrorHandler(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper)
+inline PassRefPtr<JSWorkerContextErrorHandler> createJSWorkerContextErrorHandler(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper)
 {
     if (!listener.isObject())
         return 0;
 
-    return JSErrorHandler::create(asObject(listener), wrapper, true, currentWorld(exec));
+    return JSWorkerContextErrorHandler::create(asObject(listener), wrapper, true, currentWorld(exec));
 }
 
 } // namespace WebCore
 
-#endif // JSErrorHandler_h
+#endif // JSWorkerContextErrorHandler_h
index 52a6291af809b2b1c4c6be0ce7ab07d4f9774d93..132518fde80ea89079c66a5013ff0e4c1b8569df 100644 (file)
@@ -1709,9 +1709,9 @@ sub GenerateImplementation
                                 push(@implContent, "    JSDOMGlobalObject* globalObject = castedThis->globalObject();\n");
                             }
                             push(@implContent, "    $implClassName* imp = static_cast<$implClassName*>(static_cast<$className*>(thisObject)->impl());\n");
-                            if ((($interfaceName eq "DOMWindow") or ($interfaceName eq "WorkerContext")) and $name eq "onerror") {
-                                $implIncludes{"JSErrorHandler.h"} = 1;
-                                push(@implContent, "    imp->set$implSetterFunctionName(createJSErrorHandler(exec, value, thisObject));\n");
+                            if ($interfaceName eq "WorkerContext" and $name eq "onerror") {
+                                $implIncludes{"JSWorkerContextErrorHandler.h"} = 1;
+                                push(@implContent, "    imp->set$implSetterFunctionName(createJSWorkerContextErrorHandler(exec, value, thisObject));\n");
                             } else {
                                 push(@implContent, GenerateAttributeEventListenerCall($className, $implSetterFunctionName, $windowEventListener));
                             }
index 9093757c55fd4f133329ccf63f8d05c4ded8f6c2..d339d6a13b4fca390d6715830631c93e0a25bbd2 100644 (file)
@@ -1001,10 +1001,6 @@ END
                 $implIncludes{"V8EventListenerList.h"} = 1;
                 $implIncludes{"V8WorkerContextErrorHandler.h"} = 1;
                 push(@implContentDecls, "    imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8WorkerContextErrorHandler>(value, true)");
-            } elsif ($interfaceName eq "DOMWindow" and $attribute->signature->name eq "onerror") {
-                $implIncludes{"V8EventListenerList.h"} = 1;
-                $implIncludes{"V8WindowErrorHandler.h"} = 1;
-                push(@implContentDecls, "    imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8WindowErrorHandler>(value, true)");
             } else {
                 push(@implContentDecls, "    imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(value, true, ListenerFindOrCreate)");
             }
index d92822ceeac666945dba026b5c1fa096aff88101..e6871fdca397162022f2b0bfd519a7437654df51 100644 (file)
@@ -54,14 +54,7 @@ V8ConsoleMessage::V8ConsoleMessage(const String& string, const String& sourceID,
 
 void V8ConsoleMessage::dispatchNow(Page* page)
 {
-    ASSERT(page);
-
-    // Process any delayed messages to make sure that messages
-    // appear in the right order in the console.
-    processDelayed();
-
-    Console* console = page->mainFrame()->domWindow()->console();
-    console->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, m_string, m_lineNumber, m_sourceID);
+    dispatchNow(page, 0);
 }
 
 void V8ConsoleMessage::dispatchLater()
@@ -112,8 +105,8 @@ void V8ConsoleMessage::handler(v8::Handle<v8::Message> message, v8::Handle<v8::V
     Frame* frame = V8Proxy::retrieveFrameForEnteredContext();
     if (!frame)
         return;
-    Document* document = frame->document();
-    if (!document)
+    Page* page = frame->page();
+    if (!page)
         return;
 
     v8::Handle<v8::String> errorMessageString = message->Get();
@@ -129,7 +122,21 @@ void V8ConsoleMessage::handler(v8::Handle<v8::Message> message, v8::Handle<v8::V
     v8::Handle<v8::Value> resourceName = message->GetScriptResourceName();
     bool useURL = resourceName.IsEmpty() || !resourceName->IsString();
     String resourceNameString = useURL ? frame->document()->url() : toWebCoreString(resourceName);
-    document->reportException(errorMessage, message->GetLineNumber(), resourceNameString, callStack);
+    V8ConsoleMessage consoleMessage(errorMessage, resourceNameString, message->GetLineNumber());
+    consoleMessage.dispatchNow(page, callStack);
+}
+
+void V8ConsoleMessage::dispatchNow(Page* page, PassRefPtr<ScriptCallStack> callStack)
+{
+    ASSERT(page);
+
+    // Process any delayed messages to make sure that messages
+    // appear in the right order in the console.
+    processDelayed();
+
+    Console* console = page->mainFrame()->domWindow()->console();
+    MessageType messageType = callStack ? UncaughtExceptionMessageType : LogMessageType;
+    console->addMessage(JSMessageSource, messageType, ErrorMessageLevel, m_string, m_lineNumber, m_sourceID, callStack);
 }
 
 } // namespace WebCore
index 6183fc6867dc1a5d0a62cf263e07b6bbb8e9947b..97de24f1023ddcfc7e40b220f32ad8762061027a 100644 (file)
@@ -82,6 +82,8 @@ namespace WebCore {
         const String m_sourceID;
         const unsigned m_lineNumber;
 
+        void dispatchNow(Page*, PassRefPtr<ScriptCallStack>);
+
         // All delayed messages are stored in this vector. If the vector
         // is 0, there are no delayed messages.
         static Vector<V8ConsoleMessage>* m_delayedMessages;
diff --git a/WebCore/bindings/v8/V8WindowErrorHandler.cpp b/WebCore/bindings/v8/V8WindowErrorHandler.cpp
deleted file mode 100755 (executable)
index a74bad4..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "V8WindowErrorHandler.h"
-
-#include "ErrorEvent.h"
-#include "V8Binding.h"
-
-namespace WebCore {
-
-V8WindowErrorHandler::V8WindowErrorHandler(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext)
-    : V8EventListener(listener, isInline, worldContext)
-{
-}
-
-v8::Local<v8::Value> V8WindowErrorHandler::callListenerFunction(ScriptExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event)
-{
-    ASSERT(event->isErrorEvent());
-    ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
-    v8::Local<v8::Object> listener = getListenerObject(context);
-    v8::Local<v8::Value> returnValue;
-    if (!listener.IsEmpty() && listener->IsFunction()) {
-        v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
-        v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
-        v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message()), v8String(errorEvent->filename()), v8::Integer::New(errorEvent->lineno()) };
-        returnValue = callFunction->Call(thisValue, 3, parameters);
-        if (!returnValue.IsEmpty() && returnValue->IsBoolean() && !returnValue->BooleanValue())
-            event->preventDefault();
-    }
-    return returnValue;
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8WindowErrorHandler.h b/WebCore/bindings/v8/V8WindowErrorHandler.h
deleted file mode 100755 (executable)
index 167ca0d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef V8WindowErrorHandler_h
-#define V8WindowErrorHandler_h
-
-#include "V8CustomEventListener.h"
-#include <v8.h>
-#include <wtf/PassRefPtr.h>
-
-namespace WebCore {
-
-class V8WindowErrorHandler : public V8EventListener {
-public:
-    static PassRefPtr<V8WindowErrorHandler> create(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext)
-    {
-        return adoptRef(new V8WindowErrorHandler(listener, isInline, worldContext));
-    }
-
-private:
-    V8WindowErrorHandler(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext);
-
-    virtual v8::Local<v8::Value> callListenerFunction(ScriptExecutionContext*, v8::Handle<v8::Value> jsEvent, Event*);
-};
-
-} // namespace WebCore
-
-#endif // V8WindowErrorHandler_h
index eb258149f06665fe107b8fcb5b93b289407e68a9..cefb2faa7390894b35d65ad53f21a8fbc7dda561 100644 (file)
@@ -37,7 +37,6 @@
 
 #include "DedicatedWorkerContext.h"
 #include "Event.h"
-#include "ScriptCallStack.h"
 #include "SharedWorker.h"
 #include "SharedWorkerContext.h"
 #include "V8Binding.h"
@@ -73,7 +72,7 @@ static void v8MessageHandler(v8::Handle<v8::Message> message, v8::Handle<v8::Val
         String errorMessage = toWebCoreString(message->Get());
         int lineNumber = message->GetLineNumber();
         String sourceURL = toWebCoreString(message->GetScriptResourceName());
-        context->reportException(errorMessage, lineNumber, sourceURL, 0);
+        context->reportException(errorMessage, lineNumber, sourceURL);
     }
 
     isReportingException = false;
index 42e02e66d2e433b793b855b3be139d7ea98ca4d5..b56d3836d7e6bb1ac5d2c8c5ed630f07c276ef22 100644 (file)
 
 #include "WorkerScriptController.h"
 
-#include "DOMTimer.h"
-#include "ScriptCallStack.h"
+#include <v8.h>
+
 #include "ScriptSourceCode.h"
 #include "ScriptValue.h"
+#include "DOMTimer.h"
 #include "V8DOMMap.h"
 #include "V8Proxy.h"
 #include "V8WorkerContext.h"
@@ -45,7 +46,6 @@
 #include "WorkerContextExecutionProxy.h"
 #include "WorkerObjectProxy.h"
 #include "WorkerThread.h"
-#include <v8.h>
 
 namespace WebCore {
 
@@ -80,7 +80,7 @@ ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode,
         if (exception)
             *exception = state.exception;
         else
-            m_workerContext->reportException(state.errorMessage, state.lineNumber, state.sourceURL, 0);
+            m_workerContext->reportException(state.errorMessage, state.lineNumber, state.sourceURL);
     }
 
     return result;
index 743e28726fbe4b4d15e71cc31316342d99c5d1a8..775a2adf61e3b82f9329af990759d66464ed43a1 100644 (file)
 #include "RenderTextControl.h"
 #include "RenderView.h"
 #include "RenderWidget.h"
-#include "ScriptCallStack.h"
 #include "ScriptController.h"
 #include "ScriptElement.h"
 #include "ScriptEventListener.h"
@@ -2272,17 +2271,6 @@ KURL Document::virtualCompleteURL(const String& url) const
     return completeURL(url);
 }
 
-EventTarget* Document::errorEventTarget()
-{
-    return domWindow();
-}
-
-void Document::logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
-{
-    MessageType messageType = callStack ? UncaughtExceptionMessageType : LogMessageType;
-    addMessage(JSMessageSource, messageType, ErrorMessageLevel, errorMessage, lineNumber, sourceURL, callStack);
-}
-
 void Document::setURL(const KURL& url)
 {
     const KURL& newURL = url.isEmpty() ? blankURL() : url;
@@ -4672,10 +4660,15 @@ void Document::parseDNSPrefetchControlHeader(const String& dnsPrefetchControl)
     m_haveExplicitlyDisabledDNSPrefetch = true;
 }
 
-void Document::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
+void Document::reportException(const String& errorMessage, int lineNumber, const String& sourceURL)
+{
+    addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, errorMessage, lineNumber, sourceURL);
+}
+
+void Document::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
 {
     if (DOMWindow* window = domWindow())
-        window->console()->addMessage(source, type, level, message, lineNumber, sourceURL, callStack);
+        window->console()->addMessage(source, type, level, message, lineNumber, sourceURL);
 }
 
 struct PerformTaskContext : Noncopyable {
index 3b86b972f9e21757460a25d1bab6ce024916174d..f1fe44cbb85f387aee8a8afaea0bff03240c4099 100644 (file)
@@ -930,7 +930,8 @@ public:
     bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; }
     void parseDNSPrefetchControlHeader(const String&);
 
-    virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
+    virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL);
+    virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
     virtual void postTask(PassOwnPtr<Task>); // Executes the task on context's thread asynchronously.
 
 #if USE(JSC)
@@ -1115,9 +1116,6 @@ private:
     virtual const KURL& virtualURL() const; // Same as url(), but needed for ScriptExecutionContext to implement it without a performance loss for direct calls.
     virtual KURL virtualCompleteURL(const String&) const; // Same as completeURL() for the same reason as above.
 
-    virtual EventTarget* errorEventTarget();
-    virtual void logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
-
     void initDNSPrefetch();
 
     String encoding() const;
index c5988367c0279a429fc6ce2819e54ef5b86f405e..2627d0154e623abaad91d49baa9df1986d293d50 100644 (file)
@@ -30,6 +30,8 @@
 
 #include "config.h"
 
+#if ENABLE(WORKERS)
+
 #include "ErrorEvent.h"
 
 #include "EventNames.h"
@@ -70,3 +72,5 @@ bool ErrorEvent::isErrorEvent() const
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WORKERS)
index 719ca2d5e1974b65a63893fe26106b6f51c73aad..f81530aee620b89217e164ccfaba730f1db61140 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef ErrorEvent_h
 #define ErrorEvent_h
 
+#if ENABLE(WORKERS)
+
 #include "Event.h"
 #include "PlatformString.h"
 
@@ -67,4 +69,6 @@ namespace WebCore {
 
 } // namespace WebCore
 
+#endif // ENABLE(WORKERS)
+
 #endif // ErrorEvent_h
index fc6d282937947d1fb74e8719f684aed13fc245c4..a949fd523e5ee1983fd8a812eb3d24698becf26a 100644 (file)
@@ -203,10 +203,12 @@ bool Event::isIDBSuccessEvent() const
 }
 #endif
 
+#if ENABLE(WORKERS)
 bool Event::isErrorEvent() const
 {
     return false;
 }
+#endif
 
 #if ENABLE(TOUCH_EVENTS)
 bool Event::isTouchEvent() const
index 9aef233dc4245f2d35432033b07252855e86ad63..f05d36c9000015226a680c121640bff47ae22483 100644 (file)
@@ -132,7 +132,9 @@ namespace WebCore {
 #if ENABLE(WEB_AUDIO)
         virtual bool isAudioProcessingEvent() const;
 #endif
+#if ENABLE(WORKERS)
         virtual bool isErrorEvent() const;
+#endif
 #if ENABLE(TOUCH_EVENTS)
         virtual bool isTouchEvent() const;
 #endif
index f498be005034d12cbbd5b8a70f49e15eb043e48c..bfda17b3f1b4d93dabd8f6410db765b50367dec8 100644 (file)
 #include "Database.h"
 #include "DatabaseTask.h"
 #include "DatabaseThread.h"
-#include "ErrorEvent.h"
-#include "EventListener.h"
-#include "EventTarget.h"
 #include "FileThread.h"
 #include "MessagePort.h"
-#include "ScriptCallStack.h"
 #include "SecurityOrigin.h"
 #include "ThreadableBlobRegistry.h"
 #include "WorkerContext.h"
 #include "WorkerThread.h"
 #include <wtf/MainThread.h>
 #include <wtf/PassRefPtr.h>
-#include <wtf/Vector.h>
 
 #if USE(JSC)
 #include "JSDOMWindow.h"
@@ -66,25 +61,9 @@ public:
     }
 };
 
-class ScriptExecutionContext::PendingException : public Noncopyable {
-public:
-    PendingException(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
-        : m_errorMessage(errorMessage)
-        , m_lineNumber(lineNumber)
-        , m_sourceURL(sourceURL)
-        , m_callStack(callStack)
-    {
-    }
-    String m_errorMessage;
-    int m_lineNumber;
-    String m_sourceURL;
-    RefPtr<ScriptCallStack> m_callStack;
-};
-
 ScriptExecutionContext::ScriptExecutionContext()
-    : m_inDispatchErrorEvent(false)
 #if ENABLE(DATABASE)
-    , m_hasOpenDatabases(false)
+    : m_hasOpenDatabases(false)
 #endif
 {
 }
@@ -264,43 +243,6 @@ void ScriptExecutionContext::setSecurityOrigin(PassRefPtr<SecurityOrigin> securi
     m_securityOrigin = securityOrigin;
 }
 
-void ScriptExecutionContext::reportException(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
-{
-    if (m_inDispatchErrorEvent) {
-        if (!m_pendingExceptions)
-            m_pendingExceptions = adoptPtr(new Vector<OwnPtr<PendingException> >());
-        m_pendingExceptions->append(adoptPtr(new PendingException(errorMessage, lineNumber, sourceURL, callStack)));
-        return;
-    }
-
-    // First report the original exception and only then all the nested ones.
-    if (!dispatchErrorEvent(errorMessage, lineNumber, sourceURL))
-        logExceptionToConsole(errorMessage, lineNumber, sourceURL, callStack);
-
-    if (!m_pendingExceptions)
-        return;
-
-    for (size_t i = 0; i < m_pendingExceptions->size(); i++) {
-        PendingException* e = m_pendingExceptions->at(i).get();
-        logExceptionToConsole(e->m_errorMessage, e->m_lineNumber, e->m_sourceURL, e->m_callStack);
-    }
-    m_pendingExceptions.clear();
-}
-
-bool ScriptExecutionContext::dispatchErrorEvent(const String& errorMessage, int lineNumber, const String& sourceURL)
-{
-    EventTarget* target = errorEventTarget();
-    if (!target)
-        return false;
-
-    ASSERT(!m_inDispatchErrorEvent);
-    m_inDispatchErrorEvent = true;
-    RefPtr<ErrorEvent> errorEvent = ErrorEvent::create(errorMessage, sourceURL, lineNumber);
-    target->dispatchEvent(errorEvent);
-    m_inDispatchErrorEvent = false;
-    return errorEvent->defaultPrevented();
-}
-
 void ScriptExecutionContext::addTimeout(int timeoutId, DOMTimer* timer)
 {
     ASSERT(!m_timeouts.contains(timeoutId));
index 6fb01bb2f97b1e60143e57145eee4e0b0a788fd5..b46a0f4f5ddd2b0ee59479a79d03e7bfd35e9648 100644 (file)
@@ -33,7 +33,6 @@
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
@@ -53,14 +52,11 @@ namespace WebCore {
     class DatabaseThread;
 #endif
     class DOMTimer;
-    class EventListener;
-    class EventTarget;
 #if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
     class FileThread;
 #endif
     class MessagePort;
     class SecurityOrigin;
-    class ScriptCallStack;
 #if ENABLE(INSPECTOR)
     class InspectorController;
 #endif
@@ -95,8 +91,8 @@ namespace WebCore {
         virtual InspectorController* inspectorController() const { return 0; }
 #endif
 
-        void reportException(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
-        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>) = 0;
+        virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL) = 0;
+        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL) = 0;
 
         // Active objects are not garbage collected even if inaccessible, e.g. because their activity may result in callbacks being invoked.
         bool canSuspendActiveDOMObjects();
@@ -158,10 +154,6 @@ namespace WebCore {
         virtual const KURL& virtualURL() const = 0;
         virtual KURL virtualCompleteURL(const String&) const = 0;
 
-        virtual EventTarget* errorEventTarget() = 0;
-        virtual void logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>) = 0;
-        bool dispatchErrorEvent(const String& errorMessage, int lineNumber, const String& sourceURL);
-
         void closeMessagePorts();
 
         RefPtr<SecurityOrigin> m_securityOrigin;
@@ -179,10 +171,6 @@ namespace WebCore {
         virtual void refScriptExecutionContext() = 0;
         virtual void derefScriptExecutionContext() = 0;
 
-        bool m_inDispatchErrorEvent;
-        class PendingException;
-        OwnPtr<Vector<OwnPtr<PendingException> > > m_pendingExceptions;
-
 #if ENABLE(DATABASE)
         RefPtr<DatabaseThread> m_databaseThread;
         bool m_hasOpenDatabases; // This never changes back to false, even after the database thread is closed.
index e15d079062dbc211aa368b2366bc45787eac0a9e..358a742cb040524abd1dbc65abdab6a5881825f2 100644 (file)
@@ -41,7 +41,6 @@
 #include "EventNames.h"
 #include "Logging.h"
 #include "MessageEvent.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "ThreadableWebSocketChannel.h"
 #include "WebSocketChannel.h"
@@ -117,32 +116,32 @@ void WebSocket::connect(const KURL& url, const String& protocol, ExceptionCode&
     m_protocol = protocol;
 
     if (!m_url.isValid()) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid url for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid url for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
 
     if (!m_url.protocolIs("ws") && !m_url.protocolIs("wss")) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong url scheme for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong url scheme for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
     if (m_url.hasFragmentIdentifier()) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "URL has fragment component " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "URL has fragment component " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
     if (!isValidProtocolString(m_protocol)) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong protocol for WebSocket '" + encodeProtocolString(m_protocol) + "'", 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong protocol for WebSocket '" + encodeProtocolString(m_protocol) + "'", 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
     if (!portAllowed(url)) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket port ", String::number(url.port()), " blocked"), 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket port ", String::number(url.port()), " blocked"), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SECURITY_ERR;
         return;
index 785f124f6043fb6dc452bea99d74ede4bbcf7835..01c2beffda52a565c08b84e7ccd1d3c9ae670cf0 100644 (file)
@@ -41,7 +41,6 @@
 #include "Page.h"
 #include "PlatformString.h"
 #include "ProgressTracker.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "SocketStreamError.h"
 #include "SocketStreamHandle.h"
@@ -156,7 +155,7 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
         InspectorInstrumentation::willSendWebSocketHandshakeRequest(m_context, m_identifier, m_handshake.clientHandshakeRequest());
     CString handshakeMessage = m_handshake.clientHandshakeMessage();
     if (!handle->send(handshakeMessage.data(), handshakeMessage.length())) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin());
         handle->close();
     }
 }
@@ -240,7 +239,7 @@ bool WebSocketChannel::appendToBuffer(const char* data, size_t len)
         m_bufferSize = newBufferSize;
         return true;
     }
-    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket frame (at ", String::number(static_cast<unsigned long>(newBufferSize)), " bytes) is too long."), 0, m_handshake.clientOrigin(), 0);
+    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket frame (at ", String::number(static_cast<unsigned long>(newBufferSize)), " bytes) is too long."), 0, m_handshake.clientOrigin());
     return false;
 }
 
index ed988345e0774246d3ebed25c635831fc0ed92d4..50490988080f9a5fe6a81e16c9178a283f614639 100644 (file)
@@ -41,7 +41,6 @@
 #include "HTTPHeaderMap.h"
 #include "KURL.h"
 #include "Logging.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "SecurityOrigin.h"
 
@@ -320,7 +319,7 @@ int WebSocketHandshake::readServerHandshake(const char* header, size_t len)
     m_response.setStatusText(statusText);
     if (statusCode != 101) {
         m_mode = Failed;
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("Unexpected response code: ", String::number(statusCode)), 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("Unexpected response code: ", String::number(statusCode)), 0, clientOrigin());
         return len;
     }
     m_mode = Normal;
@@ -450,19 +449,19 @@ int WebSocketHandshake::readStatusLine(const char* header, size_t headerLength,
 
     const char* end = p + 1;
     if (end - header > INT_MAX) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line is too long: " + trimConsoleMessage(header, maxConsoleMessageSize + 1), 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line is too long: " + trimConsoleMessage(header, maxConsoleMessageSize + 1), 0, clientOrigin());
         return INT_MAX;
     }
     int lineLength = end - header;
 
     if (!space1 || !space2) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + trimConsoleMessage(header, lineLength - 1), 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + trimConsoleMessage(header, lineLength - 1), 0, clientOrigin());
         return lineLength;
     }
 
     // The line must end with "\r\n".
     if (*(end - 2) != '\r') {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line does not end with CRLF", 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line does not end with CRLF", 0, clientOrigin());
         return lineLength;
     }
 
@@ -471,7 +470,7 @@ int WebSocketHandshake::readStatusLine(const char* header, size_t headerLength,
         return lineLength;
     for (int i = 0; i < 3; ++i)
         if (statusCodeString[i] < '0' || statusCodeString[i] > '9') {
-            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid status code: " + statusCodeString, 0, clientOrigin(), 0);
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid status code: " + statusCodeString, 0, clientOrigin());
             return lineLength;
         }
 
@@ -499,13 +498,13 @@ const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* e
                 if (name.isEmpty()) {
                     if (p + 1 < end && *(p + 1) == '\n')
                         return p + 2;
-                    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF at " + trimConsoleMessage(p, end - p), 0, clientOrigin(), 0);
+                    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF at " + trimConsoleMessage(p, end - p), 0, clientOrigin());
                     return 0;
                 }
-                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected CR in name at " + trimConsoleMessage(name.data(), name.size()), 0, clientOrigin(), 0);
+                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected CR in name at " + trimConsoleMessage(name.data(), name.size()), 0, clientOrigin());
                 return 0;
             case '\n':
-                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in name at " + trimConsoleMessage(name.data(), name.size()), 0, clientOrigin(), 0);
+                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in name at " + trimConsoleMessage(name.data(), name.size()), 0, clientOrigin());
                 return 0;
             case ':':
                 break;
@@ -526,7 +525,7 @@ const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* e
             case '\r':
                 break;
             case '\n':
-                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in value at " + trimConsoleMessage(value.data(), value.size()), 0, clientOrigin(), 0);
+                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in value at " + trimConsoleMessage(value.data(), value.size()), 0, clientOrigin());
                 return 0;
             default:
                 value.append(*p);
@@ -537,17 +536,17 @@ const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* e
             }
         }
         if (p >= end || *p != '\n') {
-            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF after value at " + trimConsoleMessage(p, end - p), 0, clientOrigin(), 0);
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF after value at " + trimConsoleMessage(p, end - p), 0, clientOrigin());
             return 0;
         }
         AtomicString nameStr(String::fromUTF8(name.data(), name.size()));
         String valueStr = String::fromUTF8(value.data(), value.size());
         if (nameStr.isNull()) {
-            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header name", 0, clientOrigin(), 0);
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header name", 0, clientOrigin());
             return 0;
         }
         if (valueStr.isNull()) {
-            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header value", 0, clientOrigin(), 0);
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header value", 0, clientOrigin());
             return 0;
         }
         LOG(Network, "name=%s value=%s", nameStr.string().utf8().data(), valueStr.utf8().data());
@@ -571,24 +570,24 @@ void WebSocketHandshake::processHeaders()
 bool WebSocketHandshake::checkResponseHeaders()
 {
     if (m_wsOrigin.isNull()) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'sec-websocket-origin' header is missing", 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'sec-websocket-origin' header is missing", 0, clientOrigin());
         return false;
     }
     if (m_wsLocation.isNull()) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'sec-websocket-location' header is missing", 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'sec-websocket-location' header is missing", 0, clientOrigin());
         return false;
     }
 
     if (clientOrigin() != m_wsOrigin) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: origin mismatch: " + clientOrigin() + " != " + m_wsOrigin, 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: origin mismatch: " + clientOrigin() + " != " + m_wsOrigin, 0, clientOrigin());
         return false;
     }
     if (clientLocation() != m_wsLocation) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: location mismatch: " + clientLocation() + " != " + m_wsLocation, 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: location mismatch: " + clientLocation() + " != " + m_wsLocation, 0, clientOrigin());
         return false;
     }
     if (!m_clientProtocol.isEmpty() && m_clientProtocol != m_wsProtocol) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: protocol mismatch: " + m_clientProtocol + " != " + m_wsProtocol, 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: protocol mismatch: " + m_clientProtocol + " != " + m_wsProtocol, 0, clientOrigin());
         return false;
     }
     return true;
index 8e1c106515bc8989d26484ff4dba08f6696b03fa..4a8e94731baa620dbe9df5d340977b099b0a0644 100644 (file)
@@ -42,7 +42,6 @@
 #include "MessagePort.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
-#include "ScriptCallStack.h"
 #include "SecurityOrigin.h"
 #include "SecurityOriginHash.h"
 #include "SharedWorker.h"
@@ -156,7 +155,7 @@ void SharedWorkerProxy::postTaskForModeToWorkerContext(PassOwnPtr<ScriptExecutio
 
 static void postExceptionTask(ScriptExecutionContext* context, const String& errorMessage, int lineNumber, const String& sourceURL)
 {
-    context->reportException(errorMessage, lineNumber, sourceURL, 0);
+    context->reportException(errorMessage, lineNumber, sourceURL);
 }
 
 void SharedWorkerProxy::postExceptionToWorkerObject(const String& errorMessage, int lineNumber, const String& sourceURL)
@@ -168,7 +167,7 @@ void SharedWorkerProxy::postExceptionToWorkerObject(const String& errorMessage,
 
 static void postConsoleMessageTask(ScriptExecutionContext* document, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
 {
-    document->addMessage(source, type, level, message, lineNumber, sourceURL, 0);
+    document->addMessage(source, type, level, message, lineNumber, sourceURL);
 }
 
 void SharedWorkerProxy::postConsoleMessageToWorkerObject(MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
index 03defc706ab26f63e4177ab76a37edc244643710..345e5b760472bc1b2f82b9c7ec579cc0d80d4d5b 100644 (file)
@@ -46,7 +46,6 @@
 #include "KURL.h"
 #include "MessagePort.h"
 #include "NotImplemented.h"
-#include "ScriptCallStack.h"
 #include "ScriptSourceCode.h"
 #include "ScriptValue.h"
 #include "SecurityOrigin.h"
@@ -103,6 +102,7 @@ WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThr
     , m_script(new WorkerScriptController(this))
     , m_thread(thread)
     , m_closing(false)
+    , m_reportingException(false)
 {
     setSecurityOrigin(SecurityOrigin::create(url));
 }
@@ -259,17 +259,23 @@ void WorkerContext::importScripts(const Vector<String>& urls, ExceptionCode& ec)
     }
 }
 
-EventTarget* WorkerContext::errorEventTarget()
+void WorkerContext::reportException(const String& errorMessage, int lineNumber, const String& sourceURL)
 {
-    return this;
-}
-
-void WorkerContext::logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>)
-{
-    thread()->workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, sourceURL);
+    bool errorHandled = false;
+    if (!m_reportingException) {
+        if (onerror()) {
+            m_reportingException = true;
+            RefPtr<ErrorEvent> errorEvent(ErrorEvent::create(errorMessage, sourceURL, lineNumber));
+            onerror()->handleEvent(this, errorEvent.get());
+            errorHandled = errorEvent->defaultPrevented();
+            m_reportingException = false;
+        }
+    }
+    if (!errorHandled)
+        thread()->workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, sourceURL);
 }
 
-void WorkerContext::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>)
+void WorkerContext::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
 {
     thread()->workerReportingProxy().postConsoleMessageToWorkerObject(source, type, level, message, lineNumber, sourceURL);
 }
index e42b82ae697ffcda840cb84e684a58acb12e250f..5d15d942fd1a316673b99f65fd8c6ed9dae5fd93 100644 (file)
@@ -100,7 +100,8 @@ namespace WebCore {
         void clearInterval(int timeoutId);
 
         // ScriptExecutionContext
-        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
+        virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL);
+        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
 
 #if ENABLE(NOTIFICATIONS)
         NotificationCenter* webkitNotifications() const;
@@ -173,9 +174,6 @@ namespace WebCore {
         virtual const KURL& virtualURL() const;
         virtual KURL virtualCompleteURL(const String&) const;
 
-        virtual EventTarget* errorEventTarget();
-        virtual void logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
-
         KURL m_url;
         String m_userAgent;
 
@@ -189,6 +187,7 @@ namespace WebCore {
         mutable RefPtr<NotificationCenter> m_notifications;
 #endif
         bool m_closing;
+        bool m_reportingException;
         EventTargetData m_eventTargetData;
 
         HashSet<Observer*> m_workerObservers;
index 735d14318640848f8fe617c65444313622c0b8d5..10700c64ef69e5a5f37d01afb24436f5c5fce1a1 100644 (file)
@@ -40,7 +40,6 @@
 #include "ExceptionCode.h"
 #include "InspectorController.h"
 #include "MessageEvent.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "Worker.h"
 
@@ -132,7 +131,7 @@ private:
 
         bool errorHandled = !workerObject->dispatchEvent(ErrorEvent::create(m_errorMessage, m_sourceURL, m_lineNumber));
         if (!errorHandled)
-            context->reportException(m_errorMessage, m_lineNumber, m_sourceURL, 0);
+            context->reportException(m_errorMessage, m_lineNumber, m_sourceURL);
     }
 
     String m_errorMessage;
@@ -284,7 +283,7 @@ static void postConsoleMessageTask(ScriptExecutionContext* context, WorkerMessag
 {
     if (messagingProxy->askedToTerminate())
         return;
-    context->addMessage(source, type, level, message, lineNumber, sourceURL, 0);
+    context->addMessage(source, type, level, message, lineNumber, sourceURL);
 }
 
 void WorkerMessagingProxy::postConsoleMessageToWorkerObject(MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
index f5b2d8d9c5557ca9d20ddd0f944c7451eb2e2791..fc7eb9e2d4955a269250e49da2a59f3fdd1d8a48 100644 (file)
@@ -39,7 +39,6 @@
 #include "InspectorInstrumentation.h"
 #include "ResourceError.h"
 #include "ResourceRequest.h"
-#include "ScriptCallStack.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
 #include "SharedBuffer.h"
@@ -812,7 +811,7 @@ static void reportUnsafeUsage(ScriptExecutionContext* context, const String& mes
         return;
     // FIXME: It's not good to report the bad usage without indicating what source line it came from.
     // We should pass additional parameters so we can tell the console where the mistake occurred.
-    context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, 1, String(), 0);
+    context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, 1, String());
 }
 
 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const String& value, ExceptionCode& ec)
index 9eec64a0ac2e047ff9a9f0ec153652a415692cbc..431acb581a715e741937db8eb98d0c83da757e1e 100644 (file)
@@ -1,3 +1,16 @@
+2010-12-13  Yury Semikhatsky  <yurys@chromium.org>
+
+        Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
+
+        REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
+        https://bugs.webkit.org/show_bug.cgi?id=50950
+
+        * src/WebWorkerClientImpl.cpp:
+        (WebKit::WebWorkerClientImpl::postExceptionToWorkerObject):
+        (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObject):
+        (WebKit::WebWorkerClientImpl::postExceptionToWorkerObjectTask):
+        (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask):
+
 2010-12-13  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index f90e7e8ad0211f4a217ffa79aff091024f6b0c6b..18282e3416b73de2ecd04632d6bce752fdd329a6 100644 (file)
@@ -41,7 +41,6 @@
 #include "MessageEvent.h"
 #include "MessagePort.h"
 #include "MessagePortChannel.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "Worker.h"
 #include "WorkerContext.h"
@@ -248,7 +247,7 @@ void WebWorkerClientImpl::postExceptionToWorkerObject(const WebString& errorMess
                                                                 sourceURL,
                                                                 lineNumber));
     if (unhandled)
-        m_scriptExecutionContext->reportException(errorMessage, lineNumber, sourceURL, 0);
+        m_scriptExecutionContext->reportException(errorMessage, lineNumber, sourceURL);
 }
 
 void WebWorkerClientImpl::postConsoleMessageToWorkerObject(int destination,
@@ -275,7 +274,7 @@ void WebWorkerClientImpl::postConsoleMessageToWorkerObject(int destination,
                                          static_cast<MessageType>(messageType),
                                          static_cast<MessageLevel>(messageLevel),
                                          String(message), lineNumber,
-                                         String(sourceURL), 0);
+                                         String(sourceURL));
 }
 
 void WebWorkerClientImpl::postConsoleMessageToWorkerObject(int sourceId,
@@ -382,7 +381,9 @@ void WebWorkerClientImpl::postExceptionToWorkerObjectTask(
                                                                       sourceURL,
                                                                       lineNumber));
     if (!handled)
-        thisPtr->m_scriptExecutionContext->reportException(errorMessage, lineNumber, sourceURL, 0);
+        thisPtr->m_scriptExecutionContext->reportException(errorMessage,
+                                                           lineNumber,
+                                                           sourceURL);
 }
 
 void WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask(ScriptExecutionContext* context,
@@ -397,7 +398,8 @@ void WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask(ScriptExecutionCo
     thisPtr->m_scriptExecutionContext->addMessage(static_cast<MessageSource>(sourceId),
                                                   static_cast<MessageType>(messageType),
                                                   static_cast<MessageLevel>(messageLevel),
-                                                  message, lineNumber, sourceURL, 0);
+                                                  message, lineNumber,
+                                                  sourceURL);
 }
 
 void WebWorkerClientImpl::confirmMessageFromWorkerObjectTask(ScriptExecutionContext* context,