Title: [140527] branches/chromium/1364/Source/WebCore/page/Console.cpp
Revision
140527
Author
[email protected]
Date
2013-01-23 02:03:22 -0800 (Wed, 23 Jan 2013)

Log Message

Merge 139927
> Fix a crash when printing console messages to STDOUT.
> 
> https://bugs.webkit.org/show_bug.cgi?id=107039
> 
> Reviewed by Joseph Pecoraro.
> 
> * page/Console.cpp:
> (WebCore::internalAddMessage): Don't release the RefPtr early. Also log the line number
> and convert non-string arguments to strings when printing them.
> 

[email protected]
Review URL: https://codereview.chromium.org/12042046

Modified Paths

Diff

Modified: branches/chromium/1364/Source/WebCore/page/Console.cpp (140526 => 140527)


--- branches/chromium/1364/Source/WebCore/page/Console.cpp	2013-01-23 09:56:19 UTC (rev 140526)
+++ branches/chromium/1364/Source/WebCore/page/Console.cpp	2013-01-23 10:03:22 UTC (rev 140527)
@@ -201,7 +201,7 @@
 
     String message;
     bool gotMessage = arguments->getFirstArgumentAsString(message);
-    InspectorInstrumentation::addMessageToConsole(page, ConsoleAPIMessageSource, type, level, message, state, arguments.release());
+    InspectorInstrumentation::addMessageToConsole(page, ConsoleAPIMessageSource, type, level, message, state, arguments);
 
     if (!page->settings() || page->settings()->privateBrowsingEnabled())
         return;
@@ -210,14 +210,14 @@
         page->chrome()->client()->addMessageToConsole(ConsoleAPIMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL());
 
     if (printExceptions) {
-        printSourceURLAndLine(lastCaller.sourceURL(), 0);
+        printSourceURLAndLine(lastCaller.sourceURL(), lastCaller.lineNumber());
         printMessageSourceAndLevelPrefix(ConsoleAPIMessageSource, level);
 
         for (unsigned i = 0; i < arguments->argumentCount(); ++i) {
-            String argAsString;
-            if (arguments->argumentAt(i).getString(arguments->globalState(), argAsString))
-                printf(" %s", argAsString.utf8().data());
+            String argAsString = arguments->argumentAt(i).toString(arguments->globalState());
+            printf(" %s", argAsString.utf8().data());
         }
+
         printf("\n");
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to