summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/cf
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/cf')
-rw-r--r--Source/WebKit/cf/ChangeLog127
-rw-r--r--Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp109
2 files changed, 236 insertions, 0 deletions
diff --git a/Source/WebKit/cf/ChangeLog b/Source/WebKit/cf/ChangeLog
new file mode 100644
index 0000000..f712c97
--- /dev/null
+++ b/Source/WebKit/cf/ChangeLog
@@ -0,0 +1,127 @@
+2011-01-03 Pratik Solanki <psolanki@apple.com>
+
+ Mac build fix. Define WTF_USE_CFNETWORK for Windows build only.
+
+ * WebCoreSupport/WebInspectorClientCF.cpp:
+
+2011-01-03 Brian Weinstein <bweinstein@apple.com>
+
+ Windows build fix. Define WTF_USE_CFNETWORK in WebInspectorClientCF.
+
+ * WebCoreSupport/WebInspectorClientCF.cpp:
+
+2010-10-18 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ Web Inspector: [crash] when Inspector Open in CSSStyleSelector::loadPendingImages().
+ https://bugs.webkit.org/show_bug.cgi?id=46224
+
+ * WebCoreSupport/WebInspectorClientCF.cpp:
+ (WebInspectorClient::sendMessageToFrontend):
+
+2010-06-14 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc
+ data from inspected page to WebInspector as JSON string via http. The native
+ serialization to JSON string is supported by InspectorValue's classes. This patch
+ has the implementation of sendMessageToFrontend function. WebKit version of it still
+ uses ScriptFunctionCall and will be switched to another transport a little bit later.
+ https://bugs.webkit.org/show_bug.cgi?id=40134
+
+ * WebCoreSupport/WebInspectorClientCF.cpp:
+ (WebInspectorClient::releaseFrontendPage):
+ (WebInspectorClient::sendMessageToFrontend):
+
+2010-06-09 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r60889.
+ http://trac.webkit.org/changeset/60889
+ https://bugs.webkit.org/show_bug.cgi?id=40365
+
+ gtk bot has some kind of memory corruption (Requested by
+ loislo on #webkit).
+
+ * WebCoreSupport/WebInspectorClientCF.cpp:
+ (WebInspectorClient::storeSetting):
+
+2010-06-07 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc
+ data from inspected page to WebInspector as JSON string via http. The native
+ serialization to JSON string is supported by InspectorValue's classes. This patch
+ has the implementation of sendMessageToFrontend function. WebKit version of it still
+ uses ScriptFunctionCall and will be switched to another transport a little bit later.
+ https://bugs.webkit.org/show_bug.cgi?id=40134
+
+ * WebCoreSupport/WebInspectorClientCF.cpp:
+ (WebInspectorClient::releaseFrontendPage):
+ (WebInspectorClient::sendMessageToFrontend):
+
+2010-01-07 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33057
+ REGRESSION(r49365): typeof(xhr.responseText) != "string" in Windows
+
+ <rdar://problem/7296920> REGRESSION: WebKit fails to start PeaceKeeper benchmark
+
+ * WebCoreSupport/WebInspectorClientCF.cpp: Define JS_EXPORTCLASS. I'm not sure why this
+ isn't done in JSC globally for all possible clients, but keeping the current design for now.
+
+2009-12-03 Pavel Feldman <pfeldman@dhcp-172-28-174-220.spb.corp.google.com>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: Simplify the settings support in inspector controller.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32076
+
+ * WebCoreSupport/WebInspectorClientCF.cpp:
+ (WebInspectorClient::populateSetting):
+ (WebInspectorClient::storeSetting):
+
+2009-04-20 Steve Falkenburg <sfalken@apple.com>
+
+ Separate JavaScriptCore.dll from WebKit.dll.
+ Slight performance improvement or no change on benchmarks.
+
+ Allows us to break a circular dependency between CFNetwork and WebKit on Windows,
+ and simplifies standalone JavaScriptCore builds.
+
+ Reviewed by Oliver Hunt.
+
+ * WebCoreSupport/WebInspectorClientCF.cpp: Workaround for lack of config.h in shared WebKit file (WebKit/win uses config.h from WebCore).
+
+2008-12-09 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Fix bustage.
+
+ * WebCoreSupport/WebInspectorClientCF.cpp:
+
+2008-10-24 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ * WebCoreSupport/WebInspectorClientCF.cpp: Define WTF_PLATFORM_CF
+ manually. Normally this gets defined on Windows by including config.h,
+ but Mac has no config.h for WebKit, so we can't do that here.
+
+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/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.
diff --git a/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp b/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp
new file mode 100644
index 0000000..9183fa4
--- /dev/null
+++ b/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+
+// FIXME: On Windows, we require all WebKit source files to include config.h
+// before including any other files. Failing to include config.h will leave
+// WTF_PLATFORM_CF and WTF_USE_JSC undefined, causing build failures in this
+// file. But Mac doesn't have a config.h for WebKit, so we can't include the
+// Windows one here. For now we can just define WTF_PLATFORM_CF, WTF_USE_JSC, and
+// WTF_USE_CFNETWORK manually, but we need a better long-term solution.
+#ifndef WTF_PLATFORM_CF
+#define WTF_PLATFORM_CF 1
+#endif
+
+#ifndef WTF_USE_JSC
+#define WTF_USE_JSC 1
+#endif
+
+#if defined(WIN32) || defined(_WIN32)
+#ifndef WTF_USE_CFNETWORK
+#define WTF_USE_CFNETWORK 1
+#endif
+#if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
+#define JS_EXPORTDATA __declspec(dllexport)
+#else
+#define JS_EXPORTDATA __declspec(dllimport)
+#endif
+#define JS_EXPORTCLASS JS_EXPORTDATA
+#else
+#define JS_EXPORTDATA
+#define JS_EXPORTCLASS
+#endif
+
+#include "WebInspectorClient.h"
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#include <WebCore/Frame.h>
+#include <WebCore/Page.h>
+#include <WebCore/PlatformString.h>
+
+#include <wtf/RetainPtr.h>
+#include <wtf/Vector.h>
+
+using namespace WebCore;
+
+static inline CFStringRef createKeyForPreferences(const String& key)
+{
+ RetainPtr<CFStringRef> keyCFString(AdoptCF, key.createCFString());
+ return CFStringCreateWithFormat(0, 0, CFSTR("WebKit Web Inspector Setting - %@"), keyCFString.get());
+}
+
+void WebInspectorClient::populateSetting(const String& key, String* setting)
+{
+ RetainPtr<CFStringRef> preferencesKey(AdoptCF, createKeyForPreferences(key));
+ RetainPtr<CFPropertyListRef> value(AdoptCF, CFPreferencesCopyAppValue(preferencesKey.get(), kCFPreferencesCurrentApplication));
+
+ if (!value)
+ return;
+
+ CFTypeID type = CFGetTypeID(value.get());
+ if (type == CFStringGetTypeID())
+ *setting = static_cast<String>(static_cast<CFStringRef>(value.get()));
+ else if (type == CFBooleanGetTypeID())
+ *setting = static_cast<bool>(CFBooleanGetValue(static_cast<CFBooleanRef>(value.get()))) ? "true" : "false";
+ else
+ *setting = "";
+}
+
+void WebInspectorClient::storeSetting(const String& key, const String& setting)
+{
+ RetainPtr<CFPropertyListRef> objectToStore;
+ objectToStore.adoptCF(setting.createCFString());
+ ASSERT(objectToStore);
+
+ RetainPtr<CFStringRef> preferencesKey(AdoptCF, createKeyForPreferences(key));
+ CFPreferencesSetAppValue(preferencesKey.get(), objectToStore.get(), kCFPreferencesCurrentApplication);
+}
+
+void WebInspectorClient::releaseFrontendPage()
+{
+ m_frontendPage = 0;
+}
+
+bool WebInspectorClient::sendMessageToFrontend(const String& message)
+{
+ return doDispatchMessageOnFrontendPage(m_frontendPage, message);
+}