Commit e53d388d authored by andersca@apple.com's avatar andersca@apple.com

Deprecate WKNotificationProvider

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

Reviewed by Sam Weinig.

Source/WebKit2:

* Shared/API/c/WKDeclarationSpecifiers.h:
Add WK_DEPRECATED and WK_ENUM_DEPRECATED macros so we can things as deprecated.

* UIProcess/API/C/WKNotificationManager.cpp:
(WKNotificationManagerSetProvider):
* UIProcess/API/C/WKNotificationManager.h:
WKNotificationManagerSetProvider now takes a WKNotificationProviderBase.

* UIProcess/API/C/WKNotificationProvider.h:
Deprecate WKNotificationProvider and kWKNotificationProviderCurrentVersion.

Tools:

Update for WebKit2 changes.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
* WebKitTestRunner/WebNotificationProvider.cpp:
(WTR::WebNotificationProvider::provider):
* WebKitTestRunner/WebNotificationProvider.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 602c1cb1
2013-12-03 Anders Carlsson <andersca@apple.com>
Deprecate WKNotificationProvider
https://bugs.webkit.org/show_bug.cgi?id=125178
Reviewed by Sam Weinig.
* Shared/API/c/WKDeclarationSpecifiers.h:
Add WK_DEPRECATED and WK_ENUM_DEPRECATED macros so we can things as deprecated.
* UIProcess/API/C/WKNotificationManager.cpp:
(WKNotificationManagerSetProvider):
* UIProcess/API/C/WKNotificationManager.h:
WKNotificationManagerSetProvider now takes a WKNotificationProviderBase.
* UIProcess/API/C/WKNotificationProvider.h:
Deprecate WKNotificationProvider and kWKNotificationProviderCurrentVersion.
2013-12-03 Brady Eidson <beidson@apple.com>
Indexed Database work should be done on a non-main queue
......
......@@ -46,4 +46,16 @@
#endif
#endif /* !defined(WK_INLINE) */
#if defined(__has_extension) && __has_extension(enumerator_attributes) && __has_extension(attribute_unavailable_with_message)
#define WK_DEPRECATED(message) __attribute__((deprecated(message)))
#else
#define WK_DEPRECATED(message)
#endif
#if defined(__has_extension) && __has_extension(enumerator_attributes) && __has_extension(attribute_unavailable_with_message)
#define WK_ENUM_DEPRECATED(message) __attribute__((deprecated(message)))
#else
#define WK_ENUM_DEPRECATED(message)
#endif
#endif /* WKDeclarationSpecifiers_h */
......@@ -36,9 +36,9 @@ WKTypeID WKNotificationManagerGetTypeID()
return toAPI(WebNotificationManagerProxy::APIType);
}
void WKNotificationManagerSetProvider(WKNotificationManagerRef managerRef, const WKNotificationProvider* wkProvider)
void WKNotificationManagerSetProvider(WKNotificationManagerRef managerRef, const WKNotificationProviderBase* wkProvider)
{
toImpl(managerRef)->initializeProvider(reinterpret_cast<const WKNotificationProviderBase*>(wkProvider));
toImpl(managerRef)->initializeProvider(wkProvider);
}
void WKNotificationManagerProviderDidShowNotification(WKNotificationManagerRef managerRef, uint64_t notificationID)
......
......@@ -34,7 +34,7 @@ extern "C" {
#endif
WK_EXPORT WKTypeID WKNotificationManagerGetTypeID();
WK_EXPORT void WKNotificationManagerSetProvider(WKNotificationManagerRef managerRef, const WKNotificationProvider* wkProvider);
WK_EXPORT void WKNotificationManagerSetProvider(WKNotificationManagerRef managerRef, const WKNotificationProviderBase* wkProvider);
WK_EXPORT void WKNotificationManagerProviderDidShowNotification(WKNotificationManagerRef managerRef, uint64_t notificationID);
WK_EXPORT void WKNotificationManagerProviderDidClickNotification(WKNotificationManagerRef managerRef, uint64_t notificationID);
......
......@@ -58,8 +58,7 @@ typedef struct WKNotificationProviderV0 {
WKNotificationProviderClearNotificationsCallback clearNotifications;
} WKNotificationProviderV0;
// FIXME: Deprecate.
enum { kWKNotificationProviderCurrentVersion = 0 };
enum { kWKNotificationProviderCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0, };
typedef struct WKNotificationProvider {
int version;
const void* clientInfo;
......@@ -72,7 +71,7 @@ typedef struct WKNotificationProvider {
WKNotificationProviderRemoveNotificationManagerCallback removeNotificationManager;
WKNotificationProviderNotificationPermissionsCallback notificationPermissions;
WKNotificationProviderClearNotificationsCallback clearNotifications;
} WKNotificationProvider;
} WKNotificationProvider WK_DEPRECATED("Use an explicit versioned struct instead");
#ifdef __cplusplus
}
......
2013-12-03 Anders Carlsson <andersca@apple.com>
Deprecate WKNotificationProvider
https://bugs.webkit.org/show_bug.cgi?id=125178
Reviewed by Sam Weinig.
Update for WebKit2 changes.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
* WebKitTestRunner/WebNotificationProvider.cpp:
(WTR::WebNotificationProvider::provider):
* WebKitTestRunner/WebNotificationProvider.h:
2013-12-03 Brent Fulgham <bfulgham@apple.com>
[Win] Support 64-bit Application Support Libraries Location
......
......@@ -376,8 +376,8 @@ void TestController::initialize(int argc, const char* argv[])
WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient);
WKNotificationManagerRef notificationManager = WKContextGetNotificationManager(m_context.get());
WKNotificationProvider notificationKit = m_webNotificationProvider.provider();
WKNotificationManagerSetProvider(notificationManager, &notificationKit);
WKNotificationProviderV0 notificationKit = m_webNotificationProvider.provider();
WKNotificationManagerSetProvider(notificationManager, &notificationKit.base);
if (testPluginDirectory())
WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory());
......
......@@ -68,11 +68,10 @@ WebNotificationProvider::~WebNotificationProvider()
WKNotificationManagerSetProvider(m_notificationManager.get(), 0);
}
WKNotificationProvider WebNotificationProvider::provider()
WKNotificationProviderV0 WebNotificationProvider::provider()
{
WKNotificationProvider notificationProvider = {
kWKNotificationProviderCurrentVersion,
this,
WKNotificationProviderV0 notificationProvider = {
{ kWKNotificationProviderCurrentVersion, this },
WTR::showWebNotification,
WTR::closeWebNotification,
0, // didDestroyNotification
......
......@@ -37,7 +37,7 @@ class WebNotificationProvider {
public:
WebNotificationProvider();
~WebNotificationProvider();
WKNotificationProvider provider();
WKNotificationProviderV0 provider();
void showWebNotification(WKPageRef, WKNotificationRef);
void closeWebNotification(WKNotificationRef);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment