<!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>[55771] 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/55771">55771</a></dd>
<dt>Author</dt> <dd>pfeldman@chromium.org</dd>
<dt>Date</dt> <dd>2010-03-10 01:22:04 -0800 (Wed, 10 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>2010-03-10  Andrey Kosyakov  &lt;caseq@chromium.org&gt;

        Reviewed by Pavel Feldman.

        Web Inspector: display list of active workers &amp; support debugging
        with fake workers.
        https://bugs.webkit.org/show_bug.cgi?id=35568

        * English.lproj/localizedStrings.js:
        * WebCore.gypi:
        * WebCore.vcproj/WebCore.vcproj:
        * bindings/js/JSInjectedScriptHostCustom.cpp:
        (WebCore::InjectedScriptHost::createInjectedScript):
        (WebCore::InjectedScriptHost::injectedScriptFor):
        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
        (WebCore::InjectedScriptHost::createInjectedScript):
        (WebCore::InjectedScriptHost::injectedScriptFor):
        * dom/Document.cpp:
        (WebCore::Document::inspectorController):
        * dom/Document.h:
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::inspectorController):
        * inspector/InjectedScriptHost.cpp:
        (WebCore::InjectedScriptHost::InjectedScriptHost):
        (WebCore::InjectedScriptHost::injectScript):
        (WebCore::InjectedScriptHost::nextWorkerId):
        (WebCore::InjectedScriptHost::didCreateWorker):
        (WebCore::InjectedScriptHost::willDestroyWorker):
        * inspector/InjectedScriptHost.h:
        * inspector/InjectedScriptHost.idl:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::populateScriptObjects):
        (WebCore::InspectorController::resetScriptObjects):
        (WebCore::InspectorController::didCommitLoad):
        (WebCore::InspectorController::didCreateWorker):
        (WebCore::InspectorController::willDestroyWorker):
        * inspector/InspectorController.h:
        * inspector/InspectorFrontend.cpp:
        (WebCore::InspectorFrontend::didCreateWorker):
        (WebCore::InspectorFrontend::willDestroyWorker):
        * inspector/InspectorFrontend.h:
        * inspector/InspectorWorkerResource.h: Added.
        (WebCore::InspectorWorkerResource::create):
        (WebCore::InspectorWorkerResource::id):
        (WebCore::InspectorWorkerResource::url):
        (WebCore::InspectorWorkerResource::isSharedWorker):
        (WebCore::InspectorWorkerResource::InspectorWorkerResource):
        * inspector/front-end/Checkbox.js: Added.
        (WebInspector.Checkbox.callbackWrapper):
        (WebInspector.Checkbox):
        (WebInspector.Checkbox.prototype.checked):
        * inspector/front-end/InjectedFakeWorker.js:
        (InjectedFakeWorker.FakeWorker):
        (InjectedFakeWorker.FakeWorker.prototype.terminate):
        (InjectedFakeWorker.FakeWorker.prototype._handleException):
        (InjectedFakeWorker.FakeWorker.prototype._importScripts):
        (InjectedFakeWorker.FakeWorker.prototype._loadScript):
        (InjectedFakeWorker.FakeWorker.prototype._expandURLAndCheckOrigin):
        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel):
        (WebInspector.ScriptsPanel.prototype.debuggerWasEnabled):
        (WebInspector.ScriptsPanel.prototype.debuggerWasDisabled):
        (WebInspector.ScriptsPanel.prototype.reset):
        * inspector/front-end/StylesSidebarPane.js:
        (WebInspector.StylePropertiesSection.showInheritedToggleFunction):
        (WebInspector.StylePropertiesSection):
        * inspector/front-end/WebKit.qrc:
        * inspector/front-end/WorkersSidebarPane.js: Added.
        (WebInspector.WorkersSidebarPane):
        (WebInspector.WorkersSidebarPane.prototype.addWorker):
        (WebInspector.WorkersSidebarPane.prototype.removeWorker):
        (WebInspector.WorkersSidebarPane.prototype.setInstrumentation):
        (WebInspector.WorkersSidebarPane.prototype.reset):
        (WebInspector.WorkersSidebarPane.prototype._onTriggerInstrument):
        (WebInspector.Worker):
        (WebInspector.didCreateWorker):
        (WebInspector.willDestroyWorker):
        * inspector/front-end/inspector.css:
        * inspector/front-end/inspector.html:
        * workers/AbstractWorker.cpp:
        (WebCore::AbstractWorker::AbstractWorker):
        (WebCore::AbstractWorker::~AbstractWorker):
        (WebCore::AbstractWorker::onDestroyWorker):
        (WebCore::AbstractWorker::contextDestroyed):
        * workers/AbstractWorker.h:
        (WebCore::AbstractWorker::id):
        * workers/SharedWorker.cpp:
        (WebCore::SharedWorker::SharedWorker):
        * workers/Worker.cpp:
        (WebCore::Worker::Worker):

        WebKit/chromium:
        * src/js/InspectorControllerImpl.js:
        (devtools.InspectorBackendImpl):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreEnglishlprojlocalizedStringsjs">trunk/WebCore/English.lproj/localizedStrings.js</a></li>
<li><a href="#trunkWebCoreWebCoregypi">trunk/WebCore/WebCore.gypi</a></li>
<li><a href="#trunkWebCoreWebCorevcprojWebCorevcproj">trunk/WebCore/WebCore.vcproj/WebCore.vcproj</a></li>
<li><a href="#trunkWebCorebindingsjsJSInjectedScriptHostCustomcpp">trunk/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8InjectedScriptHostCustomcpp">trunk/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp</a></li>
<li><a href="#trunkWebCoredomDocumentcpp">trunk/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkWebCoredomDocumenth">trunk/WebCore/dom/Document.h</a></li>
<li><a href="#trunkWebCoredomScriptExecutionContexth">trunk/WebCore/dom/ScriptExecutionContext.h</a></li>
<li><a href="#trunkWebCoreinspectorInjectedScriptHostcpp">trunk/WebCore/inspector/InjectedScriptHost.cpp</a></li>
<li><a href="#trunkWebCoreinspectorInjectedScriptHosth">trunk/WebCore/inspector/InjectedScriptHost.h</a></li>
<li><a href="#trunkWebCoreinspectorInjectedScriptHostidl">trunk/WebCore/inspector/InjectedScriptHost.idl</a></li>
<li><a href="#trunkWebCoreinspectorInspectorControllercpp">trunk/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#trunkWebCoreinspectorInspectorControllerh">trunk/WebCore/inspector/InspectorController.h</a></li>
<li><a href="#trunkWebCoreinspectorInspectorFrontendcpp">trunk/WebCore/inspector/InspectorFrontend.cpp</a></li>
<li><a href="#trunkWebCoreinspectorInspectorFrontendh">trunk/WebCore/inspector/InspectorFrontend.h</a></li>
<li><a href="#trunkWebCoreinspectorfrontendInjectedFakeWorkerjs">trunk/WebCore/inspector/front-end/InjectedFakeWorker.js</a></li>
<li><a href="#trunkWebCoreinspectorfrontendScriptsPaneljs">trunk/WebCore/inspector/front-end/ScriptsPanel.js</a></li>
<li><a href="#trunkWebCoreinspectorfrontendStylesSidebarPanejs">trunk/WebCore/inspector/front-end/StylesSidebarPane.js</a></li>
<li><a href="#trunkWebCoreinspectorfrontendWebKitqrc">trunk/WebCore/inspector/front-end/WebKit.qrc</a></li>
<li><a href="#trunkWebCoreinspectorfrontendinspectorcss">trunk/WebCore/inspector/front-end/inspector.css</a></li>
<li><a href="#trunkWebCoreinspectorfrontendinspectorhtml">trunk/WebCore/inspector/front-end/inspector.html</a></li>
<li><a href="#trunkWebCoreworkersAbstractWorkercpp">trunk/WebCore/workers/AbstractWorker.cpp</a></li>
<li><a href="#trunkWebCoreworkersAbstractWorkerh">trunk/WebCore/workers/AbstractWorker.h</a></li>
<li><a href="#trunkWebCoreworkersSharedWorkercpp">trunk/WebCore/workers/SharedWorker.cpp</a></li>
<li><a href="#trunkWebCoreworkersWorkercpp">trunk/WebCore/workers/Worker.cpp</a></li>
<li><a href="#trunkWebKitchromiumChangeLog">trunk/WebKit/chromium/ChangeLog</a></li>
<li><a href="#trunkWebKitchromiumsrcjsInspectorControllerImpljs">trunk/WebKit/chromium/src/js/InspectorControllerImpl.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebCoreinspectorInspectorWorkerResourceh">trunk/WebCore/inspector/InspectorWorkerResource.h</a></li>
<li><a href="#trunkWebCoreinspectorfrontendCheckboxjs">trunk/WebCore/inspector/front-end/Checkbox.js</a></li>
<li><a href="#trunkWebCoreinspectorfrontendWorkersSidebarPanejs">trunk/WebCore/inspector/front-end/WorkersSidebarPane.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/ChangeLog        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -1,3 +1,94 @@
</span><ins>+2010-03-10  Andrey Kosyakov  &lt;caseq@chromium.org&gt;
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: display list of active workers &amp; support debugging
+        with fake workers.
+        https://bugs.webkit.org/show_bug.cgi?id=35568
+
+        * English.lproj/localizedStrings.js:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::InjectedScriptHost::injectedScriptFor):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::InjectedScriptHost::injectedScriptFor):
+        * dom/Document.cpp:
+        (WebCore::Document::inspectorController):
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.h:
+        (WebCore::ScriptExecutionContext::inspectorController):
+        * inspector/InjectedScriptHost.cpp:
+        (WebCore::InjectedScriptHost::InjectedScriptHost):
+        (WebCore::InjectedScriptHost::injectScript):
+        (WebCore::InjectedScriptHost::nextWorkerId):
+        (WebCore::InjectedScriptHost::didCreateWorker):
+        (WebCore::InjectedScriptHost::willDestroyWorker):
+        * inspector/InjectedScriptHost.h:
+        * inspector/InjectedScriptHost.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::populateScriptObjects):
+        (WebCore::InspectorController::resetScriptObjects):
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::didCreateWorker):
+        (WebCore::InspectorController::willDestroyWorker):
+        * inspector/InspectorController.h:
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::didCreateWorker):
+        (WebCore::InspectorFrontend::willDestroyWorker):
+        * inspector/InspectorFrontend.h:
+        * inspector/InspectorWorkerResource.h: Added.
+        (WebCore::InspectorWorkerResource::create):
+        (WebCore::InspectorWorkerResource::id):
+        (WebCore::InspectorWorkerResource::url):
+        (WebCore::InspectorWorkerResource::isSharedWorker):
+        (WebCore::InspectorWorkerResource::InspectorWorkerResource):
+        * inspector/front-end/Checkbox.js: Added.
+        (WebInspector.Checkbox.callbackWrapper):
+        (WebInspector.Checkbox):
+        (WebInspector.Checkbox.prototype.checked):
+        * inspector/front-end/InjectedFakeWorker.js:
+        (InjectedFakeWorker.FakeWorker):
+        (InjectedFakeWorker.FakeWorker.prototype.terminate):
+        (InjectedFakeWorker.FakeWorker.prototype._handleException):
+        (InjectedFakeWorker.FakeWorker.prototype._importScripts):
+        (InjectedFakeWorker.FakeWorker.prototype._loadScript):
+        (InjectedFakeWorker.FakeWorker.prototype._expandURLAndCheckOrigin):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.debuggerWasEnabled):
+        (WebInspector.ScriptsPanel.prototype.debuggerWasDisabled):
+        (WebInspector.ScriptsPanel.prototype.reset):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertiesSection.showInheritedToggleFunction):
+        (WebInspector.StylePropertiesSection):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/WorkersSidebarPane.js: Added.
+        (WebInspector.WorkersSidebarPane):
+        (WebInspector.WorkersSidebarPane.prototype.addWorker):
+        (WebInspector.WorkersSidebarPane.prototype.removeWorker):
+        (WebInspector.WorkersSidebarPane.prototype.setInstrumentation):
+        (WebInspector.WorkersSidebarPane.prototype.reset):
+        (WebInspector.WorkersSidebarPane.prototype._onTriggerInstrument):
+        (WebInspector.Worker):
+        (WebInspector.didCreateWorker):
+        (WebInspector.willDestroyWorker):
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/inspector.html:
+        * workers/AbstractWorker.cpp:
+        (WebCore::AbstractWorker::AbstractWorker):
+        (WebCore::AbstractWorker::~AbstractWorker):
+        (WebCore::AbstractWorker::onDestroyWorker):
+        (WebCore::AbstractWorker::contextDestroyed):
+        * workers/AbstractWorker.h:
+        (WebCore::AbstractWorker::id):
+        * workers/SharedWorker.cpp:
+        (WebCore::SharedWorker::SharedWorker):
+        * workers/Worker.cpp:
+        (WebCore::Worker::Worker):
+
</ins><span class="cx"> 2010-03-10  Roland Steiner  &lt;rolandsteiner@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed build fix. Fix variable name change that somehow didn't
</span></span></pre></div>
<a id="trunkWebCoreEnglishlprojlocalizedStringsjs"></a>
<div class="binary"><h4>Modified: trunk/WebCore/English.lproj/localizedStrings.js</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkWebCoreWebCoregypi"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.gypi (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.gypi        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/WebCore.gypi        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -1622,6 +1622,7 @@
</span><span class="cx">             'inspector/InspectorResource.h',
</span><span class="cx">             'inspector/InspectorTimelineAgent.cpp',
</span><span class="cx">             'inspector/InspectorTimelineAgent.h',
</span><ins>+            'inspector/InspectorWorkerResource.h',
</ins><span class="cx">             'inspector/JavaScriptCallFrame.cpp',
</span><span class="cx">             'inspector/JavaScriptCallFrame.h',
</span><span class="cx">             'inspector/ScriptBreakpoint.h',
</span><span class="lines">@@ -3743,6 +3744,7 @@
</span><span class="cx">             'inspector/front-end/Callback.js',
</span><span class="cx">             'inspector/front-end/CallStackSidebarPane.js',
</span><span class="cx">             'inspector/front-end/ChangesView.js',
</span><ins>+            'inspector/front-end/Checkbox.js',
</ins><span class="cx">             'inspector/front-end/Color.js',
</span><span class="cx">             'inspector/front-end/ConsolePanel.js',
</span><span class="cx">             'inspector/front-end/ConsoleView.js',
</span><span class="lines">@@ -3819,6 +3821,7 @@
</span><span class="cx">             'inspector/front-end/View.js',
</span><span class="cx">             'inspector/front-end/WatchExpressionsSidebarPane.js',
</span><span class="cx">             'inspector/front-end/WelcomeView.js',
</span><ins>+            'inspector/front-end/WorkersSidebarPane.js',
</ins><span class="cx">             'inspector/front-end/audits.css',
</span><span class="cx">             'inspector/front-end/inspector.css',
</span><span class="cx">             'inspector/front-end/inspectorSyntaxHighlight.css',
</span></span></pre></div>
<a id="trunkWebCoreWebCorevcprojWebCorevcproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.vcproj/WebCore.vcproj (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.vcproj/WebCore.vcproj        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/WebCore.vcproj/WebCore.vcproj        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -42761,6 +42761,10 @@
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span><span class="cx">                         &lt;File
</span><ins>+                                RelativePath=&quot;..\inspector\InspectorWorkerResource.h&quot;
+                                &gt;
+                        &lt;/File&gt;
+                        &lt;File
</ins><span class="cx">                                 RelativePath=&quot;..\inspector\JavaScriptCallFrame.cpp&quot;
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span><span class="lines">@@ -42840,6 +42844,10 @@
</span><span class="cx">                                         &gt;
</span><span class="cx">                                 &lt;/File&gt;
</span><span class="cx">                                 &lt;File
</span><ins>+                                        RelativePath=&quot;..\inspector\front-end\Checkbox.js&quot;
+                                        &gt;
+                                &lt;/File&gt;
+                                &lt;File
</ins><span class="cx">                                         RelativePath=&quot;..\inspector\front-end\Color.js&quot;
</span><span class="cx">                                         &gt;
</span><span class="cx">                                 &lt;/File&gt;
</span><span class="lines">@@ -43147,6 +43155,10 @@
</span><span class="cx">                                         RelativePath=&quot;..\inspector\front-end\WelcomeView.js&quot;
</span><span class="cx">                                         &gt;
</span><span class="cx">                                 &lt;/File&gt;
</span><ins>+                                &lt;File
+                                        RelativePath=&quot;..\inspector\front-end\WorkersSidebarPane.js&quot;
+                                        &gt;
+                                &lt;/File&gt;
</ins><span class="cx">                         &lt;/Filter&gt;
</span><span class="cx">                 &lt;/Filter&gt;
</span><span class="cx">                 &lt;Filter
</span></span></pre></div>
<a id="trunkWebCorebindingsjsJSInjectedScriptHostCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2008 Matt Lilek &lt;webkit@mattlilek.com&gt;
</span><del>- * Copyright (C) 2009 Google Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010 Google Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static ScriptObject createInjectedScript(const String&amp; source, InjectedScriptHost* injectedScriptHost, ScriptState* scriptState, long id)
</del><ins>+ScriptObject InjectedScriptHost::createInjectedScript(const String&amp; source, ScriptState* scriptState, long id)
</ins><span class="cx"> {
</span><span class="cx">     SourceCode sourceCode = makeSource(source);
</span><span class="cx">     JSLock lock(SilenceAssertionsOnly);
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx">         return ScriptObject();
</span><span class="cx"> 
</span><span class="cx">     MarkedArgumentBuffer args;
</span><del>-    args.append(toJS(scriptState, globalObject, injectedScriptHost));
</del><ins>+    args.append(toJS(scriptState, globalObject, this));
</ins><span class="cx">     args.append(globalThisValue);
</span><span class="cx">     args.append(jsNumber(scriptState, id));
</span><span class="cx">     JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
</span><span class="lines">@@ -221,12 +221,11 @@
</span><span class="cx">     if (injectedScript)
</span><span class="cx">         return InjectedScript(ScriptObject(scriptState, injectedScript));
</span><span class="cx"> 
</span><del>-    ASSERT(!m_injectedScriptSource.isEmpty());
-    ScriptObject injectedScriptObject = createInjectedScript(m_injectedScriptSource, this, scriptState, m_nextInjectedScriptId);
-    globalObject-&gt;setInjectedScript(injectedScriptObject.jsObject());
-    InjectedScript result(injectedScriptObject);
-    m_idToInjectedScript.set(m_nextInjectedScriptId, result);
-    m_nextInjectedScriptId++;
</del><ins>+    ASSERT(!m_injectedScriptSource.isEmpty()); 
+    pair&lt;long, ScriptObject&gt; injectedScriptObject = injectScript(m_injectedScriptSource, scriptState);
+    globalObject-&gt;setInjectedScript(injectedScriptObject.second.jsObject());
+    InjectedScript result(injectedScriptObject.second);
+    m_idToInjectedScript.set(injectedScriptObject.first, result);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8InjectedScriptHostCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">     return instance;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static ScriptObject createInjectedScript(const String&amp; scriptSource, InjectedScriptHost* injectedScriptHost, ScriptState* inspectedScriptState, long id)
</del><ins>+ScriptObject InjectedScriptHost::createInjectedScript(const String&amp; scriptSource, ScriptState* inspectedScriptState, long id)
</ins><span class="cx"> {
</span><span class="cx">     v8::HandleScope scope;
</span><span class="cx"> 
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">     // instead of calling toV8() that would create the
</span><span class="cx">     // wrapper in the current context.
</span><span class="cx">     // FIXME: make it possible to use generic bindings factory for InjectedScriptHost.
</span><del>-    v8::Local&lt;v8::Object&gt; scriptHostWrapper = createInjectedScriptHostV8Wrapper(injectedScriptHost);
</del><ins>+    v8::Local&lt;v8::Object&gt; scriptHostWrapper = createInjectedScriptHostV8Wrapper(this);
</ins><span class="cx">     if (scriptHostWrapper.IsEmpty())
</span><span class="cx">         return ScriptObject();
</span><span class="cx"> 
</span><span class="lines">@@ -240,11 +240,10 @@
</span><span class="cx">         return InjectedScript(ScriptObject(inspectedScriptState, v8::Local&lt;v8::Object&gt;::Cast(val)));
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!m_injectedScriptSource.isEmpty());
</span><del>-    ScriptObject injectedScriptObject = createInjectedScript(m_injectedScriptSource, this, inspectedScriptState, m_nextInjectedScriptId);
-    InjectedScript result(injectedScriptObject);
-    m_idToInjectedScript.set(m_nextInjectedScriptId, result);
-    ++m_nextInjectedScriptId;
-    global-&gt;SetHiddenValue(key, injectedScriptObject.v8Object());
</del><ins>+    pair&lt;long, ScriptObject&gt; injectedScript = injectScript(m_injectedScriptSource, inspectedScriptState);
+    InjectedScript result(injectedScript.second);
+    m_idToInjectedScript.set(injectedScript.first, result);
+    global-&gt;SetHiddenValue(key, injectedScript.second.v8Object());
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/Document.cpp (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/Document.cpp        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/dom/Document.cpp        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -4798,6 +4798,11 @@
</span><span class="cx"> {
</span><span class="cx">     return page() ? page()-&gt;inspectorTimelineAgent() : 0;
</span><span class="cx"> }
</span><ins>+
+InspectorController* Document::inspectorController() const 
+{
+    return page() ? page()-&gt;inspectorController() : 0;
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/Document.h (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/Document.h        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/dom/Document.h        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -450,6 +450,7 @@
</span><span class="cx">     Settings* settings() const; // can be NULL
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">     InspectorTimelineAgent* inspectorTimelineAgent() const; // can be NULL
</span><ins>+    virtual InspectorController* inspectorController() const; // can be NULL
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;Range&gt; createRange();
</span></span></pre></div>
<a id="trunkWebCoredomScriptExecutionContexth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/ScriptExecutionContext.h (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/ScriptExecutionContext.h        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/dom/ScriptExecutionContext.h        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -49,6 +49,9 @@
</span><span class="cx">     class SecurityOrigin;
</span><span class="cx">     class ScriptString;
</span><span class="cx">     class String;
</span><ins>+#if ENABLE(INSPECTOR)
+    class InspectorController;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     enum MessageDestination {
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="lines">@@ -84,6 +87,9 @@
</span><span class="cx">         virtual String userAgent(const KURL&amp;) const = 0;
</span><span class="cx"> 
</span><span class="cx">         SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }
</span><ins>+#if ENABLE(INSPECTOR)
+        virtual InspectorController* inspectorController() const { return 0; }
+#endif
</ins><span class="cx"> 
</span><span class="cx">         virtual void reportException(const String&amp; errorMessage, int lineNumber, const String&amp; sourceURL) = 0;
</span><span class="cx">         virtual void addMessage(MessageDestination, MessageSource, MessageType, MessageLevel, const String&amp; message, unsigned lineNumber, const String&amp; sourceURL) = 0;
</span></span></pre></div>
<a id="trunkWebCoreinspectorInjectedScriptHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InjectedScriptHost.cpp (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InjectedScriptHost.cpp        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/InjectedScriptHost.cpp        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2008 Matt Lilek &lt;webkit@mattlilek.com&gt;
</span><del>- * Copyright (C) 2009 Google Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010 Google Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> InjectedScriptHost::InjectedScriptHost(InspectorController* inspectorController)
</span><span class="cx">     : m_inspectorController(inspectorController)
</span><span class="cx">     , m_nextInjectedScriptId(1)
</span><ins>+    , m_lastWorkerId(1 &lt;&lt; 31) // Distinguish ids of fake workers from real ones, to minimize the chances they overlap.
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -194,6 +195,31 @@
</span><span class="cx">     return m_inspectorController-&gt;m_frontend.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+pair&lt;long, ScriptObject&gt; InjectedScriptHost::injectScript(const String&amp; source, ScriptState* scriptState)
+{
+    long id = m_nextInjectedScriptId++;
+    return std::make_pair(id, createInjectedScript(source, scriptState, id));
+}
+
+#if ENABLE(WORKERS)
+long InjectedScriptHost::nextWorkerId()
+{
+    return ++m_lastWorkerId;
+}
+
+void InjectedScriptHost::didCreateWorker(long id, const String&amp; url, bool isSharedWorker)
+{
+    if (m_inspectorController)
+        m_inspectorController-&gt;didCreateWorker(id, url, isSharedWorker);
+}
+
+void InjectedScriptHost::willDestroyWorker(long id)
+{
+    if (m_inspectorController)
+        m_inspectorController-&gt;willDestroyWorker(id);
+}
+#endif // ENABLE(WORKERS)
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INSPECTOR)
</span></span></pre></div>
<a id="trunkWebCoreinspectorInjectedScriptHosth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InjectedScriptHost.h (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InjectedScriptHost.h        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/InjectedScriptHost.h        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -80,8 +80,14 @@
</span><span class="cx"> #if ENABLE(DOM_STORAGE)
</span><span class="cx">     void selectDOMStorage(Storage* storage);
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(WORKERS)
+    long nextWorkerId();
+    void didCreateWorker(long id, const String&amp; url, bool isSharedWorker);
+    void willDestroyWorker(long id);
+#endif
</ins><span class="cx">     void reportDidDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException);
</span><span class="cx"> 
</span><ins>+    pair&lt;long, ScriptObject&gt; injectScript(const String&amp; source, ScriptState*);
</ins><span class="cx">     InjectedScript injectedScriptFor(ScriptState*);
</span><span class="cx">     InjectedScript injectedScriptForId(long);
</span><span class="cx">     void discardInjectedScripts();
</span><span class="lines">@@ -91,10 +97,12 @@
</span><span class="cx">     InjectedScriptHost(InspectorController* inspectorController);
</span><span class="cx">     InspectorDOMAgent* inspectorDOMAgent();
</span><span class="cx">     InspectorFrontend* inspectorFrontend();
</span><ins>+    ScriptObject createInjectedScript(const String&amp; source, ScriptState* scriptState, long id);
</ins><span class="cx"> 
</span><span class="cx">     InspectorController* m_inspectorController;
</span><span class="cx">     String m_injectedScriptSource;
</span><span class="cx">     long m_nextInjectedScriptId;
</span><ins>+    long m_lastWorkerId;
</ins><span class="cx">     typedef HashMap&lt;long, InjectedScript&gt; IdToInjectedScriptMap;
</span><span class="cx">     IdToInjectedScriptMap m_idToInjectedScript;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkWebCoreinspectorInjectedScriptHostidl"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InjectedScriptHost.idl (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InjectedScriptHost.idl        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/InjectedScriptHost.idl        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2008 Matt Lilek &lt;webkit@mattlilek.com&gt;
</span><del>- * Copyright (C) 2009 Google Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010 Google Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -55,6 +55,11 @@
</span><span class="cx">         [Custom] void selectDOMStorage(in DOMObject storage);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if defined(ENABLE_WORKERS) &amp;&amp; ENABLE_WORKERS
+        void didCreateWorker(in long id, in DOMString url, in boolean isFakeWorker);
+        void willDestroyWorker(in long id);
+        long nextWorkerId();
+#endif
</ins><span class="cx">         [Custom] void reportDidDispatchOnInjectedScript(in long callId, in DOMObject result, in boolean isException);
</span><span class="cx">     };
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorController.cpp (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorController.cpp        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/InspectorController.cpp        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> #include &quot;InspectorFrontend.h&quot;
</span><span class="cx"> #include &quot;InspectorFrontendHost.h&quot;
</span><span class="cx"> #include &quot;InspectorResource.h&quot;
</span><ins>+#include &quot;InspectorWorkerResource.h&quot;
</ins><span class="cx"> #include &quot;InspectorTimelineAgent.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;ProgressTracker.h&quot;
</span><span class="lines">@@ -730,6 +731,11 @@
</span><span class="cx">     for (DOMStorageResourcesMap::iterator it = m_domStorageResources.begin(); it != domStorageEnd; ++it)
</span><span class="cx">         it-&gt;second-&gt;bind(m_frontend.get());
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(WORKERS)
+    WorkersMap::iterator workersEnd = m_workers.end();
+    for (WorkersMap::iterator it = m_workers.begin(); it != workersEnd; ++it)
+        m_frontend-&gt;didCreateWorker(*it-&gt;second);
+#endif
</ins><span class="cx"> 
</span><span class="cx">     m_frontend-&gt;populateInterface();
</span><span class="cx"> 
</span><span class="lines">@@ -758,7 +764,9 @@
</span><span class="cx">     for (DOMStorageResourcesMap::iterator it = m_domStorageResources.begin(); it != domStorageEnd; ++it)
</span><span class="cx">         it-&gt;second-&gt;unbind();
</span><span class="cx"> #endif
</span><del>-
</del><ins>+#if ENABLE(WORKERS)
+    m_workers.clear();
+#endif
</ins><span class="cx">     if (m_timelineAgent)
</span><span class="cx">         m_timelineAgent-&gt;reset();
</span><span class="cx"> 
</span><span class="lines">@@ -845,10 +853,12 @@
</span><span class="cx">         if (ResourcesMap* resourceMap = m_frameResources.get(frame))
</span><span class="cx">             pruneResources(resourceMap, loader);
</span><span class="cx"> 
</span><del>-    for (Vector&lt;String&gt;::iterator it = m_scriptsToEvaluateOnLoad.begin();
-         it != m_scriptsToEvaluateOnLoad.end(); ++it) {
-        ScriptSourceCode scriptSourceCode(*it);
-        loader-&gt;frame()-&gt;script()-&gt;evaluate(scriptSourceCode);
</del><ins>+    if (m_scriptsToEvaluateOnLoad.size()) {
+        ScriptState* scriptState = mainWorldScriptState(loader-&gt;frame());
+        for (Vector&lt;String&gt;::iterator it = m_scriptsToEvaluateOnLoad.begin();
+             it != m_scriptsToEvaluateOnLoad.end(); ++it) {
+            m_injectedScriptHost-&gt;injectScript(*it, scriptState);
+        }
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1191,6 +1201,32 @@
</span><span class="cx">         m_frontend-&gt;timelineProfilerWasStopped();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WORKERS)
+void InspectorController::didCreateWorker(long id, const String&amp; url, bool isSharedWorker)
+{
+    if (!enabled())
+        return;
+
+    RefPtr&lt;InspectorWorkerResource&gt; workerResource(InspectorWorkerResource::create(id, url, isSharedWorker));
+    m_workers.set(id, workerResource);
+    if (m_frontend)
+        m_frontend-&gt;didCreateWorker(*workerResource);
+}
+
+void InspectorController::willDestroyWorker(long id)
+{
+    if (!enabled())
+        return;
+
+    WorkersMap::iterator workerResource = m_workers.find(id);
+    if (workerResource == m_workers.end())
+        return;
+    if (m_frontend)
+        m_frontend-&gt;willDestroyWorker(*workerResource-&gt;second);
+    m_workers.remove(workerResource);
+}
+#endif // ENABLE(WORKERS)
+
</ins><span class="cx"> #if ENABLE(DATABASE)
</span><span class="cx"> void InspectorController::selectDatabase(Database* database)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorController.h (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorController.h        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/InspectorController.h        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx"> class InspectorDatabaseResource;
</span><span class="cx"> class InspectorDOMStorageResource;
</span><span class="cx"> class InspectorResource;
</span><ins>+class InspectorWorkerResource;
</ins><span class="cx"> 
</span><span class="cx"> class InspectorController
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><span class="lines">@@ -185,11 +186,14 @@
</span><span class="cx"> 
</span><span class="cx">     void mainResourceFiredLoadEvent(DocumentLoader*, const KURL&amp;);
</span><span class="cx">     void mainResourceFiredDOMContentEvent(DocumentLoader*, const KURL&amp;);
</span><del>-    
</del><ins>+
</ins><span class="cx">     void didInsertDOMNode(Node*);
</span><span class="cx">     void didRemoveDOMNode(Node*);
</span><span class="cx">     void didModifyDOMAttr(Element*);
</span><del>-                                                        
</del><ins>+#if ENABLE(WORKERS)
+    void didCreateWorker(long id, const String&amp; url, bool isSharedWorker);
+    void willDestroyWorker(long id);
+#endif
</ins><span class="cx">     void getCookies(long callId);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATABASE)
</span><span class="lines">@@ -371,6 +375,11 @@
</span><span class="cx">     Timer&lt;InspectorController&gt; m_startProfiling;
</span><span class="cx">     ProfilesMap m_profiles;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(WORKERS)
+    typedef HashMap&lt;long, RefPtr&lt;InspectorWorkerResource&gt; &gt; WorkersMap;
+
+    WorkersMap m_workers;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline void InspectorController::didInsertDOMNode(Node* node)
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorFrontendcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorFrontend.cpp (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorFrontend.cpp        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/InspectorFrontend.cpp        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;InjectedScript.h&quot;
</span><span class="cx"> #include &quot;InjectedScriptHost.h&quot;
</span><span class="cx"> #include &quot;InspectorController.h&quot;
</span><ins>+#include &quot;InspectorWorkerResource.h&quot;
</ins><span class="cx"> #include &quot;Node.h&quot;
</span><span class="cx"> #include &quot;ScriptFunctionCall.h&quot;
</span><span class="cx"> #include &quot;ScriptObject.h&quot;
</span><span class="lines">@@ -471,6 +472,26 @@
</span><span class="cx">     function.call();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WORKERS)
+void InspectorFrontend::didCreateWorker(const InspectorWorkerResource&amp; worker)
+{
+    ScriptFunctionCall function(m_webInspector, &quot;dispatch&quot;);
+    function.appendArgument(&quot;didCreateWorker&quot;);
+    function.appendArgument(worker.id());
+    function.appendArgument(worker.url());
+    function.appendArgument(worker.isSharedWorker());
+    function.call();
+}
+
+void InspectorFrontend::willDestroyWorker(const InspectorWorkerResource&amp; worker)
+{
+    ScriptFunctionCall function(m_webInspector, &quot;dispatch&quot;); 
+    function.appendArgument(&quot;willDestroyWorker&quot;);
+    function.appendArgument(worker.id());
+    function.call();
+}
+#endif // ENABLE(WORKERS)
+
</ins><span class="cx"> void InspectorFrontend::didGetCookies(int callId, const ScriptArray&amp; cookies, const String&amp; cookiesString)
</span><span class="cx"> {
</span><span class="cx">     ScriptFunctionCall function(m_webInspector, &quot;dispatch&quot;); 
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorFrontendh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorFrontend.h (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorFrontend.h        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/InspectorFrontend.h        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     class ScriptString;
</span><span class="cx">     class SerializedScriptValue;
</span><span class="cx">     class Storage;
</span><ins>+    class InspectorWorkerResource;
</ins><span class="cx"> 
</span><span class="cx">     class InspectorFrontend : public Noncopyable {
</span><span class="cx">     public:
</span><span class="lines">@@ -131,6 +132,11 @@
</span><span class="cx">         void timelineProfilerWasStopped();
</span><span class="cx">         void addRecordToTimeline(const ScriptObject&amp;);
</span><span class="cx"> 
</span><ins>+#if ENABLE(WORKERS)
+        void didCreateWorker(const InspectorWorkerResource&amp;);
+        void willDestroyWorker(const InspectorWorkerResource&amp;);
+#endif // ENABLE(WORKER)
+
</ins><span class="cx">         void didGetCookies(int callId, const ScriptArray&amp; cookies, const String&amp; cookiesString);
</span><span class="cx">         void didDispatchOnInjectedScript(int callId, SerializedScriptValue* result, bool isException);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorWorkerResourcehfromrev55770trunkWebCoreworkersSharedWorkercpp"></a>
<div class="copfile"><h4>Copied: trunk/WebCore/inspector/InspectorWorkerResource.h (from rev 55770, trunk/WebCore/workers/SharedWorker.cpp) (0 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorWorkerResource.h                                (rev 0)
+++ trunk/WebCore/inspector/InspectorWorkerResource.h        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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 InspectorWorkerResource_h
+#define InspectorWorkerResource_h
+
+#if ENABLE(WORKERS) &amp;&amp; ENABLE(INSPECTOR)
+
+#include &quot;PlatformString.h&quot;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+
+namespace WebCore {
+
+class InspectorWorkerResource : public RefCounted&lt;InspectorWorkerResource&gt; {
+public:
+    static PassRefPtr&lt;InspectorWorkerResource&gt; create(long id, const String&amp; url, bool isSharedWorker)
+    {
+        return adoptRef(new InspectorWorkerResource(id, url, isSharedWorker));
+    }
+
+    long id() const { return m_id; }
+    const String&amp; url() const { return m_url; }
+    bool isSharedWorker() const { return m_isSharedWorker; }
+private:
+    InspectorWorkerResource(long id, const String&amp; url, bool isSharedWorker)
+        : m_id(id)
+        , m_url(url)
+        , m_isSharedWorker(isSharedWorker)
+    {
+    }
+
+    int m_id;
+    String m_url;
+    bool m_isSharedWorker;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WORKERS) &amp;&amp; ENABLE(INSPECTOR)
+
+#endif // InspectorWorkerResource_h
</ins></span></pre></div>
<a id="trunkWebCoreinspectorfrontendCheckboxjs"></a>
<div class="addfile"><h4>Added: trunk/WebCore/inspector/front-end/Checkbox.js (0 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/Checkbox.js                                (rev 0)
+++ trunk/WebCore/inspector/front-end/Checkbox.js        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+/*
+ * 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:
+ * 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. ``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
+ * 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.
+ */
+
+WebInspector.Checkbox = function(label, callback, checked, className, tooltip)
+{
+    this.element = document.createElement('label');
+    this._inputElement = document.createElement('input');
+
+    function callbackWrapper(event)
+    {
+        if (callback)
+            callback(event);
+        event.stopPropagation();
+        return true;
+    }
+    this._inputElement.type = &quot;checkbox&quot;;
+    this._inputElement.checked = checked;
+    this._inputElement.addEventListener(&quot;click&quot;, callbackWrapper, false);
+
+    this.element.className = className;
+    this.element.appendChild(this._inputElement);
+    this.element.appendChild(document.createTextNode(label));
+    if (tooltip)
+        this.element.title = tooltip;
+    this.element.addEventListener(&quot;click&quot;, callbackWrapper, false);
+}
+
+WebInspector.Checkbox.prototype = {
+    checked: function()
+    {
+        return this._inputElement.checked;
+    }
+}
+
</ins><span class="cx">Property changes on: trunk/WebCore/inspector/front-end/Checkbox.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkWebCoreinspectorfrontendInjectedFakeWorkerjs"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/InjectedFakeWorker.js (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/InjectedFakeWorker.js        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/front-end/InjectedFakeWorker.js        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-var InjectedFakeWorker = function()
</del><ins>+var InjectedFakeWorker = function(InjectedScriptHost, inspectedWindow, injectedScriptId)
</ins><span class="cx"> {
</span><span class="cx"> 
</span><span class="cx"> Worker = function(url)
</span><span class="lines">@@ -45,13 +45,13 @@
</span><span class="cx"> 
</span><span class="cx"> function FakeWorker(worker, url)
</span><span class="cx"> {
</span><del>-    var scriptURL = new URL(document.baseURI).completeWith(url);
</del><ins>+    var scriptURL = this._expandURLAndCheckOrigin(document.baseURI, location.href, url);
</ins><span class="cx"> 
</span><del>-    if (!scriptURL.sameOrigin(location.href))
-        throw new DOMCoreException(&quot;SECURITY_ERR&quot;,18);
-
</del><span class="cx">     this._worker = worker;
</span><span class="cx">     this._buildWorker(scriptURL);
</span><ins>+    this._id = InjectedScriptHost.nextWorkerId();
+
+    InjectedScriptHost.didCreateWorker(this._id, scriptURL.url, false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FakeWorker.prototype = {
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx"> 
</span><span class="cx">     terminate: function()
</span><span class="cx">     {
</span><ins>+        InjectedScriptHost.willDestroyWorker(this._id);
+
</ins><span class="cx">         if (this._frame != null) {
</span><span class="cx">             this._frame.onmessage = this._worker.onmessage = noop;
</span><span class="cx">             this._frame.frameElement.parentNode.removeChild(this._frame.frameElement);
</span><span class="lines">@@ -96,7 +98,7 @@
</span><span class="cx">     _handleException: function(e)
</span><span class="cx">     {
</span><span class="cx">         // NB: it should be an ErrorEvent, but creating it from script is not
</span><del>-        // currently supported, to emulate it on top of plain vanilla Event.
</del><ins>+        // currently supported, so emulate it on top of plain vanilla Event.
</ins><span class="cx">         var errorEvent = this._document.createEvent(&quot;Event&quot;);
</span><span class="cx">         errorEvent.initEvent(&quot;Event&quot;, false, false);
</span><span class="cx">         errorEvent.message = &quot;Uncaught exception&quot;;
</span><span class="lines">@@ -147,10 +149,13 @@
</span><span class="cx">         workerFrame.close = bind(this.terminate, this);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _importScripts: function(evalTarget)
</del><ins>+    _importScripts: function(targetFrame)
</ins><span class="cx">     {
</span><del>-        for (var i = 1; i &lt; arguments.length; ++i)
-            evalTarget.eval(this._loadScript(arguments[i]));
</del><ins>+        for (var i = 1; i &lt; arguments.length; ++i) {
+            var workerOrigin = targetFrame.__devtools.location.href;
+            var url = this._expandURLAndCheckOrigin(workerOrigin, workerOrigin, arguments[i]);
+            targetFrame.eval(this._loadScript(url.url) + &quot;\n//@ sourceURL= &quot; + url.url);
+        }
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     _loadScript: function(url)
</span><span class="lines">@@ -165,6 +170,15 @@
</span><span class="cx">             text = &quot;&quot;; // We've got error message, not worker code.
</span><span class="cx">         }
</span><span class="cx">         return text;
</span><ins>+    },
+
+    _expandURLAndCheckOrigin: function(baseURL, origin, url)
+    {
+        var scriptURL = new URL(baseURL).completeWith(url);
+
+        if (!scriptURL.sameOrigin(origin))
+            throw new DOMCoreException(&quot;SECURITY_ERR&quot;,18);
+        return scriptURL;
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreinspectorfrontendScriptsPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/ScriptsPanel.js (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/ScriptsPanel.js        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/front-end/ScriptsPanel.js        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -135,6 +135,7 @@
</span><span class="cx">     this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane();
</span><span class="cx">     this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane();
</span><span class="cx">     this.sidebarPanes.breakpoints = new WebInspector.BreakpointsSidebarPane();
</span><ins>+    this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane();
</ins><span class="cx"> 
</span><span class="cx">     for (var pane in this.sidebarPanes)
</span><span class="cx">         this.sidebarElement.appendChild(this.sidebarPanes[pane].element);
</span><span class="lines">@@ -424,7 +425,7 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         this._debuggerEnabled = true;
</span><del>-        this.reset();
</del><ins>+        this.reset(true);
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     debuggerWasDisabled: function()
</span><span class="lines">@@ -433,10 +434,10 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         this._debuggerEnabled = false;
</span><del>-        this.reset();
</del><ins>+        this.reset(true);
</ins><span class="cx">     },
</span><span class="cx"> 
</span><del>-    reset: function()
</del><ins>+    reset: function(preserveWorkers)
</ins><span class="cx">     {
</span><span class="cx">         this.visibleView = null;
</span><span class="cx"> 
</span><span class="lines">@@ -472,6 +473,8 @@
</span><span class="cx">         
</span><span class="cx">         this.sidebarPanes.watchExpressions.refreshExpressions();
</span><span class="cx">         this.sidebarPanes.breakpoints.reset();
</span><ins>+        if (!preserveWorkers)
+            this.sidebarPanes.workers.reset();
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     get visibleView()
</span></span></pre></div>
<a id="trunkWebCoreinspectorfrontendStylesSidebarPanejs"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/StylesSidebarPane.js (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/StylesSidebarPane.js        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/front-end/StylesSidebarPane.js        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -404,26 +404,20 @@
</span><span class="cx">         if (WebInspector.settings.showInheritedComputedStyleProperties)
</span><span class="cx">             this.element.addStyleClass(&quot;show-inherited&quot;);
</span><span class="cx"> 
</span><del>-        var showInheritedLabel = document.createElement(&quot;label&quot;);
-        var showInheritedInput = document.createElement(&quot;input&quot;);
-        showInheritedInput.type = &quot;checkbox&quot;;
-        showInheritedInput.checked = WebInspector.settings.showInheritedComputedStyleProperties;
-
</del><span class="cx">         var computedStyleSection = this;
</span><span class="cx">         var showInheritedToggleFunction = function(event) {
</span><del>-            WebInspector.settings.showInheritedComputedStyleProperties = showInheritedInput.checked;
</del><ins>+            WebInspector.settings.showInheritedComputedStyleProperties = computedStyleSection._showInheritedCheckbox.checked();
</ins><span class="cx">             if (WebInspector.settings.showInheritedComputedStyleProperties)
</span><span class="cx">                 computedStyleSection.element.addStyleClass(&quot;show-inherited&quot;);
</span><span class="cx">             else
</span><span class="cx">                 computedStyleSection.element.removeStyleClass(&quot;show-inherited&quot;);
</span><del>-            event.stopPropagation();
</del><span class="cx">         };
</span><span class="cx"> 
</span><del>-        showInheritedLabel.addEventListener(&quot;click&quot;, showInheritedToggleFunction, false);
</del><ins>+        this._showInheritedCheckbox = new WebInspector.Checkbox(WebInspector.UIString(&quot;Show inherited&quot;),
+                                                                showInheritedToggleFunction,
+                                                                WebInspector.settings.showInheritedComputedStyleProperties);
</ins><span class="cx"> 
</span><del>-        showInheritedLabel.appendChild(showInheritedInput);
-        showInheritedLabel.appendChild(document.createTextNode(WebInspector.UIString(&quot;Show inherited&quot;)));
-        this.subtitleElement.appendChild(showInheritedLabel);
</del><ins>+        this.subtitleElement.appendChild(this._showInheritedCheckbox.element);
</ins><span class="cx">     } else {
</span><span class="cx">         if (!subtitle) {
</span><span class="cx">             if (this.styleRule.parentStyleSheet &amp;&amp; this.styleRule.parentStyleSheet.href) {
</span></span></pre></div>
<a id="trunkWebCoreinspectorfrontendWebKitqrc"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/WebKit.qrc (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/WebKit.qrc        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/front-end/WebKit.qrc        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -13,6 +13,7 @@
</span><span class="cx">     &lt;file&gt;Callback.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;CallStackSidebarPane.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;ChangesView.js&lt;/file&gt;
</span><ins>+    &lt;file&gt;Checkbox.js&lt;/file&gt;
</ins><span class="cx">     &lt;file&gt;Color.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;ConsolePanel.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;ConsoleView.js&lt;/file&gt;
</span><span class="lines">@@ -89,6 +90,7 @@
</span><span class="cx">     &lt;file&gt;View.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;WatchExpressionsSidebarPane.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;WelcomeView.js&lt;/file&gt;
</span><ins>+    &lt;file&gt;WorkersSidebarPane.js&lt;/file&gt;
</ins><span class="cx">     &lt;file&gt;audits.css&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;inspector.css&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;inspectorSyntaxHighlight.css&lt;/file&gt;
</span></span></pre></div>
<a id="trunkWebCoreinspectorfrontendWorkersSidebarPanejs"></a>
<div class="addfile"><h4>Added: trunk/WebCore/inspector/front-end/WorkersSidebarPane.js (0 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/WorkersSidebarPane.js                                (rev 0)
+++ trunk/WebCore/inspector/front-end/WorkersSidebarPane.js        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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.
+ */
+
+WebInspector.WorkersSidebarPane = function()
+{
+    WebInspector.SidebarPane.call(this, WebInspector.UIString(&quot;Workers&quot;));
+    
+    this._workers = {};
+
+    this._enableWorkersCheckbox = new WebInspector.Checkbox(
+        WebInspector.UIString(&quot;Debug&quot;),
+        this._onTriggerInstrument.bind(this),
+        false,
+        &quot;sidebar-pane-subtitle&quot;,
+        WebInspector.UIString(&quot;Allow debugging workers. Enabling this option will replace native workers with the iframe-based JavaScript implementation&quot;));
+
+    this.titleElement.insertBefore(this._enableWorkersCheckbox.element, this.titleElement.firstChild);
+
+    this._listElement = document.createElement(&quot;ol&quot;);
+    this._listElement.className = &quot;workers-list&quot;;
+
+    this.bodyElement.appendChild(this._listElement);
+    this._treeOutline = new TreeOutline(this._listElement);
+}
+
+WebInspector.WorkersSidebarPane.prototype = {
+    addWorker: function(id, url, isShared)
+    {
+        if (id in this._workers) 
+            return;
+        var worker = new WebInspector.Worker(id, url, isShared);
+        this._workers[id] = worker;
+
+        var title = WebInspector.linkifyURL(url, WebInspector.displayNameForURL(url), &quot;worker-item&quot;, true, url);
+        var treeElement = new TreeElement(title, worker, false);
+        this._treeOutline.appendChild(treeElement);
+    },
+
+    removeWorker: function(id)
+    {
+        if (id in this._workers) {
+            this._treeOutline.removeChild(this._treeOutline.findTreeElement(this._workers[id]));
+            delete this._workers[id];
+        }
+    },
+
+    setInstrumentation: function(enabled)
+    {
+        InspectorBackend.removeAllScriptsToEvaluateOnLoad();
+        if (enabled)
+            InspectorBackend.addScriptToEvaluateOnLoad(&quot;(&quot; + InjectedFakeWorker + &quot;)&quot;);
+    },
+
+    reset: function()
+    {
+        InspectorBackend.removeAllScriptsToEvaluateOnLoad();
+        this.setInstrumentation(this._enableWorkersCheckbox.checked());
+        this._treeOutline.removeChildren();
+        this._workers = {};
+    },
+
+    _onTriggerInstrument: function(event)
+    {
+        this.setInstrumentation(this._enableWorkersCheckbox.checked());
+    }
+};
+
+WebInspector.WorkersSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
+
+WebInspector.Worker = function(id, url, shared)
+{
+    this.id = id;
+    this.url = url;
+    this.shared = shared;
+}
+
+WebInspector.didCreateWorker = function()
+{
+    var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
+    workersPane.addWorker.apply(workersPane, arguments);
+}
+
+WebInspector.willDestroyWorker = function()
+{
+    var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
+    workersPane.removeWorker.apply(workersPane, arguments);
+}
</ins><span class="cx">Property changes on: trunk/WebCore/inspector/front-end/WorkersSidebarPane.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkWebCoreinspectorfrontendinspectorcss"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/inspector.css (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/inspector.css        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/front-end/inspector.css        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -1329,15 +1329,6 @@
</span><span class="cx">     display: inline;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.section .header input[type=checkbox] {
-    height: 10px;
-    width: 10px;
-    margin-left: 0;
-    margin-top: 0;
-    margin-bottom: 0;
-    vertical-align: 2px;
-}
-
</del><span class="cx"> .section .header .subtitle, .event-bar .header .subtitle {
</span><span class="cx">     float: right;
</span><span class="cx">     font-size: 10px;
</span><span class="lines">@@ -1722,6 +1713,21 @@
</span><span class="cx">     height: 5px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.sidebar-pane-subtitle {
+    float: right;
+    overflow: hidden;
+}
+
+.sidebar-pane-subtitle input, .section .header input[type=checkbox] {
+    font-size: inherit;
+    hight: 1em;
+    width: 1em;
+    margin-left: 0;
+    margin-top: 0;
+    margin-bottom: 0.25em;
+    vertical-align: bottom;
+}
+
</ins><span class="cx"> .metrics {
</span><span class="cx">     padding: 8px;
</span><span class="cx">     font-size: 10px;
</span><span class="lines">@@ -3882,3 +3888,27 @@
</span><span class="cx">     white-space: nowrap;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.workers-list {
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}

+.workers-list &gt; li {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    margin-left: 1em;
+    font-size: 12px;
+}
+
+a.worker-item {
+    color: rgb(33%, 33%, 33%);
+    cursor: pointer;
+    text-decoration: none;
+}
+
+a.worker-item:hover {
+    color: rgb(15%, 15%, 15%);
+}
+
</ins></span></pre></div>
<a id="trunkWebCoreinspectorfrontendinspectorhtml"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/inspector.html (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/inspector.html        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/inspector/front-end/inspector.html        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;InspectorFrontendHostStub.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;Object.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;Settings.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script type=&quot;text/javascript&quot; src=&quot;Checkbox.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;ContextMenu.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;KeyboardShortcut.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;TextPrompt.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -74,6 +75,7 @@
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;CallStackSidebarPane.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;ScopeChainSidebarPane.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;WatchExpressionsSidebarPane.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script type=&quot;text/javascript&quot; src=&quot;WorkersSidebarPane.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;MetricsSidebarPane.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;PropertiesSidebarPane.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;EventListenersSidebarPane.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkWebCoreworkersAbstractWorkercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/workers/AbstractWorker.cpp (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/workers/AbstractWorker.cpp        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/workers/AbstractWorker.cpp        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Google Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010 Google Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -38,20 +38,39 @@
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;EventException.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><ins>+#include &quot;InspectorController.h&quot;
</ins><span class="cx"> #include &quot;ScriptExecutionContext.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+long AbstractWorker::s_lastId;
+
</ins><span class="cx"> AbstractWorker::AbstractWorker(ScriptExecutionContext* context)
</span><span class="cx">     : ActiveDOMObject(context, this)
</span><ins>+    , m_id(++s_lastId)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AbstractWorker::~AbstractWorker()
</span><span class="cx"> {
</span><ins>+    onDestroyWorker();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void AbstractWorker::onDestroyWorker()
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspector = scriptExecutionContext() ? scriptExecutionContext()-&gt;inspectorController() : 0)
+        inspector-&gt;willDestroyWorker(id());
+#endif
+}
+
+void AbstractWorker::contextDestroyed()
+{
+    onDestroyWorker();
+    ActiveDOMObject::contextDestroyed(); 
+}
+
</ins><span class="cx"> KURL AbstractWorker::resolveURL(const String&amp; url, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (url.isEmpty()) {
</span></span></pre></div>
<a id="trunkWebCoreworkersAbstractWorkerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/workers/AbstractWorker.h (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/workers/AbstractWorker.h        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/workers/AbstractWorker.h        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Google Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010 Google Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -57,6 +57,8 @@
</span><span class="cx">         using RefCounted&lt;AbstractWorker&gt;::ref;
</span><span class="cx">         using RefCounted&lt;AbstractWorker&gt;::deref;
</span><span class="cx"> 
</span><ins>+        long id() const { return m_id; }
+        virtual void contextDestroyed();
</ins><span class="cx">         AbstractWorker(ScriptExecutionContext*);
</span><span class="cx">         virtual ~AbstractWorker();
</span><span class="cx"> 
</span><span class="lines">@@ -69,8 +71,12 @@
</span><span class="cx">         virtual void derefEventTarget() { deref(); }
</span><span class="cx">         virtual EventTargetData* eventTargetData();
</span><span class="cx">         virtual EventTargetData* ensureEventTargetData();
</span><ins>+        void onDestroyWorker();
</ins><span class="cx">         
</span><span class="cx">         EventTargetData m_eventTargetData;
</span><ins>+        long m_id;
+
+        static long s_lastId;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCoreworkersSharedWorkercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/workers/SharedWorker.cpp (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/workers/SharedWorker.cpp        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/workers/SharedWorker.cpp        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;SharedWorker.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;InspectorController.h&quot;
</ins><span class="cx"> #include &quot;KURL.h&quot;
</span><span class="cx"> #include &quot;MessageChannel.h&quot;
</span><span class="cx"> #include &quot;MessagePort.h&quot;
</span><span class="lines">@@ -53,6 +54,10 @@
</span><span class="cx">     if (ec)
</span><span class="cx">         return;
</span><span class="cx">     SharedWorkerRepository::connect(this, remotePort.release(), scriptUrl, name, ec);
</span><ins>+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspector = scriptExecutionContext()-&gt;inspectorController())
+        inspector-&gt;didCreateWorker(id(), scriptUrl.string(), true);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> SharedWorker::~SharedWorker()
</span></span></pre></div>
<a id="trunkWebCoreworkersWorkercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/workers/Worker.cpp (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/workers/Worker.cpp        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebCore/workers/Worker.cpp        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><ins>+#include &quot;InspectorController.h&quot;
</ins><span class="cx"> #include &quot;MessageEvent.h&quot;
</span><span class="cx"> #include &quot;TextEncoding.h&quot;
</span><span class="cx"> #include &quot;WorkerContextProxy.h&quot;
</span><span class="lines">@@ -60,6 +61,10 @@
</span><span class="cx">     m_scriptLoader = new WorkerScriptLoader();
</span><span class="cx">     m_scriptLoader-&gt;loadAsynchronously(scriptExecutionContext(), scriptURL, DenyCrossOriginRequests, this);
</span><span class="cx">     setPendingActivity(this);  // The worker context does not exist while loading, so we must ensure that the worker object is not collected, as well as its event listeners.
</span><ins>+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspector = scriptExecutionContext()-&gt;inspectorController())
+        inspector-&gt;didCreateWorker(id(), scriptURL.string(), false);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Worker::~Worker()
</span></span></pre></div>
<a id="trunkWebKitchromiumChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/chromium/ChangeLog (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/chromium/ChangeLog        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebKit/chromium/ChangeLog        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2010-03-10  Andrey Kosyakov  &lt;caseq@chromium.org&gt;
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: display list of active workers &amp; support debugging
+        with fake workers
+        https://bugs.webkit.org/show_bug.cgi?id=35568
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+
</ins><span class="cx"> 2010-03-10  Tony Chang  &lt;tony@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Fisher.
</span></span></pre></div>
<a id="trunkWebKitchromiumsrcjsInspectorControllerImpljs"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/chromium/src/js/InspectorControllerImpl.js (55770 => 55771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/chromium/src/js/InspectorControllerImpl.js        2010-03-10 09:02:59 UTC (rev 55770)
+++ trunk/WebKit/chromium/src/js/InspectorControllerImpl.js        2010-03-10 09:22:04 UTC (rev 55771)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> devtools.InspectorBackendImpl = function()
</span><span class="cx"> {
</span><span class="cx">     WebInspector.InspectorBackendStub.call(this);
</span><ins>+    this.installInspectorControllerDelegate_(&quot;addScriptToEvaluateOnLoad&quot;);
</ins><span class="cx">     this.installInspectorControllerDelegate_(&quot;clearMessages&quot;);
</span><span class="cx">     this.installInspectorControllerDelegate_(&quot;copyNode&quot;);
</span><span class="cx">     this.installInspectorControllerDelegate_(&quot;deleteCookie&quot;);
</span><span class="lines">@@ -57,6 +58,7 @@
</span><span class="cx">     this.installInspectorControllerDelegate_(&quot;highlightDOMNode&quot;);
</span><span class="cx">     this.installInspectorControllerDelegate_(&quot;hideDOMNodeHighlight&quot;);
</span><span class="cx">     this.installInspectorControllerDelegate_(&quot;releaseWrapperObjectGroup&quot;);
</span><ins>+    this.installInspectorControllerDelegate_(&quot;removeAllScriptsToEvaluateOnLoad&quot;);
</ins><span class="cx">     this.installInspectorControllerDelegate_(&quot;reloadPage&quot;);
</span><span class="cx">     this.installInspectorControllerDelegate_(&quot;removeAttribute&quot;);
</span><span class="cx">     this.installInspectorControllerDelegate_(&quot;removeDOMStorageItem&quot;);
</span></span></pre>
</div>
</div>

</body>
</html>