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

Add versioned structs for the remaining clients

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

Reviewed by Andreas Kling.

* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKContextConnectionClient.h:
* UIProcess/API/C/WKContextDownloadClient.h:
* UIProcess/API/C/WKContextHistoryClient.h:
* UIProcess/API/C/WKContextInjectedBundleClient.h:
* UIProcess/API/C/WKOriginDataManager.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159984 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c929baa8
2013-12-02 Anders Carlsson <andersca@apple.com>
Add versioned structs for the remaining clients
https://bugs.webkit.org/show_bug.cgi?id=125123
Reviewed by Andreas Kling.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKContextConnectionClient.h:
* UIProcess/API/C/WKContextDownloadClient.h:
* UIProcess/API/C/WKContextHistoryClient.h:
* UIProcess/API/C/WKContextInjectedBundleClient.h:
* UIProcess/API/C/WKOriginDataManager.h:
2013-12-02 Anders Carlsson <andersca@apple.com>
Move WKContext clients to separate files
......
......@@ -48,18 +48,31 @@ typedef void (*WKContextPlugInAutoStartOriginHashesChangedCallback)(WKContextRef
typedef void (*WKContextNetworkProcessDidCrashCallback)(WKContextRef context, const void *clientInfo);
typedef void (*WKContextPlugInInformationBecameAvailableCallback)(WKContextRef context, WKArrayRef plugIn, const void *clientInfo);
struct WKContextClient {
typedef struct WKContextClientBase {
int version;
const void * clientInfo;
} WKContextClientBase;
typedef struct WKContextClientV0 {
WKContextClientBase base;
// Version 0.
WKContextPlugInAutoStartOriginHashesChangedCallback plugInAutoStartOriginHashesChanged;
WKContextNetworkProcessDidCrashCallback networkProcessDidCrash;
WKContextPlugInInformationBecameAvailableCallback plugInInformationBecameAvailable;
};
typedef struct WKContextClient WKContextClient;
} WKContextClientV0;
// FIXME: Deprecate.
enum { kWKContextClientCurrentVersion = 0 };
typedef struct WKContextClient {
int version;
const void * clientInfo;
// Version 0.
WKContextPlugInAutoStartOriginHashesChangedCallback plugInAutoStartOriginHashesChanged;
WKContextNetworkProcessDidCrashCallback networkProcessDidCrash;
WKContextPlugInInformationBecameAvailableCallback plugInInformationBecameAvailable;
} WKContextClient;
enum {
kWKProcessModelSharedSecondaryProcess = 0,
......
......@@ -30,14 +30,26 @@
typedef void (*WKContextDidCreateConnection)(WKContextRef context, WKConnectionRef connection, const void* clientInfo);
struct WKContextConnectionClient {
typedef struct WKContextConnectionClientBase {
int version;
const void * clientInfo;
} WKContextConnectionClientBase;
typedef struct WKContextConnectionClientV0 {
WKContextConnectionClientBase base;
// Version 0.
WKContextDidCreateConnection didCreateConnection;
};
typedef struct WKContextConnectionClient WKContextConnectionClient;
} WKContextConnectionClientV0;
// FIXME: Deprecate.
enum { kWKContextConnectionClientCurrentVersion = 0 };
typedef struct WKContextConnectionClient {
int version;
const void * clientInfo;
// Version 0.
WKContextDidCreateConnection didCreateConnection;
} WKContextConnectionClient;
#endif // WKContextConnectionClient_h
......@@ -40,9 +40,15 @@ typedef void (*WKContextDownloadDidFailCallback)(WKContextRef context, WKDownloa
typedef void (*WKContextDownloadDidCancel)(WKContextRef context, WKDownloadRef download, const void *clientInfo);
typedef void (*WKContextDownloadProcessDidCrashCallback)(WKContextRef context, WKDownloadRef download, const void *clientInfo);
struct WKContextDownloadClient {
typedef struct WKContextDownloadClientBase {
int version;
const void * clientInfo;
} WKContextDownloadClientBase;
typedef struct WKContextDownloadClientV0 {
WKContextDownloadClientBase base;
// Version 0.
WKContextDownloadDidStartCallback didStart;
WKContextDownloadDidReceiveAuthenticationChallengeCallback didReceiveAuthenticationChallenge;
WKContextDownloadDidReceiveResponseCallback didReceiveResponse;
......@@ -54,9 +60,26 @@ struct WKContextDownloadClient {
WKContextDownloadDidFailCallback didFail;
WKContextDownloadDidCancel didCancel;
WKContextDownloadProcessDidCrashCallback processDidCrash;
};
typedef struct WKContextDownloadClient WKContextDownloadClient;
} WKContextDownloadClientV0;
// FIXME: Deprecate.
enum { kWKContextDownloadClientCurrentVersion = 0 };
typedef struct WKContextDownloadClient {
int version;
const void * clientInfo;
// Version 0.
WKContextDownloadDidStartCallback didStart;
WKContextDownloadDidReceiveAuthenticationChallengeCallback didReceiveAuthenticationChallenge;
WKContextDownloadDidReceiveResponseCallback didReceiveResponse;
WKContextDownloadDidReceiveDataCallback didReceiveData;
WKContextDownloadShouldDecodeSourceDataOfMIMETypeCallback shouldDecodeSourceDataOfMIMEType;
WKContextDownloadDecideDestinationWithSuggestedFilenameCallback decideDestinationWithSuggestedFilename;
WKContextDownloadDidCreateDestinationCallback didCreateDestination;
WKContextDownloadDidFinishCallback didFinish;
WKContextDownloadDidFailCallback didFail;
WKContextDownloadDidCancel didCancel;
WKContextDownloadProcessDidCrashCallback processDidCrash;
} WKContextDownloadClient;
#endif // WKContextDownloadClient_h
......@@ -34,17 +34,34 @@ typedef void (*WKContextDidPerformServerRedirectCallback)(WKContextRef context,
typedef void (*WKContextDidUpdateHistoryTitleCallback)(WKContextRef context, WKPageRef page, WKStringRef title, WKURLRef URL, WKFrameRef frame, const void *clientInfo);
typedef void (*WKContextPopulateVisitedLinksCallback)(WKContextRef context, const void *clientInfo);
struct WKContextHistoryClient {
typedef struct WKContextHistoryClientBase {
int version;
const void * clientInfo;
} WKContextHistoryClientBase;
typedef struct WKContextHistoryClientV0 {
WKContextHistoryClientBase base;
// Version 0.
WKContextDidNavigateWithNavigationDataCallback didNavigateWithNavigationData;
WKContextDidPerformClientRedirectCallback didPerformClientRedirect;
WKContextDidPerformServerRedirectCallback didPerformServerRedirect;
WKContextDidUpdateHistoryTitleCallback didUpdateHistoryTitle;
WKContextPopulateVisitedLinksCallback populateVisitedLinks;
};
typedef struct WKContextHistoryClient WKContextHistoryClient;
} WKContextHistoryClientV0;
// FIXME: Deprecate.
enum { kWKContextHistoryClientCurrentVersion = 0 };
typedef struct WKContextHistoryClient {
int version;
const void * clientInfo;
// Version 0.
WKContextDidNavigateWithNavigationDataCallback didNavigateWithNavigationData;
WKContextDidPerformClientRedirectCallback didPerformClientRedirect;
WKContextDidPerformServerRedirectCallback didPerformServerRedirect;
WKContextDidUpdateHistoryTitleCallback didUpdateHistoryTitle;
WKContextPopulateVisitedLinksCallback populateVisitedLinks;
} WKContextHistoryClient;
#endif // WKContextHistoryClient_h
......@@ -33,7 +33,31 @@ typedef void (*WKContextDidReceiveMessageFromInjectedBundleCallback)(WKContextRe
typedef void (*WKContextDidReceiveSynchronousMessageFromInjectedBundleCallback)(WKContextRef page, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void *clientInfo);
typedef WKTypeRef (*WKContextGetInjectedBundleInitializationUserDataCallback)(WKContextRef context, const void *clientInfo);
struct WKContextInjectedBundleClient {
typedef struct WKContextInjectedBundleClientBase {
int version;
const void * clientInfo;
} WKContextInjectedBundleClientBase;
typedef struct WKContextInjectedBundleClientV0 {
WKContextInjectedBundleClientBase base;
// Version 0.
WKContextDidReceiveMessageFromInjectedBundleCallback didReceiveMessageFromInjectedBundle;
WKContextDidReceiveSynchronousMessageFromInjectedBundleCallback didReceiveSynchronousMessageFromInjectedBundle;
} WKContextInjectedBundleClientV0;
typedef struct WKContextInjectedBundleClientV1 {
WKContextInjectedBundleClientBase base;
// Version 0.
WKContextDidReceiveMessageFromInjectedBundleCallback didReceiveMessageFromInjectedBundle;
WKContextDidReceiveSynchronousMessageFromInjectedBundleCallback didReceiveSynchronousMessageFromInjectedBundle;
// Version 1.
WKContextGetInjectedBundleInitializationUserDataCallback getInjectedBundleInitializationUserData;
} WKContextInjectedBundleClientV1;
typedef struct WKContextInjectedBundleClient {
int version;
const void * clientInfo;
......@@ -43,8 +67,7 @@ struct WKContextInjectedBundleClient {
// Version 1.
WKContextGetInjectedBundleInitializationUserDataCallback getInjectedBundleInitializationUserData;
};
typedef struct WKContextInjectedBundleClient WKContextInjectedBundleClient;
} WKContextInjectedBundleClient;
enum { kWKContextInjectedBundleClientCurrentVersion = 1 };
......
......@@ -55,14 +55,28 @@ WK_EXPORT void WKOriginDataManagerDeleteAllEntries(WKOriginDataManagerRef origin
// OriginDataManager Client
typedef void (*WKOriginDataManagerChangeCallback)(WKOriginDataManagerRef originDataManager, const void *clientInfo);
struct WKOriginDataManagerChangeClient {
int version;
const void * clientInfo;
WKOriginDataManagerChangeCallback didChange;
};
typedef struct WKOriginDataManagerChangeClient WKOriginDataManagerChangeClient;
typedef struct WKOriginDataManagerChangeClientBase {
const void * clientInfo;
int version;
} WKOriginDataManagerChangeClientBase;
typedef struct WKOriginDataManagerChangeClientV0 {
WKOriginDataManagerChangeClientBase base;
// Version 0.
WKOriginDataManagerChangeCallback didChange;
} WKOriginDataManagerChangeClientV0;
// FIXME: Deprecate.
enum { kWKOriginDataManagerChangeClientVersion = 0 };
typedef struct WKOriginDataManagerChangeClient {
int version;
const void * clientInfo;
// Version 0.
WKOriginDataManagerChangeCallback didChange;
} WKOriginDataManagerChangeClient;
WK_EXPORT void WKOriginDataManagerStartObservingChanges(WKOriginDataManagerRef originDataManager, WKOriginDataTypes types);
WK_EXPORT void WKOriginDataManagerStopObservingChanges(WKOriginDataManagerRef originDataManager, WKOriginDataTypes types);
......
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