<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#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>
<title>[30829] trunk/WebKit</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/30829">30829</a></dd>
<dt>Author</dt> <dd>aroben@apple.com</dd>
<dt>Date</dt> <dd>2008-03-06 08:12:33 -0800 (Thu, 06 Mar 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move WebCoreScriptDebuggerImp to its own source files

WebKit:

        Move WebCoreScriptDebuggerImp to its own source files

        Reviewed by Kevin M.

        * WebKit.xcodeproj/project.pbxproj: Added new files to the project.

WebKit/mac:

        Move WebCoreScriptDebuggerImp to its own source files

        Also changed WebCoreScriptDebuggerImp coding style to match our style
        guidelines.

        Reviewed by Kevin M.

        * WebView/WebCoreScriptDebugger.h: Added declaration of toNSURL
        function.
        * WebView/WebCoreScriptDebugger.mm: Removed WebCoreScriptDebuggerImp
        implementation.
        (toNSURL): Made no longer static.
        * WebView/WebCoreScriptDebuggerImp.h: Added.
        * WebView/WebCoreScriptDebuggerImp.mm: Added. Code was moved here from
        WebCoreScriptDebugger.mm and cleaned up.
        (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp):
        (WebCoreScriptDebuggerImp::sourceParsed):
        (WebCoreScriptDebuggerImp::callEvent):
        (WebCoreScriptDebuggerImp::atStatement):
        (WebCoreScriptDebuggerImp::returnEvent):
        (WebCoreScriptDebuggerImp::exception):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitChangeLog">trunk/WebKit/ChangeLog</a></li>
<li><a href="#trunkWebKitWebKitxcodeprojprojectpbxproj">trunk/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacWebViewWebCoreScriptDebuggerh">trunk/WebKit/mac/WebView/WebCoreScriptDebugger.h</a></li>
<li><a href="#trunkWebKitmacWebViewWebCoreScriptDebuggermm">trunk/WebKit/mac/WebView/WebCoreScriptDebugger.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebKitmacWebViewWebCoreScriptDebuggerImph">trunk/WebKit/mac/WebView/WebCoreScriptDebuggerImp.h</a></li>
<li><a href="#trunkWebKitmacWebViewWebCoreScriptDebuggerImpmm">trunk/WebKit/mac/WebView/WebCoreScriptDebuggerImp.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/ChangeLog (30828 => 30829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/ChangeLog        2008-03-06 16:12:14 UTC (rev 30828)
+++ trunk/WebKit/ChangeLog        2008-03-06 16:12:33 UTC (rev 30829)
</span><span class="lines">@@ -8,6 +8,14 @@
</span><span class="cx"> 
</span><span class="cx"> 2008-03-05  Adam Roben  &lt;aroben@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Move WebCoreScriptDebuggerImp to its own source files
+
+        Reviewed by Kevin M.
+
+        * WebKit.xcodeproj/project.pbxproj: Added new files to the project.
+
+2008-03-05  Adam Roben  &lt;aroben@apple.com&gt;
+
</ins><span class="cx">         Move WebCoreScriptDebugger to WebKit
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin.
</span></span></pre></div>
<a id="trunkWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebKit.xcodeproj/project.pbxproj (30828 => 30829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebKit.xcodeproj/project.pbxproj        2008-03-06 16:12:14 UTC (rev 30828)
+++ trunk/WebKit/WebKit.xcodeproj/project.pbxproj        2008-03-06 16:12:33 UTC (rev 30829)
</span><span class="lines">@@ -286,6 +286,8 @@
</span><span class="cx">                 BCDFA9130C10B93E00D3A10C /* WebKitPluginContainerView.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */; };
</span><span class="cx">                 C0D66C7F0D7EFE0C005AB3F9 /* WebCoreScriptDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = C0D66C7D0D7EFE0C005AB3F9 /* WebCoreScriptDebugger.h */; };
</span><span class="cx">                 C0D66C800D7EFE0C005AB3F9 /* WebCoreScriptDebugger.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0D66C7E0D7EFE0C005AB3F9 /* WebCoreScriptDebugger.mm */; };
</span><ins>+                C0D66D680D7F396C005AB3F9 /* WebCoreScriptDebuggerImp.h in Headers */ = {isa = PBXBuildFile; fileRef = C0D66D670D7F396C005AB3F9 /* WebCoreScriptDebuggerImp.h */; };
+                C0D66D6A0D7F3985005AB3F9 /* WebCoreScriptDebuggerImp.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0D66D690D7F3985005AB3F9 /* WebCoreScriptDebuggerImp.mm */; };
</ins><span class="cx">                 DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; };
</span><span class="cx">                 DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; };
</span><span class="cx">                 DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */; };
</span><span class="lines">@@ -537,6 +539,8 @@
</span><span class="cx">                 BEE52D4B0473032500CA289C /* WebKitSystemBits.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitSystemBits.m; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 C0D66C7D0D7EFE0C005AB3F9 /* WebCoreScriptDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreScriptDebugger.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C0D66C7E0D7EFE0C005AB3F9 /* WebCoreScriptDebugger.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreScriptDebugger.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                C0D66D670D7F396C005AB3F9 /* WebCoreScriptDebuggerImp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreScriptDebuggerImp.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C0D66D690D7F3985005AB3F9 /* WebCoreScriptDebuggerImp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreScriptDebuggerImp.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebElementDictionary.mm; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="lines">@@ -996,6 +1000,8 @@
</span><span class="cx">                                 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.mm */,
</span><span class="cx">                                 650F74E309E488F70020118A /* WebUnarchivingState.m */,
</span><span class="cx">                                 51A8B57A042834F700CA2D3A /* WebView.mm */,
</span><ins>+                                C0D66D670D7F396C005AB3F9 /* WebCoreScriptDebuggerImp.h */,
+                                C0D66D690D7F3985005AB3F9 /* WebCoreScriptDebuggerImp.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = WebView;
</span><span class="cx">                         path = mac/WebView;
</span><span class="lines">@@ -1324,6 +1330,7 @@
</span><span class="cx">                                 939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
</span><span class="cx">                                 939810970824BF01008DF038 /* npfunctions.h in Headers */,
</span><span class="cx">                                 C0D66C7F0D7EFE0C005AB3F9 /* WebCoreScriptDebugger.h in Headers */,
</span><ins>+                                C0D66D680D7F396C005AB3F9 /* WebCoreScriptDebuggerImp.h in Headers */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><span class="lines">@@ -1611,6 +1618,7 @@
</span><span class="cx">                                 939810E80824BF01008DF038 /* WebViewFactory.mm in Sources */,
</span><span class="cx">                                 939810DD0824BF01008DF038 /* npapi.m in Sources */,
</span><span class="cx">                                 C0D66C800D7EFE0C005AB3F9 /* WebCoreScriptDebugger.mm in Sources */,
</span><ins>+                                C0D66D6A0D7F3985005AB3F9 /* WebCoreScriptDebuggerImp.mm in Sources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (30828 => 30829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2008-03-06 16:12:14 UTC (rev 30828)
+++ trunk/WebKit/mac/ChangeLog        2008-03-06 16:12:33 UTC (rev 30829)
</span><span class="lines">@@ -1,5 +1,29 @@
</span><span class="cx"> 2008-03-05  Adam Roben  &lt;aroben@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Move WebCoreScriptDebuggerImp to its own source files
+
+        Also changed WebCoreScriptDebuggerImp coding style to match our style
+        guidelines.
+
+        Reviewed by Kevin M.
+
+        * WebView/WebCoreScriptDebugger.h: Added declaration of toNSURL
+        function.
+        * WebView/WebCoreScriptDebugger.mm: Removed WebCoreScriptDebuggerImp
+        implementation.
+        (toNSURL): Made no longer static.
+        * WebView/WebCoreScriptDebuggerImp.h: Added.
+        * WebView/WebCoreScriptDebuggerImp.mm: Added. Code was moved here from
+        WebCoreScriptDebugger.mm and cleaned up.
+        (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp):
+        (WebCoreScriptDebuggerImp::sourceParsed):
+        (WebCoreScriptDebuggerImp::callEvent):
+        (WebCoreScriptDebuggerImp::atStatement):
+        (WebCoreScriptDebuggerImp::returnEvent):
+        (WebCoreScriptDebuggerImp::exception):
+
+2008-03-05  Adam Roben  &lt;aroben@apple.com&gt;
+
</ins><span class="cx">         Move -_enterFrame and -_leaveFrame from WebCoreScriptDebugger to WebScriptDebugger
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Kevin M.
</span></span></pre></div>
<a id="trunkWebKitmacWebViewWebCoreScriptDebuggerh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebView/WebCoreScriptDebugger.h (30828 => 30829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebView/WebCoreScriptDebugger.h        2008-03-06 16:12:14 UTC (rev 30828)
+++ trunk/WebKit/mac/WebView/WebCoreScriptDebugger.h        2008-03-06 16:12:33 UTC (rev 30829)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NSString *toNSString(const KJS::UString&amp;);
</span><ins>+NSURL *toNSURL(const KJS::UString&amp;);
</ins><span class="cx"> 
</span><span class="cx"> // &quot;WebScriptDebugger&quot; protocol - must be implemented by a delegate
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitmacWebViewWebCoreScriptDebuggermm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebView/WebCoreScriptDebugger.mm (30828 => 30829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebView/WebCoreScriptDebugger.mm        2008-03-06 16:12:14 UTC (rev 30828)
+++ trunk/WebKit/mac/WebView/WebCoreScriptDebugger.mm        2008-03-06 16:12:33 UTC (rev 30829)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;WebCoreScriptDebugger.h&quot;
</span><span class="cx"> 
</span><ins>+#import &quot;WebCoreScriptDebuggerImp.h&quot;
</ins><span class="cx"> #import &quot;WebScriptDebugDelegate.h&quot;
</span><span class="cx"> #import &lt;JavaScriptCore/ExecState.h&gt;
</span><span class="cx"> #import &lt;JavaScriptCore/JSGlobalObject.h&gt;
</span><span class="lines">@@ -56,78 +57,14 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // convert UString to NSURL
</span><del>-static NSURL *toNSURL(const UString&amp; s)
</del><ins>+NSURL *toNSURL(const UString&amp; s)
</ins><span class="cx"> {
</span><span class="cx">     if (s.isEmpty())
</span><span class="cx">         return nil;
</span><span class="cx">     return KURL(s);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// C++ interface to KJS debugger callbacks
</del><span class="cx"> 
</span><del>-class WebCoreScriptDebuggerImp : public KJS::Debugger {
-
-  private:
-    WebCoreScriptDebugger  *_objc;      // our ObjC half
-    bool                    _nested;    // true =&gt; this is a nested call
-    WebScriptCallFrame *_current;   // top stack frame (copy of same field from ObjC side)
-
-  public:
-    // constructor
-    WebCoreScriptDebuggerImp(WebCoreScriptDebugger *objc, JSGlobalObject* globalObject) : _objc(objc) {
-        _nested = true;
-        _current = [[_objc delegate] enterFrame:globalObject-&gt;globalExec()];
-        attach(globalObject);
-        [[_objc delegate] enteredFrame:_current sourceId:-1 line:-1];
-        _nested = false;
-    }
-
-    // callbacks - relay to delegate
-    virtual bool sourceParsed(ExecState *state, int sid, const UString &amp;url, const UString &amp;source, int lineNumber, int errorLine, const UString &amp;errorMsg) {
-        if (!_nested) {
-            _nested = true;
-            [[_objc delegate] parsedSource:toNSString(source) fromURL:toNSURL(url) sourceId:sid startLine:lineNumber errorLine:errorLine errorMessage:toNSString(errorMsg)];
-            _nested = false;
-        }
-        return true;
-    }
-    virtual bool callEvent(ExecState *state, int sid, int lineno, JSObject *func, const List &amp;args) {
-        if (!_nested) {
-            _nested = true;
-            _current = [[_objc delegate] enterFrame:state];
-            [[_objc delegate] enteredFrame:_current sourceId:sid line:lineno];
-            _nested = false;
-        }
-        return true;
-    }
-    virtual bool atStatement(ExecState *state, int sid, int lineno, int lastLine) {
-        if (!_nested) {
-            _nested = true;
-            [[_objc delegate] hitStatement:_current sourceId:sid line:lineno];
-            _nested = false;
-        }
-        return true;
-    }
-    virtual bool returnEvent(ExecState *state, int sid, int lineno, JSObject *func) {
-        if (!_nested) {
-            _nested = true;
-            [[_objc delegate] leavingFrame:_current sourceId:sid line:lineno];
-            _current = [[_objc delegate] leaveFrame];
-            _nested = false;
-        }
-        return true;
-    }
-    virtual bool exception(ExecState *state, int sid, int lineno, JSValue *exception) {
-        if (!_nested) {
-            _nested = true;
-            [[_objc delegate] exceptionRaised:_current sourceId:sid line:lineno];
-            _nested = false;
-        }
-        return true;
-    }
-
-};
-
</del><span class="cx"> // WebCoreScriptDebugger
</span><span class="cx"> //
</span><span class="cx"> // This is the main (behind-the-scenes) debugger class in WebCore.
</span></span></pre></div>
<a id="trunkWebKitmacWebViewWebCoreScriptDebuggerImph"></a>
<div class="addfile"><h4>Added: trunk/WebKit/mac/WebView/WebCoreScriptDebuggerImp.h (0 => 30829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebView/WebCoreScriptDebuggerImp.h                                (rev 0)
+++ trunk/WebKit/mac/WebView/WebCoreScriptDebuggerImp.h        2008-03-06 16:12:33 UTC (rev 30829)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2008 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.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) 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 APPLE AND ITS 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 APPLE 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.
+ */
+
+// FIXME: This file and class should be renamed WebScriptDebugger
+
+#ifndef WebCoreScriptDebuggerImp_h
+#define WebCoreScriptDebuggerImp_h
+
+#include &lt;JavaScriptCore/debugger.h&gt;
+
+namespace KJS {
+    class ExecState;
+    class JSGlobalObject;
+    class JSObject;
+    class JSValue;
+    class List;
+    class UString;
+}
+
+@class WebCoreScriptDebugger;
+@class WebScriptCallFrame;
+
+class WebCoreScriptDebuggerImp : public KJS::Debugger {
+public:
+    WebCoreScriptDebuggerImp(WebCoreScriptDebugger*, KJS::JSGlobalObject*);
+
+    virtual bool sourceParsed(KJS::ExecState*, int sourceID, const KJS::UString&amp; sourceURL, const KJS::UString&amp; source, int lineNumber, int errorLine, const KJS::UString&amp; errorMsg);
+    virtual bool callEvent(KJS::ExecState*, int sourceID, int lineNumber, KJS::JSObject* function, const KJS::List&amp; args);
+    virtual bool atStatement(KJS::ExecState*, int sourceID, int firstLine, int lastLine);
+    virtual bool returnEvent(KJS::ExecState*, int sourceID, int lineNumber, KJS::JSObject* function);
+    virtual bool exception(KJS::ExecState*, int sourceID, int lineNumber, KJS::JSValue* exception);
+
+private:
+    WebCoreScriptDebugger *m_debugger;
+    bool m_callingDelegate;
+    WebScriptCallFrame *m_topCallFrame;
+};
+
+#endif // WebCoreScriptDebuggerImp_h
</ins></span></pre></div>
<a id="trunkWebKitmacWebViewWebCoreScriptDebuggerImpmm"></a>
<div class="addfile"><h4>Added: trunk/WebKit/mac/WebView/WebCoreScriptDebuggerImp.mm (0 => 30829)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebView/WebCoreScriptDebuggerImp.mm                                (rev 0)
+++ trunk/WebKit/mac/WebView/WebCoreScriptDebuggerImp.mm        2008-03-06 16:12:33 UTC (rev 30829)
</span><span class="lines">@@ -0,0 +1,109 @@
</span><ins>+/*
+ * Copyright (C) 2008 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.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) 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 APPLE AND ITS 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 APPLE 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.
+ */
+
+// FIXME: This file and class should be renamed WebScriptDebugger
+
+#include &quot;WebCoreScriptDebuggerImp.h&quot;
+
+#include &quot;WebCoreScriptDebugger.h&quot;
+#include &lt;JavaScriptCore/JSGlobalObject.h&gt;
+
+using namespace KJS;
+
+WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp(WebCoreScriptDebugger *debugger, JSGlobalObject* globalObject)
+    : m_debugger(debugger)
+{
+    m_callingDelegate = true;
+    m_topCallFrame = [[m_debugger delegate] enterFrame:globalObject-&gt;globalExec()];
+    attach(globalObject);
+    [[m_debugger delegate] enteredFrame:m_topCallFrame sourceId:-1 line:-1];
+    m_callingDelegate = false;
+}
+
+// callbacks - relay to delegate
+bool WebCoreScriptDebuggerImp::sourceParsed(ExecState* state, int sourceID, const UString&amp; url, const UString&amp; source, int lineNumber, int errorLine, const UString&amp; errorMsg)
+{
+    if (m_callingDelegate)
+        return true;
+
+    m_callingDelegate = true;
+    [[m_debugger delegate] parsedSource:toNSString(source) fromURL:toNSURL(url) sourceId:sourceID startLine:lineNumber errorLine:errorLine errorMessage:toNSString(errorMsg)];
+    m_callingDelegate = false;
+
+    return true;
+}
+
+bool WebCoreScriptDebuggerImp::callEvent(ExecState* state, int sourceID, int lineNumber, JSObject*, const List&amp;)
+{
+    if (m_callingDelegate)
+        return true;
+
+    m_callingDelegate = true;
+    m_topCallFrame = [[m_debugger delegate] enterFrame:state];
+    [[m_debugger delegate] enteredFrame:m_topCallFrame sourceId:sourceID line:lineNumber];
+    m_callingDelegate = false;
+
+    return true;
+}
+
+bool WebCoreScriptDebuggerImp::atStatement(ExecState* state, int sourceID, int lineNumber, int)
+{
+    if (m_callingDelegate)
+        return true;
+
+    m_callingDelegate = true;
+    [[m_debugger delegate] hitStatement:m_topCallFrame sourceId:sourceID line:lineNumber];
+    m_callingDelegate = false;
+
+    return true;
+}
+
+bool WebCoreScriptDebuggerImp::returnEvent(ExecState* state, int sourceID, int lineNumber, JSObject*)
+{
+    if (m_callingDelegate)
+        return true;
+
+    m_callingDelegate = true;
+    [[m_debugger delegate] leavingFrame:m_topCallFrame sourceId:sourceID line:lineNumber];
+    m_topCallFrame = [[m_debugger delegate] leaveFrame];
+    m_callingDelegate = false;
+
+    return true;
+}
+
+bool WebCoreScriptDebuggerImp::exception(ExecState* state, int sourceID, int lineNumber, JSValue*)
+{
+    if (m_callingDelegate)
+        return true;
+
+    m_callingDelegate = true;
+    [[m_debugger delegate] exceptionRaised:m_topCallFrame sourceId:sourceID line:lineNumber];
+    m_callingDelegate = false;
+
+    return true;
+}
</ins></span></pre>
</div>
</div>

</body>
</html>