summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/C
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/API/C')
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContext.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKIntentData.cpp23
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKIntentData.h3
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferences.cpp10
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h4
5 files changed, 41 insertions, 1 deletions
diff --git a/Source/WebKit2/UIProcess/API/C/WKContext.cpp b/Source/WebKit2/UIProcess/API/C/WKContext.cpp
index 7fadf3087..e90d1129a 100644
--- a/Source/WebKit2/UIProcess/API/C/WKContext.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKContext.cpp
@@ -112,7 +112,7 @@ void WKContextGetGlobalStatistics(WKContextStatistics* statistics)
statistics->wkViewCount = webContextStatistics.wkViewCount;
statistics->wkPageCount = webContextStatistics.wkPageCount;
- statistics->wkFrameCount = webContextStatistics.wkViewCount;
+ statistics->wkFrameCount = webContextStatistics.wkFrameCount;
}
void WKContextAddVisitedLink(WKContextRef contextRef, WKStringRef visitedURL)
diff --git a/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp b/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp
index a42f530ac..7a92db54c 100644
--- a/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp
@@ -29,6 +29,8 @@
#include "ImmutableArray.h"
#include "ImmutableDictionary.h"
#include "WKAPICast.h"
+#include "WKDictionary.h"
+#include "WKString.h"
#if ENABLE(WEB_INTENTS)
#include "WebIntentData.h"
@@ -45,6 +47,27 @@ WKTypeID WKIntentDataGetTypeID()
#endif
}
+WKIntentDataRef WKIntentDataCreate(WKDictionaryRef initDictionaryRef)
+{
+#if ENABLE(WEB_INTENTS)
+ IntentData intentData;
+ WKStringRef action = static_cast<WKStringRef>(WKDictionaryGetItemForKey(initDictionaryRef, WKStringCreateWithUTF8CString("action")));
+ ASSERT(action);
+ intentData.action = toImpl(action)->string();
+ WKStringRef type = static_cast<WKStringRef>(WKDictionaryGetItemForKey(initDictionaryRef, WKStringCreateWithUTF8CString("type")));
+ ASSERT(type);
+ intentData.type = toImpl(type)->string();
+ WKSerializedScriptValueRef data = static_cast<WKSerializedScriptValueRef>(WKDictionaryGetItemForKey(initDictionaryRef, WKStringCreateWithUTF8CString("data")));
+ if (data)
+ intentData.data = toImpl(data)->dataReference().vector();
+
+ RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData);
+ return toAPI(webIntentData.release().leakRef());
+#else
+ return 0;
+#endif
+}
+
WKStringRef WKIntentDataCopyAction(WKIntentDataRef intentRef)
{
#if ENABLE(WEB_INTENTS)
diff --git a/Source/WebKit2/UIProcess/API/C/WKIntentData.h b/Source/WebKit2/UIProcess/API/C/WKIntentData.h
index 030555b4b..1f809ec8d 100644
--- a/Source/WebKit2/UIProcess/API/C/WKIntentData.h
+++ b/Source/WebKit2/UIProcess/API/C/WKIntentData.h
@@ -33,6 +33,9 @@ extern "C" {
#endif
WK_EXPORT WKTypeID WKIntentDataGetTypeID();
+
+WK_EXPORT WKIntentDataRef WKIntentDataCreate(WKDictionaryRef initDictionary);
+
WK_EXPORT WKStringRef WKIntentDataCopyAction(WKIntentDataRef intentRef);
WK_EXPORT WKStringRef WKIntentDataCopyType(WKIntentDataRef intentRef);
WK_EXPORT WKURLRef WKIntentDataCopyService(WKIntentDataRef intentRef);
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
index 727781f01..243a17369 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
@@ -823,3 +823,13 @@ void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef)
// are usually always the same (in the UI process), they are not sent to web process, not triggering the reset.
toImpl(preferencesRef)->forceUpdate();
}
+
+void WKPreferencesSetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setDiagnosticLoggingEnabled(enabled);
+}
+
+bool WKPreferencesGetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->diagnosticLoggingEnabled();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
index 6dbc47310..371c539a1 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
@@ -187,6 +187,10 @@ WK_EXPORT bool WKPreferencesGetJavaEnabledForLocalFiles(WKPreferencesRef prefere
WK_EXPORT void WKPreferencesSetRequestAnimationFrameEnabled(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetRequestAnimationFrameEnabled(WKPreferencesRef);
+// Defaults to false
+WK_EXPORT void WKPreferencesSetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef);
+
WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
#ifdef __cplusplus