diff options
| author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-17 16:21:14 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-17 16:21:14 +0200 |
| commit | 8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch) | |
| tree | 17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebKit2/UIProcess/API/C | |
| parent | b9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff) | |
| download | qtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz | |
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well
as the previously cherry-picked changes
Diffstat (limited to 'Source/WebKit2/UIProcess/API/C')
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKContext.cpp | 18 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKContextPrivate.h | 8 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp | 9 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h | 1 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKIconDatabase.h | 8 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKPage.cpp | 14 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKPage.h | 2 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp | 20 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKPageGroup.h | 6 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKPagePrivate.h | 2 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKPreferences.cpp | 32 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKPreferences.h | 6 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h | 8 | ||||
| -rw-r--r-- | Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h | 2 |
14 files changed, 128 insertions, 8 deletions
diff --git a/Source/WebKit2/UIProcess/API/C/WKContext.cpp b/Source/WebKit2/UIProcess/API/C/WKContext.cpp index 28a70821b..26e4ab6a4 100644 --- a/Source/WebKit2/UIProcess/API/C/WKContext.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKContext.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -266,6 +266,16 @@ void WKContextSetLocalStorageDirectory(WKContextRef contextRef, WKStringRef loca toImpl(contextRef)->setLocalStorageDirectory(toImpl(localStorageDirectory)->string()); } +WK_EXPORT void WKContextSetDiskCacheDirectory(WKContextRef contextRef, WKStringRef diskCacheDirectory) +{ + toImpl(contextRef)->setDiskCacheDirectory(toImpl(diskCacheDirectory)->string()); +} + +WK_EXPORT void WKContextSetCookieStorageDirectory(WKContextRef contextRef, WKStringRef cookieStorageDirectory) +{ + toImpl(contextRef)->setCookieStorageDirectory(toImpl(cookieStorageDirectory)->string()); +} + void WKContextDisableProcessTermination(WKContextRef contextRef) { toImpl(contextRef)->disableProcessTermination(); @@ -300,6 +310,12 @@ void WKContextSetJavaScriptGarbageCollectorTimerEnabled(WKContextRef contextRef, { toImpl(contextRef)->setJavaScriptGarbageCollectorTimerEnabled(enable); } + +void WKContextSetUsesNetworkProcess(WKContextRef contextRef, bool usesNetworkProcess) +{ + toImpl(contextRef)->setUsesNetworkProcess(usesNetworkProcess); +} + // Deprecated functions. void _WKContextSetAdditionalPluginsDirectory(WKContextRef context, WKStringRef pluginsDirectory) { diff --git a/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h b/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h index 49aec7f53..79c2ef50f 100644 --- a/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h +++ b/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,6 +60,8 @@ WK_EXPORT void WKContextSetIconDatabasePath(WKContextRef context, WKStringRef ic // we should really change these settings to be on WebPreferences and changeable at runtime. WK_EXPORT void WKContextSetDatabaseDirectory(WKContextRef context, WKStringRef databaseDirectory); WK_EXPORT void WKContextSetLocalStorageDirectory(WKContextRef context, WKStringRef localStorageDirectory); +WK_EXPORT void WKContextSetDiskCacheDirectory(WKContextRef context, WKStringRef diskCacheDirectory); +WK_EXPORT void WKContextSetCookieStorageDirectory(WKContextRef context, WKStringRef cookieStorageDirectory); // FIXME: This is a workaround for testing purposes only and should be removed once a better // solution has been found for testing. @@ -70,6 +72,10 @@ WK_EXPORT void WKContextSetHTTPPipeliningEnabled(WKContextRef context, bool enab WK_EXPORT void WKContextWarmInitialProcess(WKContextRef context); +// FIXME: This function is temporary and useful during the development of the NetworkProcess feature. +// At some point it should be removed. +WK_EXPORT void WKContextSetUsesNetworkProcess(WKContextRef context, bool usesNetworkProcess); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp b/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp index 99195c79c..5d94f3e86 100644 --- a/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,6 +38,11 @@ WKTypeID WKGeolocationPositionGetTypeID() WKGeolocationPositionRef WKGeolocationPositionCreate(double timestamp, double latitude, double longitude, double accuracy) { - RefPtr<WebGeolocationPosition> position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy); + return WKGeolocationPositionCreate_b(timestamp, latitude, longitude, accuracy, false, 0., false, 0., false, 0., false, 0.); +} + +WKGeolocationPositionRef WKGeolocationPositionCreate_b(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) +{ + RefPtr<WebGeolocationPosition> position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed); return toAPI(position.release().leakRef()); } diff --git a/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h b/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h index 85183fd60..4727e9763 100644 --- a/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h +++ b/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h @@ -35,6 +35,7 @@ extern "C" { WK_EXPORT WKTypeID WKGeolocationPositionGetTypeID(); WK_EXPORT WKGeolocationPositionRef WKGeolocationPositionCreate(double timestamp, double latitude, double longitude, double accuracy); +WK_EXPORT WKGeolocationPositionRef WKGeolocationPositionCreate_b(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed); #ifdef __cplusplus } diff --git a/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h index 45ceec765..eec4ab3af 100644 --- a/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h +++ b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h @@ -35,16 +35,22 @@ extern "C" { // IconDatabase Client. typedef void (*WKIconDatabaseDidChangeIconForPageURLCallback)(WKIconDatabaseRef iconDatabase, WKURLRef pageURL, const void* clientInfo); typedef void (*WKIconDatabaseDidRemoveAllIconsCallback)(WKIconDatabaseRef iconDatabase, const void* clientInfo); +typedef void (*WKIconDatabaseIconDataReadyForPageURLCallback)(WKIconDatabaseRef iconDatabase, WKURLRef pageURL, const void* clientInfo); struct WKIconDatabaseClient { int version; const void * clientInfo; + + // Version 0 WKIconDatabaseDidChangeIconForPageURLCallback didChangeIconForPageURL; WKIconDatabaseDidRemoveAllIconsCallback didRemoveAllIcons; + + // Version 1 + WKIconDatabaseIconDataReadyForPageURLCallback iconDataReadyForPageURL; }; typedef struct WKIconDatabaseClient WKIconDatabaseClient; -enum { kWKIconDatabaseClientCurrentVersion = 0 }; +enum { kWKIconDatabaseClientCurrentVersion = 1 }; WK_EXPORT WKTypeID WKIconDatabaseGetTypeID(); diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.cpp b/Source/WebKit2/UIProcess/API/C/WKPage.cpp index 94fda474a..52e1cebf8 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPage.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKPage.cpp @@ -365,6 +365,16 @@ bool WKPageIsPinnedToRightSide(WKPageRef pageRef) return toImpl(pageRef)->isPinnedToRightSide(); } +bool WKPageIsPinnedToTopSide(WKPageRef pageRef) +{ + return toImpl(pageRef)->isPinnedToTopSide(); +} + +bool WKPageIsPinnedToBottomSide(WKPageRef pageRef) +{ + return toImpl(pageRef)->isPinnedToBottomSide(); +} + void WKPageSetPaginationMode(WKPageRef pageRef, WKPaginationMode paginationMode) { Pagination::Mode mode; @@ -738,3 +748,7 @@ void WKPagePostMessageToInjectedBundle(WKPageRef pageRef, WKStringRef messageNam toImpl(pageRef)->postMessageToInjectedBundle(toImpl(messageNameRef)->string(), toImpl(messageBodyRef)); } +WKArrayRef WKPageCopyRelatedPages(WKPageRef pageRef) +{ + return toAPI(toImpl(pageRef)->relatedPages().leakRef()); +} diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.h b/Source/WebKit2/UIProcess/API/C/WKPage.h index 62db9174c..9dfd52e3c 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPage.h +++ b/Source/WebKit2/UIProcess/API/C/WKPage.h @@ -439,6 +439,8 @@ WK_EXPORT bool WKPageAreScrollbarAnimationsSuppressed(WKPageRef page); WK_EXPORT bool WKPageIsPinnedToLeftSide(WKPageRef page); WK_EXPORT bool WKPageIsPinnedToRightSide(WKPageRef page); +WK_EXPORT bool WKPageIsPinnedToTopSide(WKPageRef page); +WK_EXPORT bool WKPageIsPinnedToBottomSide(WKPageRef page); WK_EXPORT bool WKPageCanDelete(WKPageRef page); WK_EXPORT bool WKPageHasSelectedRange(WKPageRef page); diff --git a/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp b/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp index 8a4d86a05..51298cd14 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp @@ -57,3 +57,23 @@ WKPreferencesRef WKPageGroupGetPreferences(WKPageGroupRef pageGroupRef) { return toAPI(toImpl(pageGroupRef)->preferences()); } + +void WKPageGroupAddUserStyleSheet(WKPageGroupRef pageGroupRef, WKStringRef sourceRef, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames injectedFrames) +{ + toImpl(pageGroupRef)->addUserStyleSheet(toWTFString(sourceRef), toWTFString(baseURL), toImpl(whitelistedURLPatterns), toImpl(blacklistedURLPatterns), toUserContentInjectedFrames(injectedFrames), WebCore::UserStyleUserLevel); +} + +void WKPageGroupRemoveAllUserStyleSheets(WKPageGroupRef pageGroupRef) +{ + toImpl(pageGroupRef)->removeAllUserStyleSheets(); +} + +void WKPageGroupAddUserScript(WKPageGroupRef pageGroupRef, WKStringRef sourceRef, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames injectedFrames, WKUserScriptInjectionTime injectionTime) +{ + toImpl(pageGroupRef)->addUserScript(toWTFString(sourceRef), toWTFString(baseURL), toImpl(whitelistedURLPatterns), toImpl(blacklistedURLPatterns), toUserContentInjectedFrames(injectedFrames), toUserScriptInjectionTime(injectionTime)); +} + +void WKPageGroupRemoveAllUserScripts(WKPageGroupRef pageGroupRef) +{ + toImpl(pageGroupRef)->removeAllUserScripts(); +} diff --git a/Source/WebKit2/UIProcess/API/C/WKPageGroup.h b/Source/WebKit2/UIProcess/API/C/WKPageGroup.h index 705df083e..01edb51c6 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPageGroup.h +++ b/Source/WebKit2/UIProcess/API/C/WKPageGroup.h @@ -40,6 +40,12 @@ WK_EXPORT WKStringRef WKPageGroupCopyIdentifier(WKPageGroupRef pageGroup); WK_EXPORT void WKPageGroupSetPreferences(WKPageGroupRef pageGroup, WKPreferencesRef preferences); WK_EXPORT WKPreferencesRef WKPageGroupGetPreferences(WKPageGroupRef pageGroup); + +WK_EXPORT void WKPageGroupAddUserStyleSheet(WKPageGroupRef pageGroup, WKStringRef source, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames); +WK_EXPORT void WKPageGroupRemoveAllUserStyleSheets(WKPageGroupRef pageGroup); + +WK_EXPORT void WKPageGroupAddUserScript(WKPageGroupRef pageGroup, WKStringRef source, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames, WKUserScriptInjectionTime); +WK_EXPORT void WKPageGroupRemoveAllUserScripts(WKPageGroupRef pageGroup); #ifdef __cplusplus } diff --git a/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h b/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h index 4a13ae7a2..3a9de69af 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h +++ b/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h @@ -94,6 +94,8 @@ WK_EXPORT void WKPageSetShouldSendEventsSynchronously(WKPageRef page, bool sync) WK_EXPORT void WKPageSetMediaVolume(WKPageRef page, float volume); +WK_EXPORT WKArrayRef WKPageCopyRelatedPages(WKPageRef page); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp index 657b1b730..532d82caf 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -298,6 +298,16 @@ bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferencesR return toImpl(preferencesRef)->screenFontSubstitutionEnabled(); } +void WKPreferencesSetCookieEnabled(WKPreferencesRef preferencesRef, bool enabled) +{ + toImpl(preferencesRef)->setCookieEnabled(enabled); +} + +bool WKPreferencesGetCookieEnabled(WKPreferencesRef preferencesRef) +{ + return toImpl(preferencesRef)->cookieEnabled(); +} + void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior wkBehavior) { toImpl(preferencesRef)->setEditableLinkBehavior(toEditableLinkBehavior(wkBehavior)); @@ -913,3 +923,23 @@ bool WKPreferencesGetScrollingPerformanceLoggingEnabled(WKPreferencesRef prefere { return toImpl(preferencesRef)->scrollingPerformanceLoggingEnabled(); } + +void WKPreferencesSetPlugInSnapshottingEnabled(WKPreferencesRef preferencesRef, bool enabled) +{ + toImpl(preferencesRef)->setPlugInSnapshottingEnabled(enabled); +} + +bool WKPreferencesGetPlugInSnapshottingEnabled(WKPreferencesRef preferencesRef) +{ + return toImpl(preferencesRef)->plugInSnapshottingEnabled(); +} + +void WKPreferencesSetPDFPluginEnabled(WKPreferencesRef preferencesRef, bool enabled) +{ + toImpl(preferencesRef)->setPDFPluginEnabled(enabled); +} + +bool WKPreferencesGetPDFPluginEnabled(WKPreferencesRef preferencesRef) +{ + return toImpl(preferencesRef)->pdfPluginEnabled(); +} diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferences.h b/Source/WebKit2/UIProcess/API/C/WKPreferences.h index c0fde67fd..d91b82d83 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPreferences.h +++ b/Source/WebKit2/UIProcess/API/C/WKPreferences.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -216,6 +216,10 @@ WK_EXPORT bool WKPreferencesGetShouldRespectImageOrientation(WKPreferencesRef pr WK_EXPORT void WKPreferencesSetStorageBlockingPolicy(WKPreferencesRef preferencesRef, WKStorageBlockingPolicy policy); WK_EXPORT WKStorageBlockingPolicy WKPreferencesGetStorageBlockingPolicy(WKPreferencesRef preferencesRef); +// Defaults to false +WK_EXPORT void WKPreferencesSetPlugInSnapshottingEnabled(WKPreferencesRef preferencesRef, bool enabled); +WK_EXPORT bool WKPreferencesGetPlugInSnapshottingEnabled(WKPreferencesRef preferencesRef); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h index 11311704d..af5f73b34 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h +++ b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h @@ -219,6 +219,14 @@ WK_EXPORT bool WKPreferencesGetScrollingPerformanceLoggingEnabled(WKPreferencesR WK_EXPORT void WKPreferencesSetScreenFontSubstitutionEnabled(WKPreferencesRef preferences, bool enabled); WK_EXPORT bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferences); +// Defaults to true +WK_EXPORT void WKPreferencesSetCookieEnabled(WKPreferencesRef preferences, bool enabled); +WK_EXPORT bool WKPreferencesGetCookieEnabled(WKPreferencesRef preferences); + +// Defaults to false +WK_EXPORT void WKPreferencesSetPDFPluginEnabled(WKPreferencesRef preferences, bool enabled); +WK_EXPORT bool WKPreferencesGetPDFPluginEnabled(WKPreferencesRef preferences); + WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef); #ifdef __cplusplus diff --git a/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h b/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h index 1c9c001f2..4dba13908 100644 --- a/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h +++ b/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h @@ -33,7 +33,7 @@ extern "C" { #endif -typedef void (*WKSoupRequestManagerDidReceiveURIRequestCallback)(WKSoupRequestManagerRef soupRequestManagerRef, WKURLRef urlRef, uint64_t requestID, const void* clientInfo); +typedef void (*WKSoupRequestManagerDidReceiveURIRequestCallback)(WKSoupRequestManagerRef soupRequestManagerRef, WKURLRef urlRef, WKPageRef pageRef, uint64_t requestID, const void* clientInfo); typedef void (*WKSoupRequestManagerDidFailToLoadURIRequestCallback)(WKSoupRequestManagerRef soupRequestManagerRef, uint64_t requestID, const void* clientInfo); struct WKSoupRequestManagerClient { |
