<!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>[37848] 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/37848">37848</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2008-10-24 11:49:39 -0700 (Fri, 24 Oct 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add a mechanism to store and retrieve preferences for the Web Inspector.

WebCore:

2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;

        Add a mechanism to ask the InspectorClient for key/value setting pairs.
        These settings can be strings, numbers, booleans or string vectors. The
        settings are also bridged to and from JavaScript.

        https://bugs.webkit.org/show_bug.cgi?id=21856

        Reviewed by Darin Adler.

        * WebCore.base.exp: Expose the String CFStringRef constructor.
        * inspector/InspectorClient.h:
        (WebCore::InspectorClient::populateSetting): Added, pure virtual.
        (WebCore::InspectorClient::storeSetting): Ditto.
        (WebCore::InspectorClient::removeSetting): Ditto.
        * inspector/InspectorController.cpp:
        (WebCore::setting): Calls InspectorController::setting and wraps the result in script types.
        (WebCore::setSetting): Calls InspectorController::setSetting after converting from script types.
        (WebCore::InspectorController::InspectorController): Increment a global static
        to track the number of live InspectorControllers.
        (WebCore::InspectorController::~InspectorController): Decrement the global static
        that tracks the number of live InspectorControllers. Delete the setting cache if there
        are no more live controllers.
        (WebCore::InspectorController::setting): Check the cache and return the setting from there,
        otherwise make a new Setting and ask the client to populate it.
        (WebCore::InspectorController::setSetting): Change the cache and ask the client to store it.
        (WebCore::InspectorController::windowScriptObjectAvailable): Add setting and setSetting
        to the InspectorController script class.
        * inspector/InspectorController.h:
        (WebCore::InspectorController::Setting::Setting):
        (WebCore::InspectorController::Setting::operator=):
        (WebCore::InspectorController::Setting::type): Return m_type.
        (WebCore::InspectorController::Setting::string): Return m_string. Assert the type is correct.
        (WebCore::InspectorController::Setting::stringVector): Return m_stringVector.
        Assert the type is correct.
        (WebCore::InspectorController::Setting::doubleValue): Return m_simpleContent.m_double.
        Assert the type is correct.
        (WebCore::InspectorController::Setting::integerValue): Return m_simpleContent.m_integer.
        Assert the type is correct.
        (WebCore::InspectorController::Setting::booleanValue): Return m_simpleContent.m_boolean.
        Assert the type is correct.
        (WebCore::InspectorController::Setting::set): Overloaded for each data type, sets the right
        field and the type.
        * loader/EmptyClients.h:
        (WebCore::EmptyInspectorClient::populateSetting): Added, empty method.
        (WebCore::EmptyInspectorClient::storeSetting): Ditto.
        (WebCore::EmptyInspectorClient::removeSetting): Ditto.

WebKit:

2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;

        Implement new InspectorClient methods to work with Settings.

        https://bugs.webkit.org/show_bug.cgi?id=21856

        Reviewed by Darin Adler.

        * WebKit.xcodeproj/project.pbxproj: Add the new InspectorClientCF.cpp file.

WebKit/gtk:

2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;

        Stub out new InspectorClient methods.

        https://bugs.webkit.org/show_bug.cgi?id=21856

        Reviewed by Darin Adler.

        * WebCoreSupport/InspectorClientGtk.cpp:
        (WebKit::InspectorClient::populateSetting): Not implemented.
        (WebKit::InspectorClient::storeSetting): Ditto.
        (WebKit::InspectorClient::removeSetting): Ditto.
        * WebCoreSupport/InspectorClientGtk.h:

WebKit/mac:

2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;

        Implement new InspectorClient methods to work with Settings.

        https://bugs.webkit.org/show_bug.cgi?id=21856

        Reviewed by Darin Adler.

        * WebCoreSupport/WebInspectorClient.h: Add the new methods and
        guard the ObjC parts of the header.

WebKit/qt:

2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;

        Stub out new InspectorClient methods.

        https://bugs.webkit.org/show_bug.cgi?id=21856

        Reviewed by Darin Adler.

        * WebCoreSupport/InspectorClientQt.cpp:
        (WebCore::InspectorClientQt::populateSetting): Not implemented.
        (WebCore::InspectorClientQt::storeSetting): Ditto.
        (WebCore::InspectorClientQt::removeSetting): Ditto.
        * WebCoreSupport/InspectorClientQt.h:

WebKit/win:

2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;

        Implement new InspectorClient methods to work with Settings.

        https://bugs.webkit.org/show_bug.cgi?id=21856

        Reviewed by Adam Roben.

        * WebKit.vcproj/WebKit.vcproj: Add the new InspectorClientCF.cpp file.
        * WebCoreSupport/WebInspectorClient.h: Add the new methods.

WebKit/wx:

2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;

        Stub out new InspectorClient methods.

        https://bugs.webkit.org/show_bug.cgi?id=21856

        Reviewed by Darin Adler.

        * WebKitSupport/InspectorClientWx.cpp:
        (WebCore::InspectorClient::populateSetting): Not implemented.
        (WebCore::InspectorClient::storeSetting): Ditto.
        (WebCore::InspectorClient::removeSetting): Ditto.
        * WebKitSupport/InspectorClientWx.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreWebCorebaseexp">trunk/WebCore/WebCore.base.exp</a></li>
<li><a href="#trunkWebCoreinspectorInspectorClienth">trunk/WebCore/inspector/InspectorClient.h</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="#trunkWebCoreloaderEmptyClientsh">trunk/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkWebKitChangeLog">trunk/WebKit/ChangeLog</a></li>
<li><a href="#trunkWebKitWebKitxcodeprojprojectpbxproj">trunk/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkWebKitgtkChangeLog">trunk/WebKit/gtk/ChangeLog</a></li>
<li><a href="#trunkWebKitgtkWebCoreSupportInspectorClientGtkcpp">trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp</a></li>
<li><a href="#trunkWebKitgtkWebCoreSupportInspectorClientGtkh">trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebInspectorClienth">trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.h</a></li>
<li><a href="#trunkWebKitqtChangeLog">trunk/WebKit/qt/ChangeLog</a></li>
<li><a href="#trunkWebKitqtWebCoreSupportInspectorClientQtcpp">trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp</a></li>
<li><a href="#trunkWebKitqtWebCoreSupportInspectorClientQth">trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.h</a></li>
<li><a href="#trunkWebKitwinChangeLog">trunk/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkWebKitwinWebCoreSupportWebInspectorClienth">trunk/WebKit/win/WebCoreSupport/WebInspectorClient.h</a></li>
<li><a href="#trunkWebKitwinWebKitvcprojWebKitvcproj">trunk/WebKit/win/WebKit.vcproj/WebKit.vcproj</a></li>
<li><a href="#trunkWebKitwxChangeLog">trunk/WebKit/wx/ChangeLog</a></li>
<li><a href="#trunkWebKitwxWebKitSupportInspectorClientWxcpp">trunk/WebKit/wx/WebKitSupport/InspectorClientWx.cpp</a></li>
<li><a href="#trunkWebKitwxWebKitSupportInspectorClientWxh">trunk/WebKit/wx/WebKitSupport/InspectorClientWx.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/WebKit/cf/</li>
<li><a href="#trunkWebKitcfChangeLog">trunk/WebKit/cf/ChangeLog</a></li>
<li>trunk/WebKit/cf/WebCoreSupport/</li>
<li><a href="#trunkWebKitcfWebCoreSupportWebInspectorClientCFcpp">trunk/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebCore/ChangeLog        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Add a mechanism to ask the InspectorClient for key/value setting pairs.
+        These settings can be strings, numbers, booleans or string vectors. The
+        settings are also bridged to and from JavaScript.
+
+        https://bugs.webkit.org/show_bug.cgi?id=21856
+
+        Reviewed by Darin Adler.
+
+        * WebCore.base.exp: Expose the String CFStringRef constructor.
+        * inspector/InspectorClient.h:
+        (WebCore::InspectorClient::populateSetting): Added, pure virtual.
+        (WebCore::InspectorClient::storeSetting): Ditto.
+        (WebCore::InspectorClient::removeSetting): Ditto.
+        * inspector/InspectorController.cpp:
+        (WebCore::setting): Calls InspectorController::setting and wraps the result in script types.
+        (WebCore::setSetting): Calls InspectorController::setSetting after converting from script types.
+        (WebCore::InspectorController::InspectorController): Increment a global static
+        to track the number of live InspectorControllers.
+        (WebCore::InspectorController::~InspectorController): Decrement the global static
+        that tracks the number of live InspectorControllers. Delete the setting cache if there
+        are no more live controllers.
+        (WebCore::InspectorController::setting): Check the cache and return the setting from there,
+        otherwise make a new Setting and ask the client to populate it.
+        (WebCore::InspectorController::setSetting): Change the cache and ask the client to store it.
+        (WebCore::InspectorController::windowScriptObjectAvailable): Add setting and setSetting
+        to the InspectorController script class.
+        * inspector/InspectorController.h:
+        (WebCore::InspectorController::Setting::Setting):
+        (WebCore::InspectorController::Setting::operator=):
+        (WebCore::InspectorController::Setting::type): Return m_type.
+        (WebCore::InspectorController::Setting::string): Return m_string. Assert the type is correct.
+        (WebCore::InspectorController::Setting::stringVector): Return m_stringVector.
+        Assert the type is correct.
+        (WebCore::InspectorController::Setting::doubleValue): Return m_simpleContent.m_double.
+        Assert the type is correct.
+        (WebCore::InspectorController::Setting::integerValue): Return m_simpleContent.m_integer.
+        Assert the type is correct.
+        (WebCore::InspectorController::Setting::booleanValue): Return m_simpleContent.m_boolean.
+        Assert the type is correct.
+        (WebCore::InspectorController::Setting::set): Overloaded for each data type, sets the right
+        field and the type.
+        * loader/EmptyClients.h:
+        (WebCore::EmptyInspectorClient::populateSetting): Added, empty method.
+        (WebCore::EmptyInspectorClient::storeSetting): Ditto.
+        (WebCore::EmptyInspectorClient::removeSetting): Ditto.
+
</ins><span class="cx"> 2008-10-24  Cameron Zwarich  &lt;zwarich@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Sam Weinig.
</span></span></pre></div>
<a id="trunkWebCoreWebCorebaseexp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.base.exp (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.base.exp        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebCore/WebCore.base.exp        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -533,6 +533,7 @@
</span><span class="cx"> __ZN7WebCore6String6appendERKS0_
</span><span class="cx"> __ZN7WebCore6String6appendEc
</span><span class="cx"> __ZN7WebCore6StringC1EP8NSString
</span><ins>+__ZN7WebCore6StringC1EPK10__CFString
</ins><span class="cx"> __ZN7WebCore6StringC1EPKc
</span><span class="cx"> __ZN7WebCore6StringC1EPKcj
</span><span class="cx"> __ZN7WebCore6StringC1ERKN3JSC7UStringE
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorClienth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorClient.h (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorClient.h        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebCore/inspector/InspectorClient.h        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #ifndef InspectorClient_h
</span><span class="cx"> #define InspectorClient_h
</span><span class="cx"> 
</span><ins>+#include &quot;InspectorController.h&quot;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Node;
</span><span class="lines">@@ -54,6 +56,10 @@
</span><span class="cx">     virtual void hideHighlight() = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual void inspectedURLChanged(const String&amp; newURL) = 0;
</span><ins>+
+    virtual void populateSetting(const String&amp; key, InspectorController::Setting&amp;) = 0;
+    virtual void storeSetting(const String&amp; key, const InspectorController::Setting&amp;) = 0;
+    virtual void removeSetting(const String&amp; key) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorController.cpp (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorController.cpp        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebCore/inspector/InspectorController.cpp        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -744,6 +744,104 @@
</span><span class="cx">     return toRef(JSInspectedObjectWrapper::wrap(inspectedWindow-&gt;globalExec(), inspectedWindow));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static JSValueRef setting(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef arguments[], JSValueRef* exception)
+{
+    InspectorController* controller = reinterpret_cast&lt;InspectorController*&gt;(JSObjectGetPrivate(thisObject));
+    if (!controller)
+        return JSValueMakeUndefined(ctx);
+
+    JSValueRef keyValue = arguments[0];
+    if (!JSValueIsString(ctx, keyValue))
+        return JSValueMakeUndefined(ctx);
+
+    const InspectorController::Setting&amp; setting = controller-&gt;setting(toString(ctx, keyValue, exception));
+
+    switch (setting.type()) {
+        default:
+        case InspectorController::Setting::NoType:
+            return JSValueMakeUndefined(ctx);
+        case InspectorController::Setting::StringType:
+            return JSValueMakeString(ctx, jsStringRef(setting.string()).get());
+        case InspectorController::Setting::DoubleType:
+            return JSValueMakeNumber(ctx, setting.doubleValue());
+        case InspectorController::Setting::IntegerType:
+            return JSValueMakeNumber(ctx, setting.integerValue());
+        case InspectorController::Setting::BooleanType:
+            return JSValueMakeBoolean(ctx, setting.booleanValue());
+        case InspectorController::Setting::StringVectorType: {
+            Vector&lt;JSValueRef&gt; stringValues;
+            const Vector&lt;String&gt;&amp; strings = setting.stringVector();
+            const unsigned length = strings.size();
+            for (unsigned i = 0; i &lt; length; ++i)
+                stringValues.append(JSValueMakeString(ctx, jsStringRef(strings[i]).get()));
+
+            JSObjectRef stringsArray = JSObjectMakeArray(ctx, stringValues.size(), stringValues.data(), exception);
+            if (exception &amp;&amp; *exception)
+                return JSValueMakeUndefined(ctx);
+            return stringsArray;
+        }
+    }
+}
+
+static JSValueRef setSetting(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef arguments[], JSValueRef* exception)
+{
+    InspectorController* controller = reinterpret_cast&lt;InspectorController*&gt;(JSObjectGetPrivate(thisObject));
+    if (!controller)
+        return JSValueMakeUndefined(ctx);
+
+    JSValueRef keyValue = arguments[0];
+    if (!JSValueIsString(ctx, keyValue))
+        return JSValueMakeUndefined(ctx);
+
+    InspectorController::Setting setting;
+
+    JSValueRef value = arguments[1];
+    switch (JSValueGetType(ctx, value)) {
+        default:
+        case kJSTypeUndefined:
+        case kJSTypeNull:
+            // Do nothing. The setting is already NoType.
+            ASSERT(setting.type() == InspectorController::Setting::NoType);
+            break;
+        case kJSTypeString:
+            setting.set(toString(ctx, value, exception));
+            break;
+        case kJSTypeNumber:
+            setting.set(JSValueToNumber(ctx, value, exception));
+            break;
+        case kJSTypeBoolean:
+            setting.set(JSValueToBoolean(ctx, value));
+            break;
+        case kJSTypeObject: {
+            JSObjectRef object = JSValueToObject(ctx, value, 0);
+            JSValueRef lengthValue = JSObjectGetProperty(ctx, object, jsStringRef(&quot;length&quot;).get(), exception);
+            if (exception &amp;&amp; *exception)
+                return JSValueMakeUndefined(ctx);
+
+            Vector&lt;String&gt; strings;
+            const unsigned length = static_cast&lt;unsigned&gt;(JSValueToNumber(ctx, lengthValue, 0));
+            for (unsigned i = 0; i &lt; length; ++i) {
+                JSValueRef itemValue = JSObjectGetPropertyAtIndex(ctx, object, i, exception);
+                if (exception &amp;&amp; *exception)
+                    return JSValueMakeUndefined(ctx);
+                strings.append(toString(ctx, itemValue, exception));
+                if (exception &amp;&amp; *exception)
+                    return JSValueMakeUndefined(ctx);
+            }
+
+            setting.set(strings);
+            break;
+        }
+    }
+
+    if (exception &amp;&amp; *exception)
+        return JSValueMakeUndefined(ctx);
+
+    controller-&gt;setSetting(toString(ctx, keyValue, exception), setting);
+
+    return JSValueMakeUndefined(ctx);
+}
+
</ins><span class="cx"> static JSValueRef localizedStrings(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]*/, JSValueRef* /*exception*/)
</span><span class="cx"> {
</span><span class="cx">     InspectorController* controller = reinterpret_cast&lt;InspectorController*&gt;(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -955,6 +1053,9 @@
</span><span class="cx"> 
</span><span class="cx"> // InspectorController Class
</span><span class="cx"> 
</span><ins>+static unsigned s_inspectorControllerCount;
+static HashMap&lt;String, InspectorController::Setting*&gt;* s_settingCache;
+
</ins><span class="cx"> InspectorController::InspectorController(Page* page, InspectorClient* client)
</span><span class="cx">     : m_inspectedPage(page)
</span><span class="cx">     , m_client(client)
</span><span class="lines">@@ -978,6 +1079,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT_ARG(page, page);
</span><span class="cx">     ASSERT_ARG(client, client);
</span><ins>+    ++s_inspectorControllerCount;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorController::~InspectorController()
</span><span class="lines">@@ -1005,6 +1107,15 @@
</span><span class="cx"> 
</span><span class="cx">     deleteAllValues(m_frameResources);
</span><span class="cx">     deleteAllValues(m_consoleMessages);
</span><ins>+
+    ASSERT(s_inspectorControllerCount);
+    --s_inspectorControllerCount;
+
+    if (!s_inspectorControllerCount &amp;&amp; s_settingCache) {
+        deleteAllValues(*s_settingCache);
+        delete s_settingCache;
+        s_settingCache = 0;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorController::inspectedPageDestroyed()
</span><span class="lines">@@ -1023,6 +1134,48 @@
</span><span class="cx">     return m_inspectedPage-&gt;settings()-&gt;developerExtrasEnabled();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const InspectorController::Setting&amp; InspectorController::setting(const String&amp; key) const
+{
+    if (!s_settingCache)
+        s_settingCache = new HashMap&lt;String, Setting*&gt;;
+
+    if (Setting* cachedSetting = s_settingCache-&gt;get(key))
+        return *cachedSetting;
+
+    Setting* newSetting = new Setting;
+    s_settingCache-&gt;set(key, newSetting);
+
+    m_client-&gt;populateSetting(key, *newSetting);
+
+    return *newSetting;
+}
+
+void InspectorController::setSetting(const String&amp; key, const Setting&amp; setting)
+{
+    if (setting.type() == Setting::NoType) {
+        if (s_settingCache) {
+            Setting* cachedSetting = s_settingCache-&gt;get(key);
+            if (cachedSetting) {
+                s_settingCache-&gt;remove(key);
+                delete cachedSetting;
+            }
+        }
+
+        m_client-&gt;removeSetting(key);
+        return;
+    }
+
+    if (!s_settingCache)
+        s_settingCache = new HashMap&lt;String, Setting*&gt;;
+
+    if (Setting* cachedSetting = s_settingCache-&gt;get(key))
+        *cachedSetting = setting;
+    else
+        s_settingCache-&gt;set(key, new Setting(setting));
+
+    m_client-&gt;storeSetting(key, setting);
+}
+
</ins><span class="cx"> String InspectorController::localizedStringsURL()
</span><span class="cx"> {
</span><span class="cx">     if (!enabled())
</span><span class="lines">@@ -1369,6 +1522,8 @@
</span><span class="cx"> #if ENABLE(DATABASE)
</span><span class="cx">         { &quot;databaseTableNames&quot;, WebCore::databaseTableNames, kJSPropertyAttributeNone },
</span><span class="cx"> #endif
</span><ins>+        { &quot;setting&quot;, WebCore::setting, kJSPropertyAttributeNone },
+        { &quot;setSetting&quot;, WebCore::setSetting, kJSPropertyAttributeNone },
</ins><span class="cx">         { &quot;inspectedWindow&quot;, WebCore::inspectedWindow, kJSPropertyAttributeNone },
</span><span class="cx">         { &quot;localizedStringsURL&quot;, WebCore::localizedStrings, kJSPropertyAttributeNone },
</span><span class="cx">         { &quot;platform&quot;, WebCore::platform, kJSPropertyAttributeNone },
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorController.h (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorController.h        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebCore/inspector/InspectorController.h        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -85,6 +85,43 @@
</span><span class="cx">         ScriptsPanel
</span><span class="cx">     } SpecialPanels;
</span><span class="cx"> 
</span><ins>+    struct Setting {
+        enum Type {
+            NoType, StringType, StringVectorType, DoubleType, IntegerType, BooleanType
+        };
+
+        Setting()
+            : m_type(NoType)
+        {
+        }
+
+        Type type() const { return m_type; }
+
+        String string() const { ASSERT(m_type == StringType); return m_string; }
+        const Vector&lt;String&gt;&amp; stringVector() const { ASSERT(m_type == StringVectorType); return m_stringVector; }
+        double doubleValue() const { ASSERT(m_type == DoubleType); return m_simpleContent.m_double; }
+        long integerValue() const { ASSERT(m_type == IntegerType); return m_simpleContent.m_integer; }
+        bool booleanValue() const { ASSERT(m_type == BooleanType); return m_simpleContent.m_boolean; }
+
+        void set(const String&amp; value) { m_type = StringType; m_string = value; }
+        void set(const Vector&lt;String&gt;&amp; value) { m_type = StringVectorType; m_stringVector = value; }
+        void set(double value) { m_type = DoubleType; m_simpleContent.m_double = value; }
+        void set(long value) { m_type = IntegerType; m_simpleContent.m_integer = value; }
+        void set(bool value) { m_type = BooleanType; m_simpleContent.m_boolean = value; }
+
+    private:
+        Type m_type;
+
+        String m_string;
+        Vector&lt;String&gt; m_stringVector;
+
+        union {
+            double m_double;
+            long m_integer;
+            bool m_boolean;
+        } m_simpleContent;
+    };
+
</ins><span class="cx">     InspectorController(Page*, InspectorClient*);
</span><span class="cx">     ~InspectorController();
</span><span class="cx"> 
</span><span class="lines">@@ -95,6 +132,9 @@
</span><span class="cx"> 
</span><span class="cx">     Page* inspectedPage() const { return m_inspectedPage; }
</span><span class="cx"> 
</span><ins>+    const Setting&amp; setting(const String&amp; key) const;
+    void setSetting(const String&amp; key, const Setting&amp;);
+
</ins><span class="cx">     String localizedStringsURL();
</span><span class="cx"> 
</span><span class="cx">     void inspect(Node*);
</span></span></pre></div>
<a id="trunkWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/loader/EmptyClients.h (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/loader/EmptyClients.h        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebCore/loader/EmptyClients.h        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -386,25 +386,29 @@
</span><span class="cx"> 
</span><span class="cx"> class EmptyInspectorClient : public InspectorClient {
</span><span class="cx"> public:
</span><del>-    virtual ~EmptyInspectorClient() {}
</del><ins>+    virtual ~EmptyInspectorClient() { }
</ins><span class="cx"> 
</span><del>-    virtual void inspectorDestroyed() {};
</del><ins>+    virtual void inspectorDestroyed() { }
</ins><span class="cx"> 
</span><span class="cx">     virtual Page* createPage() { return 0; };
</span><span class="cx"> 
</span><del>-    virtual String localizedStringsURL() { return String(); };
</del><ins>+    virtual String localizedStringsURL() { return String(); }
</ins><span class="cx"> 
</span><del>-    virtual void showWindow() {};
-    virtual void closeWindow() {};
</del><ins>+    virtual void showWindow() { }
+    virtual void closeWindow() { }
</ins><span class="cx"> 
</span><del>-    virtual void attachWindow() {};
-    virtual void detachWindow() {};
</del><ins>+    virtual void attachWindow() { }
+    virtual void detachWindow() { }
</ins><span class="cx"> 
</span><del>-    virtual void setAttachedWindowHeight(unsigned) {};
</del><ins>+    virtual void setAttachedWindowHeight(unsigned) { }
</ins><span class="cx"> 
</span><del>-    virtual void highlight(Node*) {};
-    virtual void hideHighlight() {};
-    virtual void inspectedURLChanged(const String&amp; newURL) {};
</del><ins>+    virtual void highlight(Node*) { }
+    virtual void hideHighlight() { }
+    virtual void inspectedURLChanged(const String&amp; newURL) { }
+
+    virtual void populateSetting(const String&amp; key, InspectorController::Setting&amp;) { }
+    virtual void storeSetting(const String&amp; key, const InspectorController::Setting&amp;) { }
+    virtual void removeSetting(const String&amp; key) { }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/ChangeLog (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/ChangeLog        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/ChangeLog        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Implement new InspectorClient methods to work with Settings.
+
+        https://bugs.webkit.org/show_bug.cgi?id=21856
+
+        Reviewed by Darin Adler.
+
+        * WebKit.xcodeproj/project.pbxproj: Add the new InspectorClientCF.cpp file.
+
</ins><span class="cx"> 2008-10-15  Mark Rowe  &lt;mrowe@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rubber-stamped by Brady Eidson.
</span></span></pre></div>
<a id="trunkWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebKit.xcodeproj/project.pbxproj (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebKit.xcodeproj/project.pbxproj        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/WebKit.xcodeproj/project.pbxproj        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx">                 1C68F670095B5FC100C2984E /* WebNodeHighlight.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C68F664095B5FC100C2984E /* WebNodeHighlight.m */; };
</span><span class="cx">                 1C68F671095B5FC100C2984E /* WebNodeHighlightView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C68F665095B5FC100C2984E /* WebNodeHighlightView.h */; };
</span><span class="cx">                 1C68F672095B5FC100C2984E /* WebNodeHighlightView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C68F666095B5FC100C2984E /* WebNodeHighlightView.m */; };
</span><ins>+                1C7B0C660EB2464D00A28502 /* WebInspectorClientCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C7B0C650EB2464D00A28502 /* WebInspectorClientCF.cpp */; };
</ins><span class="cx">                 1C8CB07A0AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C8CB0790AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1CA57D620AED6A470009BDD0 /* WebGraphicsExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CA57D600AED6A470009BDD0 /* WebGraphicsExtras.h */; };
</span><span class="cx">                 1CA57D630AED6A470009BDD0 /* WebGraphicsExtras.c in Sources */ = {isa = PBXBuildFile; fileRef = 1CA57D610AED6A470009BDD0 /* WebGraphicsExtras.c */; };
</span><span class="lines">@@ -321,6 +322,7 @@
</span><span class="cx">                 1C68F665095B5FC100C2984E /* WebNodeHighlightView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNodeHighlightView.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 1C68F666095B5FC100C2984E /* WebNodeHighlightView.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebNodeHighlightView.m; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 1C6CB03E0AA6391D00D23BFD /* MigrateHeaders.make */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = MigrateHeaders.make; path = mac/MigrateHeaders.make; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1C7B0C650EB2464D00A28502 /* WebInspectorClientCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebInspectorClientCF.cpp; path = cf/WebCoreSupport/WebInspectorClientCF.cpp; sourceTree = SOURCE_ROOT; };
</ins><span class="cx">                 1C8CB0790AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebEditingDelegatePrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C904FD20BA9DD0F0081E9D0 /* WebKit.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebKit.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C904FD30BA9DD0F0081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1033,6 +1035,7 @@
</span><span class="cx">                                 51494CD50C7EBDE0004178C5 /* WebIconDatabaseClient.mm */,
</span><span class="cx">                                 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */,
</span><span class="cx">                                 06693DDA0BFBA85200216072 /* WebInspectorClient.h */,
</span><ins>+                                1C7B0C650EB2464D00A28502 /* WebInspectorClientCF.cpp */,
</ins><span class="cx">                                 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */,
</span><span class="cx">                                 9345D4EA0365C5B2008635CE /* WebJavaScriptTextInputPanel.h */,
</span><span class="cx">                                 9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */,
</span><span class="lines">@@ -1591,6 +1594,7 @@
</span><span class="cx">                                 1AEA6A510DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm in Sources */,
</span><span class="cx">                                 1A2D754E0DE480B900F0A648 /* WebIconFetcher.mm in Sources */,
</span><span class="cx">                                 F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */,
</span><ins>+                                1C7B0C660EB2464D00A28502 /* WebInspectorClientCF.cpp in Sources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkWebKitcfChangeLog"></a>
<div class="addfile"><h4>Added: trunk/WebKit/cf/ChangeLog (0 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/cf/ChangeLog                                (rev 0)
+++ trunk/WebKit/cf/ChangeLog        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Implement new InspectorClient methods to work with Settings.
+
+        https://bugs.webkit.org/show_bug.cgi?id=21856
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebInspectorClientCF.cpp: Added.
+        (createKeyForPreferences): Helper to make the preference key.
+        (WebInspectorClient::populateSetting): Read the preference value from CFPreferences.
+        (WebInspectorClient::storeSetting): Write the setting value to  CFPreferences.
+        (WebInspectorClient::removeSetting): Remove the preference from CFPreferences.
</ins></span></pre></div>
<a id="trunkWebKitcfWebCoreSupportWebInspectorClientCFcpp"></a>
<div class="addfile"><h4>Added: trunk/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp (0 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp                                (rev 0)
+++ trunk/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -0,0 +1,137 @@
</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.
+ *
+ * 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.
+ */
+
+#import &quot;WebInspectorClient.h&quot;
+
+#include &lt;CoreFoundation/CoreFoundation.h&gt;
+
+#include &lt;WebCore/PlatformString.h&gt;
+
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+using namespace WebCore;
+
+static inline CFStringRef createKeyForPreferences(const String&amp; key)
+{
+    RetainPtr&lt;CFStringRef&gt; keyCFString(AdoptCF, key.createCFString());
+    return CFStringCreateWithFormat(0, 0, CFSTR(&quot;WebKit Web Inspector Setting - %@&quot;), keyCFString.get());
+}
+
+void WebInspectorClient::populateSetting(const String&amp; key, InspectorController::Setting&amp; setting)
+{
+    RetainPtr&lt;CFStringRef&gt; preferencesKey(AdoptCF, createKeyForPreferences(key));
+    RetainPtr&lt;CFPropertyListRef&gt; value(AdoptCF, CFPreferencesCopyAppValue(preferencesKey.get(), kCFPreferencesCurrentApplication));
+
+    if (!value)
+        return;
+
+    CFTypeID type = CFGetTypeID(value.get());
+    if (type == CFStringGetTypeID())
+        setting.set(static_cast&lt;String&gt;(static_cast&lt;CFStringRef&gt;(value.get())));
+    else if (type == CFBooleanGetTypeID())
+        setting.set(static_cast&lt;bool&gt;(CFBooleanGetValue(static_cast&lt;CFBooleanRef&gt;(value.get()))));
+    else if (type == CFNumberGetTypeID()) {
+        CFNumberRef number = static_cast&lt;CFNumberRef&gt;(value.get());
+        if (CFNumberIsFloatType(number)) {
+            double doubleNumber = 0.0;
+            CFNumberGetValue(static_cast&lt;CFNumberRef&gt;(value.get()), kCFNumberDoubleType, &amp;doubleNumber);
+            setting.set(doubleNumber);
+        } else {
+            long longNumber = 0;
+            CFNumberGetValue(static_cast&lt;CFNumberRef&gt;(value.get()), kCFNumberLongType, &amp;longNumber);
+            setting.set(longNumber);
+        }
+    } else if (type == CFArrayGetTypeID()) {
+        Vector&lt;String&gt; strings;
+
+        CFArrayRef array = static_cast&lt;CFArrayRef&gt;(value.get());
+        unsigned length = CFArrayGetCount(array);
+        for (unsigned i = 0; i &lt; length; ++i) {
+            CFStringRef string = static_cast&lt;CFStringRef&gt;(CFArrayGetValueAtIndex(array, i));
+            if (CFGetTypeID(string) == CFStringGetTypeID())
+                strings.append(static_cast&lt;String&gt;(static_cast&lt;CFStringRef&gt;(string)));
+        }
+
+        setting.set(strings);
+    } else
+        ASSERT_NOT_REACHED();
+}
+
+void WebInspectorClient::storeSetting(const String&amp; key, const InspectorController::Setting&amp; setting)
+{
+    RetainPtr&lt;CFPropertyListRef&gt; objectToStore;
+
+    switch (setting.type()) {
+        default:
+        case InspectorController::Setting::NoType:
+            ASSERT_NOT_REACHED();
+            break;
+        case InspectorController::Setting::StringType:
+            objectToStore.adoptCF(setting.string().createCFString());
+            break;
+        case InspectorController::Setting::BooleanType:
+            objectToStore = (setting.booleanValue() ? kCFBooleanTrue : kCFBooleanFalse);
+            break;
+
+        case InspectorController::Setting::DoubleType: {
+            double value = setting.doubleValue();
+            objectToStore.adoptCF(CFNumberCreate(0, kCFNumberDoubleType, &amp;value));
+            break;
+        }
+
+        case InspectorController::Setting::IntegerType: {
+            long value = setting.integerValue();
+            objectToStore.adoptCF(CFNumberCreate(0, kCFNumberLongType, &amp;value));
+            break;
+        }
+
+        case InspectorController::Setting::StringVectorType: {
+            const Vector&lt;String&gt;&amp; strings = setting.stringVector();
+            const unsigned length = strings.size();
+
+            RetainPtr&lt;CFMutableArrayRef&gt; array(AdoptCF, CFArrayCreateMutable(0, length, &amp;kCFTypeArrayCallBacks));
+
+            for (unsigned i = 0; i &lt; length; ++i) {
+                RetainPtr&lt;CFStringRef&gt; string(AdoptCF, strings[i].createCFString());
+                CFArraySetValueAtIndex(array.get(), i, string.get());
+            }
+
+            objectToStore = array;
+            break;
+        }
+    }
+
+    ASSERT(objectToStore);
+
+    RetainPtr&lt;CFStringRef&gt; preferencesKey(AdoptCF, createKeyForPreferences(key));
+    CFPreferencesSetAppValue(preferencesKey.get(), objectToStore.get(), kCFPreferencesCurrentApplication);
+}
+
+void WebInspectorClient::removeSetting(const String&amp; key)
+{
+    RetainPtr&lt;CFStringRef&gt; preferencesKey(AdoptCF, createKeyForPreferences(key));
+    CFPreferencesSetAppValue(preferencesKey.get(), 0, kCFPreferencesCurrentApplication);
+}
</ins></span></pre></div>
<a id="trunkWebKitgtkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/ChangeLog (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/ChangeLog        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/gtk/ChangeLog        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Stub out new InspectorClient methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=21856
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/InspectorClientGtk.cpp:
+        (WebKit::InspectorClient::populateSetting): Not implemented.
+        (WebKit::InspectorClient::storeSetting): Ditto.
+        (WebKit::InspectorClient::removeSetting): Ditto.
+        * WebCoreSupport/InspectorClientGtk.h:
+
</ins><span class="cx"> 2008-10-22  Alp Toker  &lt;alp@nuanti.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix for older GTK+ versions where GTK_TYPE_TARGET_LIST isn't
</span></span></pre></div>
<a id="trunkWebKitgtkWebCoreSupportInspectorClientGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -81,5 +81,20 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorClient::populateSetting(const String&amp; key, InspectorController::Setting&amp; setting)
+{
+    notImplemented();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorClient::storeSetting(const String&amp; key, const InspectorController::Setting&amp; setting)
+{
+    notImplemented();
+}
+
+void InspectorClient::removeSetting(const String&amp; key)
+{
+    notImplemented();
+}
+
+}
+
</ins></span></pre></div>
<a id="trunkWebKitgtkWebCoreSupportInspectorClientGtkh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -58,6 +58,10 @@
</span><span class="cx">         virtual void highlight(WebCore::Node*);
</span><span class="cx">         virtual void hideHighlight();
</span><span class="cx">         virtual void inspectedURLChanged(const WebCore::String&amp; newURL);
</span><ins>+
+        virtual void populateSetting(const WebCore::String&amp; key, WebCore::InspectorController::Setting&amp;);
+        virtual void storeSetting(const WebCore::String&amp; key, const WebCore::InspectorController::Setting&amp;);
+        virtual void removeSetting(const WebCore::String&amp; key);
</ins><span class="cx">     };
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/mac/ChangeLog        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Implement new InspectorClient methods to work with Settings.
+
+        https://bugs.webkit.org/show_bug.cgi?id=21856
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebInspectorClient.h: Add the new methods and
+        guard the ObjC parts of the header.
+
</ins><span class="cx"> 2008-10-24  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebInspectorClienth"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.h (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.h        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.h        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -31,8 +31,13 @@
</span><span class="cx"> 
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><ins>+#ifdef __OBJC__
</ins><span class="cx"> @class WebInspectorWindowController;
</span><span class="cx"> @class WebView;
</span><ins>+#else
+class WebInspectorWindowController;
+class WebView;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> class WebInspectorClient : public WebCore::InspectorClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -55,6 +60,10 @@
</span><span class="cx">     virtual void hideHighlight();
</span><span class="cx">     virtual void inspectedURLChanged(const WebCore::String&amp; newURL);
</span><span class="cx"> 
</span><ins>+    virtual void populateSetting(const WebCore::String&amp; key, WebCore::InspectorController::Setting&amp;);
+    virtual void storeSetting(const WebCore::String&amp; key, const WebCore::InspectorController::Setting&amp;);
+    virtual void removeSetting(const WebCore::String&amp; key);
+
</ins><span class="cx"> private:
</span><span class="cx">     void updateWindowTitle() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitqtChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/ChangeLog (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/ChangeLog        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/qt/ChangeLog        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Stub out new InspectorClient methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=21856
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/InspectorClientQt.cpp:
+        (WebCore::InspectorClientQt::populateSetting): Not implemented.
+        (WebCore::InspectorClientQt::storeSetting): Ditto.
+        (WebCore::InspectorClientQt::removeSetting): Ditto.
+        * WebCoreSupport/InspectorClientQt.h:
+
</ins><span class="cx"> 2008-10-24  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
</span></span></pre></div>
<a id="trunkWebKitqtWebCoreSupportInspectorClientQtcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -186,6 +186,21 @@
</span><span class="cx">     m_webPage-&gt;view()-&gt;setWindowTitle(caption.arg(m_inspectedURL));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorClientQt::populateSetting(const String&amp; key, InspectorController::Setting&amp; setting)
+{
+    notImplemented();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorClientQt::storeSetting(const String&amp; key, const InspectorController::Setting&amp; setting)
+{
+    notImplemented();
+}
+
+void InspectorClientQt::removeSetting(const String&amp; key)
+{
+    notImplemented();
+}
+
+}
+
</ins><span class="cx"> #include &quot;InspectorClientQt.moc&quot;
</span></span></pre></div>
<a id="trunkWebKitqtWebCoreSupportInspectorClientQth"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.h (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.h        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.h        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -65,6 +65,10 @@
</span><span class="cx">         virtual void hideHighlight();
</span><span class="cx">         virtual void inspectedURLChanged(const String&amp; newURL);
</span><span class="cx"> 
</span><ins>+        virtual void populateSetting(const String&amp; key, InspectorController::Setting&amp;);
+        virtual void storeSetting(const String&amp; key, const InspectorController::Setting&amp;);
+        virtual void removeSetting(const String&amp; key);
+
</ins><span class="cx">     private:
</span><span class="cx">         void updateWindowTitle();
</span><span class="cx">         QWebPage* m_inspectedWebPage;
</span></span></pre></div>
<a id="trunkWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/ChangeLog (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/ChangeLog        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/win/ChangeLog        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Implement new InspectorClient methods to work with Settings.
+
+        https://bugs.webkit.org/show_bug.cgi?id=21856
+
+        Reviewed by Adam Roben.
+
+        * WebKit.vcproj/WebKit.vcproj: Add the new InspectorClientCF.cpp file.
+        * WebCoreSupport/WebInspectorClient.h: Add the new methods.
+
</ins><span class="cx"> 2008-10-24  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
</span></span></pre></div>
<a id="trunkWebKitwinWebCoreSupportWebInspectorClienth"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebCoreSupport/WebInspectorClient.h (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebCoreSupport/WebInspectorClient.h        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/win/WebCoreSupport/WebInspectorClient.h        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -64,6 +64,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void inspectedURLChanged(const WebCore::String&amp; newURL);
</span><span class="cx"> 
</span><ins>+    virtual void populateSetting(const WebCore::String&amp; key, WebCore::InspectorController::Setting&amp;);
+    virtual void storeSetting(const WebCore::String&amp; key, const WebCore::InspectorController::Setting&amp;);
+    virtual void removeSetting(const WebCore::String&amp; key);
+
</ins><span class="cx"> private:
</span><span class="cx">     ~WebInspectorClient();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitwinWebKitvcprojWebKitvcproj"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebKit.vcproj/WebKit.vcproj (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebKit.vcproj/WebKit.vcproj        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/win/WebKit.vcproj/WebKit.vcproj        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -2063,6 +2063,10 @@
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span><span class="cx">                         &lt;File
</span><ins>+                                RelativePath=&quot;..\..\cf\WebCoreSupport\WebInspectorClientCF.cpp&quot;
+                                &gt;
+                        &lt;/File&gt;
+                        &lt;File
</ins><span class="cx">                                 RelativePath=&quot;..\WebCoreSupport\WebInspectorDelegate.cpp&quot;
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span></span></pre></div>
<a id="trunkWebKitwxChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/wx/ChangeLog (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/wx/ChangeLog        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/wx/ChangeLog        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2008-10-24  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Stub out new InspectorClient methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=21856
+
+        Reviewed by Darin Adler.
+
+        * WebKitSupport/InspectorClientWx.cpp:
+        (WebCore::InspectorClient::populateSetting): Not implemented.
+        (WebCore::InspectorClient::storeSetting): Ditto.
+        (WebCore::InspectorClient::removeSetting): Ditto.
+        * WebKitSupport/InspectorClientWx.h:
+
</ins><span class="cx"> 2008-10-24  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
</span></span></pre></div>
<a id="trunkWebKitwxWebKitSupportInspectorClientWxcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/wx/WebKitSupport/InspectorClientWx.cpp (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/wx/WebKitSupport/InspectorClientWx.cpp        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/wx/WebKitSupport/InspectorClientWx.cpp        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -99,4 +99,19 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorClient::populateSetting(const String&amp; key, InspectorController::Setting&amp; setting)
+{
+    notImplemented();
+}
+
+void InspectorClient::storeSetting(const String&amp; key, const InspectorController::Setting&amp; setting)
+{
+    notImplemented();
+}
+
+void InspectorClient::removeSetting(const String&amp; key)
+{
+    notImplemented();
+}
+
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkWebKitwxWebKitSupportInspectorClientWxh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/wx/WebKitSupport/InspectorClientWx.h (37847 => 37848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/wx/WebKitSupport/InspectorClientWx.h        2008-10-24 18:19:50 UTC (rev 37847)
+++ trunk/WebKit/wx/WebKitSupport/InspectorClientWx.h        2008-10-24 18:49:39 UTC (rev 37848)
</span><span class="lines">@@ -57,6 +57,10 @@
</span><span class="cx">     virtual void hideHighlight();
</span><span class="cx"> 
</span><span class="cx">     virtual void inspectedURLChanged(const String&amp; newURL);
</span><ins>+
+    virtual void populateSetting(const String&amp; key, InspectorController::Setting&amp;);
+    virtual void storeSetting(const String&amp; key, const InspectorController::Setting&amp;);
+    virtual void removeSetting(const String&amp; key);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>