Add a mechanism to store and retrieve preferences for the Web Inspector.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Oct 2008 18:49:39 +0000 (18:49 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Oct 2008 18:49:39 +0000 (18:49 +0000)
commit8afb42aa7c734f7a43f8a14c08d906c232b34b95
tree1bbfa8dbc6ce77a473671a6c9857a7b839003a1c
parentc105c20d2338bfd7e662e8aec1520e2f0b5d8b84
Add a mechanism to store and retrieve preferences for the Web Inspector.

WebCore:

2008-10-24  Timothy Hatcher  <timothy@apple.com>

        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  <timothy@apple.com>

        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  <timothy@apple.com>

        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  <timothy@apple.com>

        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  <timothy@apple.com>

        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  <timothy@apple.com>

        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  <timothy@apple.com>

        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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@37848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/inspector/InspectorClient.h
WebCore/inspector/InspectorController.cpp
WebCore/inspector/InspectorController.h
WebCore/loader/EmptyClients.h
WebKit/ChangeLog
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/cf/ChangeLog [new file with mode: 0644]
WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp [new file with mode: 0644]
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebInspectorClient.h
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
WebKit/qt/WebCoreSupport/InspectorClientQt.h
WebKit/win/ChangeLog
WebKit/win/WebCoreSupport/WebInspectorClient.h
WebKit/win/WebKit.vcproj/WebKit.vcproj
WebKit/wx/ChangeLog
WebKit/wx/WebKitSupport/InspectorClientWx.cpp
WebKit/wx/WebKitSupport/InspectorClientWx.h