<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[196594] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/196594">196594</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-02-15 13:23:23 -0800 (Mon, 15 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Web Workers have no access to console for debugging
https://bugs.webkit.org/show_bug.cgi?id=26237

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2016-02-15
Reviewed by Timothy Hatcher.

LayoutTests/imported/w3c:

* web-platform-tests/streams-api/readable-streams/garbage-collection-expected.txt:
Update test results for a console.warn message that the test produces from a Worker.

Source/JavaScriptCore:

* inspector/ConsoleMessage.h:
Add accessor for MessageLevel.

Source/WebCore:

This adds the most basic console message support to Workers.
Messages logged from workers get surfaced through the Page's console.
This lacks support for logging and interacting with arguments,
which would be addressed when adding more complete Worker
debugging tools.

Test: inspector/console/messageAdded-from-worker.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::~WorkerScriptController):
(WebCore::WorkerScriptController::initScript):
Set the ConsoleClient for the Worker's global object. We route
the messages to the Page's console.

* bindings/js/WorkerScriptController.h:
* workers/WorkerConsoleClient.h: Added.
* workers/WorkerConsoleClient.cpp: Added.
(WebCore::WorkerConsoleClient::WorkerConsoleClient):
(WebCore::WorkerConsoleClient::~WorkerConsoleClient):
(WebCore::WorkerConsoleClient::profile):
(WebCore::WorkerConsoleClient::profileEnd):
(WebCore::WorkerConsoleClient::count):
(WebCore::WorkerConsoleClient::time):
(WebCore::WorkerConsoleClient::timeEnd):
(WebCore::WorkerConsoleClient::timeStamp):
Stub most console methods in a Worker.

(WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
Send worker log messages to the global scope and on to the main page.

* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessageToWorkerConsole):
Ideally we want to converge on simple addConsoleMessage
APIs that just take a ConsoleMessage, without a barrage
of parameters. Add these versions now.

LayoutTests:

* inspector/console/messageAdded-from-worker-expected.txt: Added.
* inspector/console/messageAdded-from-worker.html: Added.
* inspector/console/resources/worker-console-log.js: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsstreamsapireadablestreamsgarbagecollectionexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorConsoleMessageh">trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptControllercpp">trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptControllerh">trunk/Source/WebCore/bindings/js/WorkerScriptController.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopecpp">trunk/Source/WebCore/workers/WorkerGlobalScope.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeh">trunk/Source/WebCore/workers/WorkerGlobalScope.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorconsolemessageAddedfromworkerexpectedtxt">trunk/LayoutTests/inspector/console/messageAdded-from-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorconsolemessageAddedfromworkerhtml">trunk/LayoutTests/inspector/console/messageAdded-from-worker.html</a></li>
<li><a href="#trunkLayoutTestsinspectorconsoleresourcesworkerconsolelogjs">trunk/LayoutTests/inspector/console/resources/worker-console-log.js</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerConsoleClientcpp">trunk/Source/WebCore/workers/WorkerConsoleClient.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerConsoleClienth">trunk/Source/WebCore/workers/WorkerConsoleClient.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/LayoutTests/ChangeLog        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-02-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Web Workers have no access to console for debugging
+        https://bugs.webkit.org/show_bug.cgi?id=26237
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/console/messageAdded-from-worker-expected.txt: Added.
+        * inspector/console/messageAdded-from-worker.html: Added.
+        * inspector/console/resources/worker-console-log.js: Added.
+
</ins><span class="cx"> 2016-02-15  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: CSS variables are not formatted correctly
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-02-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Web Workers have no access to console for debugging
+        https://bugs.webkit.org/show_bug.cgi?id=26237
+
+        Reviewed by Timothy Hatcher.
+
+        * web-platform-tests/streams-api/readable-streams/garbage-collection-expected.txt:
+        Update test results for a console.warn message that the test produces from a Worker.
+
</ins><span class="cx"> 2016-02-14  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Window and WorkerGlobalScope should inherit EventTarget
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsstreamsapireadablestreamsgarbagecollectionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection-expected.txt (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection-expected.txt        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection-expected.txt        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -1,3 +1,7 @@
</span><ins>+CONSOLE MESSAGE: line 37: Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal.
+CONSOLE MESSAGE: line 37: Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal.
+CONSOLE MESSAGE: line 37: Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal.
+CONSOLE MESSAGE: line 37: Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal.
</ins><span class="cx"> 
</span><span class="cx"> PASS ReadableStreamController methods should continue working properly when scripts lose their reference to the readable stream 
</span><span class="cx"> PASS ReadableStream closed promise should fulfill even if the stream and reader JS references are lost 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorconsolemessageAddedfromworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/console/messageAdded-from-worker-expected.txt (0 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/messageAdded-from-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/console/messageAdded-from-worker-expected.txt        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+CONSOLE MESSAGE: line 1: WORKER STARTED
+CONSOLE MESSAGE: line 7: WORKER RECEIVED MESSAGE
+Console messages should be received from console logs in a Worker.
+
+
+== Running test suite: Console.messageAdded.worker
+-- Running test case: TriggerConsoleMessagesInWorker
+PASS: MessageAdded event should fire for started log.
+PASS: MessageAdded event should fire for received message log.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorconsolemessageAddedfromworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/console/messageAdded-from-worker.html (0 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/messageAdded-from-worker.html                                (rev 0)
+++ trunk/LayoutTests/inspector/console/messageAdded-from-worker.html        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function triggerWorkerConsoleLog() {
+    let worker = new Worker(&quot;resources/worker-console-log.js&quot;);
+    worker.postMessage(&quot;log&quot;);
+}
+
+function test()
+{
+    let suite = InspectorTest.createAsyncSuite(&quot;Console.messageAdded.worker&quot;);
+
+    suite.addTestCase({
+        name: &quot;TriggerConsoleMessagesInWorker&quot;,
+        description: &quot;Triggered console messages in a Worker should be received.&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.evaluateInPage(&quot;triggerWorkerConsoleLog()&quot;);
+            WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) =&gt; {
+                InspectorTest.expectThat(event.data.message.messageText === &quot;WORKER STARTED&quot;, &quot;MessageAdded event should fire for started log.&quot;);
+                WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) =&gt; {
+                    InspectorTest.expectThat(event.data.message.messageText === &quot;WORKER RECEIVED MESSAGE&quot;, &quot;MessageAdded event should fire for received message log.&quot;);
+                    resolve();
+                });
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;p&gt;Console messages should be received from console logs in a Worker.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorconsoleresourcesworkerconsolelogjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/console/resources/worker-console-log.js (0 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/resources/worker-console-log.js                                (rev 0)
+++ trunk/LayoutTests/inspector/console/resources/worker-console-log.js        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+console.log(&quot;WORKER STARTED&quot;);
+
+self.addEventListener(&quot;message&quot;, (event) =&gt; {
+    // FIXME: &lt;https://webkit.org/b/154213&gt; Web Inspector: Improve support for console logging within workers
+    // Currently the arguments to the console.log are lost when crossing thread boundaries. This should be
+    // addressed when adding better worker debugging in general.
+    console.log(&quot;WORKER RECEIVED MESSAGE&quot;, &quot;argument&quot;);
+});
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-02-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Web Workers have no access to console for debugging
+        https://bugs.webkit.org/show_bug.cgi?id=26237
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/ConsoleMessage.h:
+        Add accessor for MessageLevel.
+
</ins><span class="cx"> 2016-02-15  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ARMv7] stress/op_rshift.js and stress/op_urshift.js are failing.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorConsoleMessageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -59,13 +59,15 @@
</span><span class="cx">     void updateRepeatCountInConsole(ConsoleFrontendDispatcher&amp;);
</span><span class="cx"> 
</span><span class="cx">     MessageSource source() const { return m_source; }
</span><ins>+    MessageType type() const { return m_type; }
+    MessageLevel level() const { return m_level; }
</ins><span class="cx">     const String&amp; message() const { return m_message; }
</span><del>-    MessageType type() const { return m_type; }
-    JSC::ExecState* scriptState() const;
</del><span class="cx">     const String&amp; url() const { return m_url; }
</span><span class="cx">     unsigned line() const { return m_line; }
</span><span class="cx">     unsigned column() const { return m_column; }
</span><span class="cx"> 
</span><ins>+    JSC::ExecState* scriptState() const;
+
</ins><span class="cx">     void incrementCount() { ++m_repeatCount; }
</span><span class="cx"> 
</span><span class="cx">     unsigned argumentCount() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -2807,6 +2807,7 @@
</span><span class="cx">     workers/DedicatedWorkerGlobalScope.cpp
</span><span class="cx">     workers/DedicatedWorkerThread.cpp
</span><span class="cx">     workers/Worker.cpp
</span><ins>+    workers/WorkerConsoleClient.cpp
</ins><span class="cx">     workers/WorkerEventQueue.cpp
</span><span class="cx">     workers/WorkerGlobalScope.cpp
</span><span class="cx">     workers/WorkerLocation.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/Source/WebCore/ChangeLog        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2016-02-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Web Workers have no access to console for debugging
+        https://bugs.webkit.org/show_bug.cgi?id=26237
+
+        Reviewed by Timothy Hatcher.
+
+        This adds the most basic console message support to Workers.
+        Messages logged from workers get surfaced through the Page's console.
+        This lacks support for logging and interacting with arguments,
+        which would be addressed when adding more complete Worker
+        debugging tools.
+
+        Test: inspector/console/messageAdded-from-worker.html
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        Add new files.
+
+        * bindings/js/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::~WorkerScriptController):
+        (WebCore::WorkerScriptController::initScript):
+        Set the ConsoleClient for the Worker's global object. We route
+        the messages to the Page's console.
+
+        * bindings/js/WorkerScriptController.h:
+        * workers/WorkerConsoleClient.h: Added.
+        * workers/WorkerConsoleClient.cpp: Added.
+        (WebCore::WorkerConsoleClient::WorkerConsoleClient):
+        (WebCore::WorkerConsoleClient::~WorkerConsoleClient):
+        (WebCore::WorkerConsoleClient::profile):
+        (WebCore::WorkerConsoleClient::profileEnd):
+        (WebCore::WorkerConsoleClient::count):
+        (WebCore::WorkerConsoleClient::time):
+        (WebCore::WorkerConsoleClient::timeEnd):
+        (WebCore::WorkerConsoleClient::timeStamp):
+        Stub most console methods in a Worker.
+
+        (WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
+        Send worker log messages to the global scope and on to the main page.
+
+        * workers/WorkerGlobalScope.h:
+        * workers/WorkerGlobalScope.cpp:
+        (WebCore::WorkerGlobalScope::addConsoleMessage):
+        (WebCore::WorkerGlobalScope::addMessageToWorkerConsole):
+        Ideally we want to converge on simple addConsoleMessage
+        APIs that just take a ConsoleMessage, without a barrage
+        of parameters. Add these versions now.
+
</ins><span class="cx"> 2016-02-15  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         CMake build fix.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -4190,6 +4190,8 @@
</span><span class="cx">                 A5416FE618810EF80009FC5F /* YouTubeEmbedShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A5416FE418810EF80009FC5F /* YouTubeEmbedShadowElement.h */; };
</span><span class="cx">                 A54A82EC15228D2F00C72BA6 /* DOMNodePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
</span><span class="cx">                 A54A82F115228DF600C72BA6 /* DOMNodePrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
</span><ins>+                A55639D11C6F09E300806D8E /* WorkerConsoleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */; };
+                A55639D21C6F09E700806D8E /* WorkerConsoleClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55639CF1C6EFD5900806D8E /* WorkerConsoleClient.cpp */; };
</ins><span class="cx">                 A56C5B9A189F34570082D13C /* WebConsoleAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A56C5B98189F34570082D13C /* WebConsoleAgent.cpp */; };
</span><span class="cx">                 A56C5B9B189F34570082D13C /* WebConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A56C5B99189F34570082D13C /* WebConsoleAgent.h */; };
</span><span class="cx">                 A5732B0A136A161D005C8D7C /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5732B08136A161D005C8D7C /* DateComponents.cpp */; };
</span><span class="lines">@@ -11848,6 +11850,8 @@
</span><span class="cx">                 A5416FE318810EF80009FC5F /* YouTubeEmbedShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YouTubeEmbedShadowElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5416FE418810EF80009FC5F /* YouTubeEmbedShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YouTubeEmbedShadowElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMNodePrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A55639CF1C6EFD5900806D8E /* WorkerConsoleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerConsoleClient.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerConsoleClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A56C5B98189F34570082D13C /* WebConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebConsoleAgent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A56C5B99189F34570082D13C /* WebConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebConsoleAgent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5732B08136A161D005C8D7C /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16439,6 +16443,8 @@
</span><span class="cx">                                 2E4346330F546A8200B0F1BA /* Worker.cpp */,
</span><span class="cx">                                 2E4346340F546A8200B0F1BA /* Worker.h */,
</span><span class="cx">                                 2E4346350F546A8200B0F1BA /* Worker.idl */,
</span><ins>+                                A55639CF1C6EFD5900806D8E /* WorkerConsoleClient.cpp */,
+                                A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */,
</ins><span class="cx">                                 A3E2642E14748991005A8588 /* WorkerEventQueue.cpp */,
</span><span class="cx">                                 A3E2642F14748991005A8588 /* WorkerEventQueue.h */,
</span><span class="cx">                                 2E4346360F546A8200B0F1BA /* WorkerGlobalScope.cpp */,
</span><span class="lines">@@ -26686,6 +26692,7 @@
</span><span class="cx">                                 B2FA3D610AB75A6F000E5AC4 /* JSSVGCursorElement.h in Headers */,
</span><span class="cx">                                 B2FA3D630AB75A6F000E5AC4 /* JSSVGDefsElement.h in Headers */,
</span><span class="cx">                                 B2FA3D650AB75A6F000E5AC4 /* JSSVGDescElement.h in Headers */,
</span><ins>+                                A55639D11C6F09E300806D8E /* WorkerConsoleClient.h in Headers */,
</ins><span class="cx">                                 B2FA3D670AB75A6F000E5AC4 /* JSSVGDocument.h in Headers */,
</span><span class="cx">                                 B222F69D0AB771B80022EFAD /* JSSVGElement.h in Headers */,
</span><span class="cx">                                 8542A7990AE5C94400DF58DF /* JSSVGElementWrapperFactory.h in Headers */,
</span><span class="lines">@@ -29863,6 +29870,7 @@
</span><span class="cx">                                 A77979190D6B9D0C003851B9 /* ImageData.cpp in Sources */,
</span><span class="cx">                                 97205AB51239291000B17380 /* ImageDocument.cpp in Sources */,
</span><span class="cx">                                 F55B3DC11251F12D003EF269 /* ImageInputType.cpp in Sources */,
</span><ins>+                                A55639D21C6F09E700806D8E /* WorkerConsoleClient.cpp in Sources */,
</ins><span class="cx">                                 089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */,
</span><span class="cx">                                 B275357B0B053814002CE64F /* ImageMac.mm in Sources */,
</span><span class="cx">                                 2D5A592F152525230036EE51 /* ImageOrientation.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;JSEventTarget.h&quot;
</span><span class="cx"> #include &quot;ScriptSourceCode.h&quot;
</span><span class="cx"> #include &quot;WebCoreJSClientData.h&quot;
</span><ins>+#include &quot;WorkerConsoleClient.h&quot;
</ins><span class="cx"> #include &quot;WorkerGlobalScope.h&quot;
</span><span class="cx"> #include &quot;WorkerObjectProxy.h&quot;
</span><span class="cx"> #include &quot;WorkerThread.h&quot;
</span><span class="lines">@@ -40,9 +41,9 @@
</span><span class="cx"> #include &lt;heap/StrongInlines.h&gt;
</span><span class="cx"> #include &lt;interpreter/Interpreter.h&gt;
</span><span class="cx"> #include &lt;runtime/Completion.h&gt;
</span><ins>+#include &lt;runtime/Error.h&gt;
</ins><span class="cx"> #include &lt;runtime/Exception.h&gt;
</span><span class="cx"> #include &lt;runtime/ExceptionHelpers.h&gt;
</span><del>-#include &lt;runtime/Error.h&gt;
</del><span class="cx"> #include &lt;runtime/JSLock.h&gt;
</span><span class="cx"> #include &lt;runtime/Watchdog.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -63,6 +64,10 @@
</span><span class="cx"> WorkerScriptController::~WorkerScriptController()
</span><span class="cx"> {
</span><span class="cx">     JSLockHolder lock(vm());
</span><ins>+    if (m_workerGlobalScopeWrapper) {
+        m_workerGlobalScopeWrapper-&gt;setConsoleClient(nullptr);
+        m_consoleClient = nullptr;
+    }
</ins><span class="cx">     m_workerGlobalScopeWrapper.clear();
</span><span class="cx">     m_vm = nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -95,6 +100,9 @@
</span><span class="cx">     }
</span><span class="cx">     ASSERT(m_workerGlobalScopeWrapper-&gt;globalObject() == m_workerGlobalScopeWrapper);
</span><span class="cx">     ASSERT(asObject(m_workerGlobalScopeWrapper-&gt;prototype())-&gt;globalObject() == m_workerGlobalScopeWrapper);
</span><ins>+
+    m_consoleClient = std::make_unique&lt;WorkerConsoleClient&gt;(*m_workerGlobalScope);
+    m_workerGlobalScopeWrapper-&gt;setConsoleClient(m_consoleClient.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WorkerScriptController::evaluate(const ScriptSourceCode&amp; sourceCode)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptController.h (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptController.h        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptController.h        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> 
</span><span class="cx">     class JSWorkerGlobalScope;
</span><span class="cx">     class ScriptSourceCode;
</span><ins>+    class WorkerConsoleClient;
</ins><span class="cx">     class WorkerGlobalScope;
</span><span class="cx"> 
</span><span class="cx">     class WorkerScriptController {
</span><span class="lines">@@ -96,6 +97,7 @@
</span><span class="cx">         RefPtr&lt;JSC::VM&gt; m_vm;
</span><span class="cx">         WorkerGlobalScope* m_workerGlobalScope;
</span><span class="cx">         JSC::Strong&lt;JSWorkerGlobalScope&gt; m_workerGlobalScopeWrapper;
</span><ins>+        std::unique_ptr&lt;WorkerConsoleClient&gt; m_consoleClient;
</ins><span class="cx">         bool m_executionForbidden;
</span><span class="cx">         bool m_isTerminatingExecution { false };
</span><span class="cx">         mutable Lock m_scheduledTerminationMutex;
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerConsoleClientcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/workers/WorkerConsoleClient.cpp (0 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerConsoleClient.cpp                                (rev 0)
+++ trunk/Source/WebCore/workers/WorkerConsoleClient.cpp        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 &quot;config.h&quot;
+#include &quot;WorkerConsoleClient.h&quot;
+
+#include &lt;inspector/ConsoleMessage.h&gt;
+#include &lt;inspector/ScriptArguments.h&gt;
+
+using namespace Inspector;
+
+namespace WebCore {
+
+WorkerConsoleClient::WorkerConsoleClient(WorkerGlobalScope&amp; workerGlobalScope)
+    : m_workerGlobalScope(workerGlobalScope)
+{
+}
+
+WorkerConsoleClient::~WorkerConsoleClient()
+{
+}
+
+void WorkerConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, RefPtr&lt;Inspector::ScriptArguments&gt;&amp;&amp; arguments)
+{
+    String messageText;
+    arguments-&gt;getFirstArgumentAsString(messageText);
+    auto message = std::make_unique&lt;Inspector::ConsoleMessage&gt;(MessageSource::ConsoleAPI, type, level, messageText, WTFMove(arguments), exec);
+    m_workerGlobalScope.addConsoleMessage(WTFMove(message));
+}
+
+// FIXME: &lt;https://webkit.org/b/153499&gt; Web Inspector: console.profile should use the new Sampling Profiler
+void WorkerConsoleClient::profile(JSC::ExecState*, const String&amp;) { }
+void WorkerConsoleClient::profileEnd(JSC::ExecState*, const String&amp;) { }
+
+// FIXME: &lt;https://webkit.org/b/127634&gt; Web Inspector: support debugging web workers
+void WorkerConsoleClient::count(JSC::ExecState*, RefPtr&lt;ScriptArguments&gt;&amp;&amp;) { }
+void WorkerConsoleClient::time(JSC::ExecState*, const String&amp;) { }
+void WorkerConsoleClient::timeEnd(JSC::ExecState*, const String&amp;) { }
+void WorkerConsoleClient::timeStamp(JSC::ExecState*, RefPtr&lt;ScriptArguments&gt;&amp;&amp;) { }
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerConsoleClienth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/workers/WorkerConsoleClient.h (0 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerConsoleClient.h                                (rev 0)
+++ trunk/Source/WebCore/workers/WorkerConsoleClient.h        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 WorkerConsoleClient_h
+#define WorkerConsoleClient_h
+
+#include &quot;WorkerGlobalScope.h&quot;
+#include &lt;runtime/ConsoleClient.h&gt;
+#include &lt;wtf/Forward.h&gt;
+
+namespace JSC {
+class ExecState;
+}
+
+namespace WebCore {
+
+class WorkerConsoleClient final : public JSC::ConsoleClient {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    explicit WorkerConsoleClient(WorkerGlobalScope&amp;);
+    virtual ~WorkerConsoleClient();
+
+protected:
+    virtual void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr&lt;Inspector::ScriptArguments&gt;&amp;&amp;) override;
+    virtual void count(JSC::ExecState*, RefPtr&lt;Inspector::ScriptArguments&gt;&amp;&amp;) override;
+    virtual void profile(JSC::ExecState*, const String&amp; title) override;
+    virtual void profileEnd(JSC::ExecState*, const String&amp; title) override;
+    virtual void time(JSC::ExecState*, const String&amp; title) override;
+    virtual void timeEnd(JSC::ExecState*, const String&amp; title) override;
+    virtual void timeStamp(JSC::ExecState*, RefPtr&lt;Inspector::ScriptArguments&gt;&amp;&amp;) override;
+
+private:
+    WorkerGlobalScope&amp; m_workerGlobalScope;
+};
+
+} // namespace WebCore
+
+#endif // WorkerConsoleClient_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -220,6 +220,17 @@
</span><span class="cx">     thread().workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, columnNumber, sourceURL);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WorkerGlobalScope::addConsoleMessage(std::unique_ptr&lt;Inspector::ConsoleMessage&gt; message)
+{
+    if (!isContextThread()) {
+        postTask(AddConsoleMessageTask(message-&gt;source(), message-&gt;level(), StringCapture(message-&gt;message())));
+        return;
+    }
+
+    thread().workerReportingProxy().postConsoleMessageToWorkerObject(message-&gt;source(), message-&gt;level(), message-&gt;message(), message-&gt;line(), message-&gt;column(), message-&gt;url());
+    addMessageToWorkerConsole(WTFMove(message));
+}
+
</ins><span class="cx"> void WorkerGlobalScope::addConsoleMessage(MessageSource source, MessageLevel level, const String&amp; message, unsigned long requestIdentifier)
</span><span class="cx"> {
</span><span class="cx">     if (!isContextThread()) {
</span><span class="lines">@@ -244,8 +255,6 @@
</span><span class="cx"> 
</span><span class="cx"> void WorkerGlobalScope::addMessageToWorkerConsole(MessageSource source, MessageLevel level, const String&amp; messageText, const String&amp; suggestedURL, unsigned suggestedLineNumber, unsigned suggestedColumnNumber, RefPtr&lt;ScriptCallStack&gt;&amp;&amp; callStack, JSC::ExecState* state, unsigned long requestIdentifier)
</span><span class="cx"> {
</span><del>-    ASSERT(isContextThread());
-
</del><span class="cx">     std::unique_ptr&lt;Inspector::ConsoleMessage&gt; message;
</span><span class="cx"> 
</span><span class="cx">     if (callStack)
</span><span class="lines">@@ -253,6 +262,12 @@
</span><span class="cx">     else
</span><span class="cx">         message = std::make_unique&lt;Inspector::ConsoleMessage&gt;(source, MessageType::Log, level, messageText, suggestedURL, suggestedLineNumber, suggestedColumnNumber, state, requestIdentifier);
</span><span class="cx"> 
</span><ins>+    addMessageToWorkerConsole(WTFMove(message));
+}
+
+void WorkerGlobalScope::addMessageToWorkerConsole(std::unique_ptr&lt;Inspector::ConsoleMessage&gt; message)
+{
+    ASSERT(isContextThread());
</ins><span class="cx">     InspectorInstrumentation::addMessageToConsole(this, WTFMove(message));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (196593 => 196594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.h        2016-02-15 21:16:40 UTC (rev 196593)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h        2016-02-15 21:23:23 UTC (rev 196594)
</span><span class="lines">@@ -41,6 +41,10 @@
</span><span class="cx"> #include &lt;wtf/TypeCasts.h&gt;
</span><span class="cx"> #include &lt;wtf/text/AtomicStringHash.h&gt;
</span><span class="cx"> 
</span><ins>+namespace Inspector {
+class ConsoleMessage;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx">     class Blob;
</span><span class="lines">@@ -124,6 +128,7 @@
</span><span class="cx"> 
</span><span class="cx">         virtual SecurityOrigin* topOrigin() const override { return m_topOrigin.get(); }
</span><span class="cx"> 
</span><ins>+        void addConsoleMessage(std::unique_ptr&lt;Inspector::ConsoleMessage&gt;);
</ins><span class="cx">         virtual void addConsoleMessage(MessageSource, MessageLevel, const String&amp; message, unsigned long requestIdentifier = 0) override;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><span class="lines">@@ -136,6 +141,7 @@
</span><span class="cx">         void applyContentSecurityPolicyResponseHeaders(const ContentSecurityPolicyResponseHeaders&amp;);
</span><span class="cx"> 
</span><span class="cx">         virtual void logExceptionToConsole(const String&amp; errorMessage, const String&amp; sourceURL, int lineNumber, int columnNumber, RefPtr&lt;Inspector::ScriptCallStack&gt;&amp;&amp;) override;
</span><ins>+        void addMessageToWorkerConsole(std::unique_ptr&lt;Inspector::ConsoleMessage&gt;);
</ins><span class="cx">         void addMessageToWorkerConsole(MessageSource, MessageLevel, const String&amp; message, const String&amp; sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr&lt;Inspector::ScriptCallStack&gt;&amp;&amp;, JSC::ExecState* = 0, unsigned long requestIdentifier = 0);
</span><span class="cx"> 
</span><span class="cx">     private:
</span></span></pre>
</div>
</div>

</body>
</html>