[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

pfeldman at chromium.org pfeldman at chromium.org
Wed Dec 22 12:13:39 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5bd650a8e5e505b68308a963c30f123aa34583c0
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 17 15:55:56 2010 +0000

    2010-08-17  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: [CRASH] Console formatting crashes after cross-domain navigation.
            https://bugs.webkit.org/show_bug.cgi?id=44103
    
            * http/tests/inspector-enabled/resources/console-log-frame-before-navigation.html:
    2010-08-17  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: [CRASH] Console formatting crashes after cross-domain navigation.
            https://bugs.webkit.org/show_bug.cgi?id=44103
    
            * bindings/js/JSInjectedScriptHostCustom.cpp:
            (WebCore::InjectedScriptHost::injectedScriptFor):
            * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
            (WebCore::InjectedScriptHost::injectedScriptFor):
            * inspector/ConsoleMessage.cpp:
            (WebCore::ConsoleMessage::addToFrontend):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65506 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b838e16..d9767f5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-08-17  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: [CRASH] Console formatting crashes after cross-domain navigation.
+        https://bugs.webkit.org/show_bug.cgi?id=44103
+
+        * http/tests/inspector-enabled/resources/console-log-frame-before-navigation.html:
+
 2010-08-17  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/LayoutTests/http/tests/inspector-enabled/console-log-before-frame-navigation-expected.txt b/LayoutTests/http/tests/inspector-enabled/console-log-before-frame-navigation-expected.txt
index eb725c5..d0505e8 100644
--- a/LayoutTests/http/tests/inspector-enabled/console-log-before-frame-navigation-expected.txt
+++ b/LayoutTests/http/tests/inspector-enabled/console-log-before-frame-navigation-expected.txt
@@ -1,10 +1,10 @@
-CONSOLE MESSAGE: line 5: 2010
+CONSOLE MESSAGE: line 5: Console message (C) %d with element
 Tests that Web Inspector won't crash if there are messages written to console from a frame which has already navigated to a page from a different domain.
 
 
 Received console messages:
 Message[0]:
 URL: http://127.0.0.1:8000/inspector-enabled/resources/console-log-frame-before-navigation.html
-Message: 2010 HTMLHtmlElement
+Message: Console message (C) %d with element
 TEST COMPLETE.
 
diff --git a/LayoutTests/http/tests/inspector-enabled/resources/console-log-frame-before-navigation.html b/LayoutTests/http/tests/inspector-enabled/resources/console-log-frame-before-navigation.html
index f9a9079..6e7ff81 100644
--- a/LayoutTests/http/tests/inspector-enabled/resources/console-log-frame-before-navigation.html
+++ b/LayoutTests/http/tests/inspector-enabled/resources/console-log-frame-before-navigation.html
@@ -2,10 +2,12 @@
 <head>
 <script>
 function handleLoad() {
-  console.log(2010, document.documentElement);
+  console.log("Console message (C) %d with element", 2010, document.documentElement);
 
   setTimeout(function() {
-    document.location = "console-log-frame-after-navigation.html";
+    // Note that localhost is different from the 127.0.0.1 that tests are runnung against. So this navigation
+    // is in fact cross-domain.
+    document.location = "http://localhost:8000/inspector-enabled/resources/console-log-frame-after-navigation.html";
   }, 0);
 }
 </script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b8bae69..b7ec1a3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-17  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: [CRASH] Console formatting crashes after cross-domain navigation.
+        https://bugs.webkit.org/show_bug.cgi?id=44103
+
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::injectedScriptFor):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::injectedScriptFor):
+        * inspector/ConsoleMessage.cpp:
+        (WebCore::ConsoleMessage::addToFrontend):
+
 2010-08-17  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index 0c891a3..06360fb 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -183,6 +183,9 @@ InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* scriptState)
     if (injectedScript)
         return InjectedScript(ScriptObject(scriptState, injectedScript));
 
+    if (!canAccessInspectedWindow(scriptState))
+        return InjectedScript();
+
     ASSERT(!m_injectedScriptSource.isEmpty()); 
     pair<long, ScriptObject> injectedScriptObject = injectScript(m_injectedScriptSource, scriptState);
     globalObject->setInjectedScript(injectedScriptObject.second.jsObject());
diff --git a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index 435cf73..1b069cf 100644
--- a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -211,6 +211,9 @@ InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* inspectedScrip
     if (!val.IsEmpty() && val->IsObject())
         return InjectedScript(ScriptObject(inspectedScriptState, v8::Local<v8::Object>::Cast(val)));
 
+    if (!canAccessInspectedWindow(inspectedScriptState))
+        return InjectedScript();
+
     ASSERT(!m_injectedScriptSource.isEmpty());
     pair<long, ScriptObject> injectedScript = injectScript(m_injectedScriptSource, inspectedScriptState);
     InjectedScript result(injectedScript.second);
diff --git a/WebCore/inspector/ConsoleMessage.cpp b/WebCore/inspector/ConsoleMessage.cpp
index ea168f6..6f19d2a 100644
--- a/WebCore/inspector/ConsoleMessage.cpp
+++ b/WebCore/inspector/ConsoleMessage.cpp
@@ -126,17 +126,19 @@ void ConsoleMessage::addToFrontend(RemoteInspectorFrontend* frontend, InjectedSc
     jsonObj->setNumber("repeatCount", static_cast<int>(m_repeatCount));
     jsonObj->setString("message", m_message);
     if (!m_arguments.isEmpty()) {
-        RefPtr<InspectorArray> jsonArgs = InspectorArray::create();
         InjectedScript injectedScript = injectedScriptHost->injectedScriptFor(m_scriptState.get());
-        for (unsigned i = 0; i < m_arguments.size(); ++i) {
-            RefPtr<InspectorValue> inspectorValue = injectedScript.wrapForConsole(m_arguments[i]);
-            if (!inspectorValue) {
-                ASSERT_NOT_REACHED();
-                return;
+        if (!injectedScript.hasNoValue()) {
+            RefPtr<InspectorArray> jsonArgs = InspectorArray::create();
+            for (unsigned i = 0; i < m_arguments.size(); ++i) {
+                RefPtr<InspectorValue> inspectorValue = injectedScript.wrapForConsole(m_arguments[i]);
+                if (!inspectorValue) {
+                    ASSERT_NOT_REACHED();
+                    return;
+                }
+                jsonArgs->pushValue(inspectorValue);
             }
-            jsonArgs->pushValue(inspectorValue);
+            jsonObj->setArray("parameters", jsonArgs);
         }
-        jsonObj->setArray("parameters", jsonArgs);
     }
     if (!m_frames.isEmpty()) {
         RefPtr<InspectorArray> frames = InspectorArray::create();
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 54d7c78..8d96005 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -136,7 +136,7 @@ public:
     void connectFrontend();
     void disconnectFrontend();
 
-    void addMessageToConsole(MessageSource, MessageType, MessageLevel, ScriptCallStack*, const String& message = String());
+    void addMessageToConsole(MessageSource, MessageType, MessageLevel, ScriptCallStack*, const String& message);
     void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);
     void clearConsoleMessages();
     const Vector<OwnPtr<ConsoleMessage> >& consoleMessages() const { return m_consoleMessages; }
diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp
index 3d8a7de..9cc8d5d 100644
--- a/WebCore/page/Console.cpp
+++ b/WebCore/page/Console.cpp
@@ -185,7 +185,7 @@ void Console::addMessage(MessageType type, MessageLevel level, ScriptCallStack*
         page->chrome()->client()->addMessageToConsole(JSMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL().prettyURL());
 
 #if ENABLE(INSPECTOR)
-    page->inspectorController()->addMessageToConsole(JSMessageSource, type, level, callStack);
+    page->inspectorController()->addMessageToConsole(JSMessageSource, type, level, callStack, message);
 #endif
 
     if (!Console::shouldPrintExceptions())

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list