3b3243272402e3769fc3b45917e9224f36e4083e
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / C / WKPageLoaderClient.h
1 /*
2  * Copyright (C) 2013 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #ifndef WKPageLoaderClient_h
27 #define WKPageLoaderClient_h
28
29 #include <WebKit/WKBase.h>
30 #include <WebKit/WKErrorRef.h>
31 #include <WebKit/WKPageLoadTypes.h>
32 #include <WebKit/WKPluginLoadPolicy.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 enum {
39     kWKWebGLLoadPolicyBlocked = 0,
40     kWKWebGLLoadPolicyLoadNormally,
41     kWKWebGLLoadPolicyPending
42 };
43 typedef uint32_t WKWebGLLoadPolicy;
44
45 typedef void (*WKPageLoaderClientCallback)(WKPageRef page, const void* clientInfo);
46 typedef void (*WKPageDidStartProvisionalLoadForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
47 typedef void (*WKPageDidReceiveServerRedirectForProvisionalLoadForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
48 typedef void (*WKPageDidFailProvisionalLoadWithErrorForFrameCallback)(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void *clientInfo);
49 typedef void (*WKPageDidCommitLoadForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
50 typedef void (*WKPageDidFinishDocumentLoadForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
51 typedef void (*WKPageDidFinishLoadForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
52 typedef void (*WKPageDidFailLoadWithErrorForFrameCallback)(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void *clientInfo);
53 typedef void (*WKPageDidSameDocumentNavigationForFrameCallback)(WKPageRef page, WKFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef userData, const void *clientInfo);
54 typedef void (*WKPageDidReceiveTitleForFrameCallback)(WKPageRef page, WKStringRef title, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
55 typedef void (*WKPageDidFirstLayoutForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
56 typedef void (*WKPageDidFirstVisuallyNonEmptyLayoutForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
57 typedef void (*WKPageDidRemoveFrameFromHierarchyCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
58 typedef void (*WKPageDidDisplayInsecureContentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
59 typedef void (*WKPageDidRunInsecureContentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
60 typedef void (*WKPageDidDetectXSSForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
61 typedef bool (*WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback)(WKPageRef page, WKFrameRef frame, WKProtectionSpaceRef protectionSpace, const void *clientInfo);
62 typedef void (*WKPageDidReceiveAuthenticationChallengeInFrameCallback)(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo);
63 typedef void (*WKPageDidChangeBackForwardListCallback)(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo);
64 typedef bool (*WKPageShouldGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
65 typedef bool (*WKPageShouldKeepCurrentBackForwardListItemInListCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
66 typedef void (*WKPageWillGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, WKTypeRef userData, const void *clientInfo);
67 typedef void (*WKPageDidLayoutCallback)(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef userData, const void *clientInfo);
68 typedef WKPluginLoadPolicy (*WKPagePluginLoadPolicyCallback)(WKPageRef page, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInfoDictionary, WKStringRef* unavailabilityDescription, const void* clientInfo);
69 typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, uint32_t errorCode, WKDictionaryRef pluginInfoDictionary, const void* clientInfo);
70 typedef WKWebGLLoadPolicy (*WKPageWebGLLoadPolicyCallback)(WKPageRef page, WKStringRef url, const void* clientInfo);
71
72 // Deprecated
73 typedef void (*WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, const void* clientInfo);
74 typedef void (*WKPagePluginDidFailCallback_deprecatedForUseWithV1)(WKPageRef page, uint32_t errorCode, WKStringRef mimeType, WKStringRef pluginIdentifier, WKStringRef pluginVersion, const void* clientInfo);
75 typedef WKPluginLoadPolicy (*WKPagePluginLoadPolicyCallback_deprecatedForUseWithV2)(WKPageRef page, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInfoDictionary, const void* clientInfo);
76
77 typedef struct WKPageLoaderClientBase {
78     int                                                                 version;
79     const void *                                                        clientInfo;
80 } WKPageLoaderClientBase;
81
82 typedef struct WKPageLoaderClientV0 {
83     WKPageLoaderClientBase                                              base;
84
85     // Version 0.
86     WKPageDidStartProvisionalLoadForFrameCallback                       didStartProvisionalLoadForFrame;
87     WKPageDidReceiveServerRedirectForProvisionalLoadForFrameCallback    didReceiveServerRedirectForProvisionalLoadForFrame;
88     WKPageDidFailProvisionalLoadWithErrorForFrameCallback               didFailProvisionalLoadWithErrorForFrame;
89     WKPageDidCommitLoadForFrameCallback                                 didCommitLoadForFrame;
90     WKPageDidFinishDocumentLoadForFrameCallback                         didFinishDocumentLoadForFrame;
91     WKPageDidFinishLoadForFrameCallback                                 didFinishLoadForFrame;
92     WKPageDidFailLoadWithErrorForFrameCallback                          didFailLoadWithErrorForFrame;
93     WKPageDidSameDocumentNavigationForFrameCallback                     didSameDocumentNavigationForFrame;
94     WKPageDidReceiveTitleForFrameCallback                               didReceiveTitleForFrame;
95     WKPageDidFirstLayoutForFrameCallback                                didFirstLayoutForFrame;
96     WKPageDidFirstVisuallyNonEmptyLayoutForFrameCallback                didFirstVisuallyNonEmptyLayoutForFrame;
97     WKPageDidRemoveFrameFromHierarchyCallback                           didRemoveFrameFromHierarchy;
98     WKPageDidDisplayInsecureContentForFrameCallback                     didDisplayInsecureContentForFrame;
99     WKPageDidRunInsecureContentForFrameCallback                         didRunInsecureContentForFrame;
100     WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback          canAuthenticateAgainstProtectionSpaceInFrame;
101     WKPageDidReceiveAuthenticationChallengeInFrameCallback              didReceiveAuthenticationChallengeInFrame;
102
103     // FIXME: Move to progress client.
104     WKPageLoaderClientCallback                                          didStartProgress;
105     WKPageLoaderClientCallback                                          didChangeProgress;
106     WKPageLoaderClientCallback                                          didFinishProgress;
107
108     // FIXME: These three functions should not be part of this client.
109     WKPageLoaderClientCallback                                          processDidBecomeUnresponsive;
110     WKPageLoaderClientCallback                                          processDidBecomeResponsive;
111     WKPageLoaderClientCallback                                          processDidCrash;
112     WKPageDidChangeBackForwardListCallback                              didChangeBackForwardList;
113     WKPageShouldGoToBackForwardListItemCallback                         shouldGoToBackForwardListItem;
114     WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0      didFailToInitializePlugin_deprecatedForUseWithV0;
115 } WKPageLoaderClientV0;
116
117 typedef struct WKPageLoaderClientV1 {
118     WKPageLoaderClientBase                                              base;
119
120     // Version -.
121     WKPageDidStartProvisionalLoadForFrameCallback                       didStartProvisionalLoadForFrame;
122     WKPageDidReceiveServerRedirectForProvisionalLoadForFrameCallback    didReceiveServerRedirectForProvisionalLoadForFrame;
123     WKPageDidFailProvisionalLoadWithErrorForFrameCallback               didFailProvisionalLoadWithErrorForFrame;
124     WKPageDidCommitLoadForFrameCallback                                 didCommitLoadForFrame;
125     WKPageDidFinishDocumentLoadForFrameCallback                         didFinishDocumentLoadForFrame;
126     WKPageDidFinishLoadForFrameCallback                                 didFinishLoadForFrame;
127     WKPageDidFailLoadWithErrorForFrameCallback                          didFailLoadWithErrorForFrame;
128     WKPageDidSameDocumentNavigationForFrameCallback                     didSameDocumentNavigationForFrame;
129     WKPageDidReceiveTitleForFrameCallback                               didReceiveTitleForFrame;
130     WKPageDidFirstLayoutForFrameCallback                                didFirstLayoutForFrame;
131     WKPageDidFirstVisuallyNonEmptyLayoutForFrameCallback                didFirstVisuallyNonEmptyLayoutForFrame;
132     WKPageDidRemoveFrameFromHierarchyCallback                           didRemoveFrameFromHierarchy;
133     WKPageDidDisplayInsecureContentForFrameCallback                     didDisplayInsecureContentForFrame;
134     WKPageDidRunInsecureContentForFrameCallback                         didRunInsecureContentForFrame;
135     WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback          canAuthenticateAgainstProtectionSpaceInFrame;
136     WKPageDidReceiveAuthenticationChallengeInFrameCallback              didReceiveAuthenticationChallengeInFrame;
137
138     // FIXME: Move to progress client.
139     WKPageLoaderClientCallback                                          didStartProgress;
140     WKPageLoaderClientCallback                                          didChangeProgress;
141     WKPageLoaderClientCallback                                          didFinishProgress;
142
143     // FIXME: These three functions should not be part of this client.
144     WKPageLoaderClientCallback                                          processDidBecomeUnresponsive;
145     WKPageLoaderClientCallback                                          processDidBecomeResponsive;
146     WKPageLoaderClientCallback                                          processDidCrash;
147     WKPageDidChangeBackForwardListCallback                              didChangeBackForwardList;
148     WKPageShouldGoToBackForwardListItemCallback                         shouldGoToBackForwardListItem;
149     WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0      didFailToInitializePlugin_deprecatedForUseWithV0;
150
151     // Version 1.
152     WKPageDidDetectXSSForFrameCallback                                  didDetectXSSForFrame;
153
154     void*                                                               didNewFirstVisuallyNonEmptyLayout_unavailable;
155
156     WKPageWillGoToBackForwardListItemCallback                           willGoToBackForwardListItem;
157
158     WKPageLoaderClientCallback                                          interactionOccurredWhileProcessUnresponsive;
159     WKPagePluginDidFailCallback_deprecatedForUseWithV1                  pluginDidFail_deprecatedForUseWithV1;
160 } WKPageLoaderClientV1;
161
162 typedef struct WKPageLoaderClientV2 {
163     WKPageLoaderClientBase                                              base;
164
165     // Version 0.
166     WKPageDidStartProvisionalLoadForFrameCallback                       didStartProvisionalLoadForFrame;
167     WKPageDidReceiveServerRedirectForProvisionalLoadForFrameCallback    didReceiveServerRedirectForProvisionalLoadForFrame;
168     WKPageDidFailProvisionalLoadWithErrorForFrameCallback               didFailProvisionalLoadWithErrorForFrame;
169     WKPageDidCommitLoadForFrameCallback                                 didCommitLoadForFrame;
170     WKPageDidFinishDocumentLoadForFrameCallback                         didFinishDocumentLoadForFrame;
171     WKPageDidFinishLoadForFrameCallback                                 didFinishLoadForFrame;
172     WKPageDidFailLoadWithErrorForFrameCallback                          didFailLoadWithErrorForFrame;
173     WKPageDidSameDocumentNavigationForFrameCallback                     didSameDocumentNavigationForFrame;
174     WKPageDidReceiveTitleForFrameCallback                               didReceiveTitleForFrame;
175     WKPageDidFirstLayoutForFrameCallback                                didFirstLayoutForFrame;
176     WKPageDidFirstVisuallyNonEmptyLayoutForFrameCallback                didFirstVisuallyNonEmptyLayoutForFrame;
177     WKPageDidRemoveFrameFromHierarchyCallback                           didRemoveFrameFromHierarchy;
178     WKPageDidDisplayInsecureContentForFrameCallback                     didDisplayInsecureContentForFrame;
179     WKPageDidRunInsecureContentForFrameCallback                         didRunInsecureContentForFrame;
180     WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback          canAuthenticateAgainstProtectionSpaceInFrame;
181     WKPageDidReceiveAuthenticationChallengeInFrameCallback              didReceiveAuthenticationChallengeInFrame;
182
183     // FIXME: Move to progress client.
184     WKPageLoaderClientCallback                                          didStartProgress;
185     WKPageLoaderClientCallback                                          didChangeProgress;
186     WKPageLoaderClientCallback                                          didFinishProgress;
187
188     // FIXME: These three functions should not be part of this client.
189     WKPageLoaderClientCallback                                          processDidBecomeUnresponsive;
190     WKPageLoaderClientCallback                                          processDidBecomeResponsive;
191     WKPageLoaderClientCallback                                          processDidCrash;
192     WKPageDidChangeBackForwardListCallback                              didChangeBackForwardList;
193     WKPageShouldGoToBackForwardListItemCallback                         shouldGoToBackForwardListItem;
194     WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0      didFailToInitializePlugin_deprecatedForUseWithV0;
195
196     // Version 1.
197     WKPageDidDetectXSSForFrameCallback                                  didDetectXSSForFrame;
198
199     void*                                                               didNewFirstVisuallyNonEmptyLayout_unavailable;
200
201     WKPageWillGoToBackForwardListItemCallback                           willGoToBackForwardListItem;
202
203     WKPageLoaderClientCallback                                          interactionOccurredWhileProcessUnresponsive;
204     WKPagePluginDidFailCallback_deprecatedForUseWithV1                  pluginDidFail_deprecatedForUseWithV1;
205
206     // Version 2.
207     void                                                                (*didReceiveIntentForFrame_unavailable)(void);
208     void                                                                (*registerIntentServiceForFrame_unavailable)(void);
209
210     WKPageDidLayoutCallback                                             didLayout;
211     WKPagePluginLoadPolicyCallback_deprecatedForUseWithV2               pluginLoadPolicy_deprecatedForUseWithV2;
212     WKPagePluginDidFailCallback                                         pluginDidFail;
213 } WKPageLoaderClientV2;
214
215 typedef struct WKPageLoaderClientV3 {
216     WKPageLoaderClientBase                                              base;
217
218     // Version 0.
219     WKPageDidStartProvisionalLoadForFrameCallback                       didStartProvisionalLoadForFrame;
220     WKPageDidReceiveServerRedirectForProvisionalLoadForFrameCallback    didReceiveServerRedirectForProvisionalLoadForFrame;
221     WKPageDidFailProvisionalLoadWithErrorForFrameCallback               didFailProvisionalLoadWithErrorForFrame;
222     WKPageDidCommitLoadForFrameCallback                                 didCommitLoadForFrame;
223     WKPageDidFinishDocumentLoadForFrameCallback                         didFinishDocumentLoadForFrame;
224     WKPageDidFinishLoadForFrameCallback                                 didFinishLoadForFrame;
225     WKPageDidFailLoadWithErrorForFrameCallback                          didFailLoadWithErrorForFrame;
226     WKPageDidSameDocumentNavigationForFrameCallback                     didSameDocumentNavigationForFrame;
227     WKPageDidReceiveTitleForFrameCallback                               didReceiveTitleForFrame;
228     WKPageDidFirstLayoutForFrameCallback                                didFirstLayoutForFrame;
229     WKPageDidFirstVisuallyNonEmptyLayoutForFrameCallback                didFirstVisuallyNonEmptyLayoutForFrame;
230     WKPageDidRemoveFrameFromHierarchyCallback                           didRemoveFrameFromHierarchy;
231     WKPageDidDisplayInsecureContentForFrameCallback                     didDisplayInsecureContentForFrame;
232     WKPageDidRunInsecureContentForFrameCallback                         didRunInsecureContentForFrame;
233     WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback          canAuthenticateAgainstProtectionSpaceInFrame;
234     WKPageDidReceiveAuthenticationChallengeInFrameCallback              didReceiveAuthenticationChallengeInFrame;
235
236     // FIXME: Move to progress client.
237     WKPageLoaderClientCallback                                          didStartProgress;
238     WKPageLoaderClientCallback                                          didChangeProgress;
239     WKPageLoaderClientCallback                                          didFinishProgress;
240
241     // FIXME: These three functions should not be part of this client.
242     WKPageLoaderClientCallback                                          processDidBecomeUnresponsive;
243     WKPageLoaderClientCallback                                          processDidBecomeResponsive;
244     WKPageLoaderClientCallback                                          processDidCrash;
245     WKPageDidChangeBackForwardListCallback                              didChangeBackForwardList;
246     WKPageShouldGoToBackForwardListItemCallback                         shouldGoToBackForwardListItem;
247     WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0      didFailToInitializePlugin_deprecatedForUseWithV0;
248
249     // Version 1.
250     WKPageDidDetectXSSForFrameCallback                                  didDetectXSSForFrame;
251
252     void*                                                               didNewFirstVisuallyNonEmptyLayout_unavailable;
253
254     WKPageWillGoToBackForwardListItemCallback                           willGoToBackForwardListItem;
255
256     WKPageLoaderClientCallback                                          interactionOccurredWhileProcessUnresponsive;
257     WKPagePluginDidFailCallback_deprecatedForUseWithV1                  pluginDidFail_deprecatedForUseWithV1;
258
259     // Version 2.
260     void                                                                (*didReceiveIntentForFrame_unavailable)(void);
261     void                                                                (*registerIntentServiceForFrame_unavailable)(void);
262
263     WKPageDidLayoutCallback                                             didLayout;
264     WKPagePluginLoadPolicyCallback_deprecatedForUseWithV2               pluginLoadPolicy_deprecatedForUseWithV2;
265     WKPagePluginDidFailCallback                                         pluginDidFail;
266
267     // Version 3.
268     WKPagePluginLoadPolicyCallback                                      pluginLoadPolicy;
269 } WKPageLoaderClientV3;
270
271 typedef struct WKPageLoaderClientV4 {
272     WKPageLoaderClientBase                                              base;
273     
274     // Version 0.
275     WKPageDidStartProvisionalLoadForFrameCallback                       didStartProvisionalLoadForFrame;
276     WKPageDidReceiveServerRedirectForProvisionalLoadForFrameCallback    didReceiveServerRedirectForProvisionalLoadForFrame;
277     WKPageDidFailProvisionalLoadWithErrorForFrameCallback               didFailProvisionalLoadWithErrorForFrame;
278     WKPageDidCommitLoadForFrameCallback                                 didCommitLoadForFrame;
279     WKPageDidFinishDocumentLoadForFrameCallback                         didFinishDocumentLoadForFrame;
280     WKPageDidFinishLoadForFrameCallback                                 didFinishLoadForFrame;
281     WKPageDidFailLoadWithErrorForFrameCallback                          didFailLoadWithErrorForFrame;
282     WKPageDidSameDocumentNavigationForFrameCallback                     didSameDocumentNavigationForFrame;
283     WKPageDidReceiveTitleForFrameCallback                               didReceiveTitleForFrame;
284     WKPageDidFirstLayoutForFrameCallback                                didFirstLayoutForFrame;
285     WKPageDidFirstVisuallyNonEmptyLayoutForFrameCallback                didFirstVisuallyNonEmptyLayoutForFrame;
286     WKPageDidRemoveFrameFromHierarchyCallback                           didRemoveFrameFromHierarchy;
287     WKPageDidDisplayInsecureContentForFrameCallback                     didDisplayInsecureContentForFrame;
288     WKPageDidRunInsecureContentForFrameCallback                         didRunInsecureContentForFrame;
289     WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback          canAuthenticateAgainstProtectionSpaceInFrame;
290     WKPageDidReceiveAuthenticationChallengeInFrameCallback              didReceiveAuthenticationChallengeInFrame;
291     
292     // FIXME: Move to progress client.
293     WKPageLoaderClientCallback                                          didStartProgress;
294     WKPageLoaderClientCallback                                          didChangeProgress;
295     WKPageLoaderClientCallback                                          didFinishProgress;
296     
297     // FIXME: These three functions should not be part of this client.
298     WKPageLoaderClientCallback                                          processDidBecomeUnresponsive;
299     WKPageLoaderClientCallback                                          processDidBecomeResponsive;
300     WKPageLoaderClientCallback                                          processDidCrash;
301     WKPageDidChangeBackForwardListCallback                              didChangeBackForwardList;
302     WKPageShouldGoToBackForwardListItemCallback                         shouldGoToBackForwardListItem;
303     WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0      didFailToInitializePlugin_deprecatedForUseWithV0;
304     
305     // Version 1.
306     WKPageDidDetectXSSForFrameCallback                                  didDetectXSSForFrame;
307     
308     void*                                                               didNewFirstVisuallyNonEmptyLayout_unavailable;
309     
310     WKPageWillGoToBackForwardListItemCallback                           willGoToBackForwardListItem;
311     
312     WKPageLoaderClientCallback                                          interactionOccurredWhileProcessUnresponsive;
313     WKPagePluginDidFailCallback_deprecatedForUseWithV1                  pluginDidFail_deprecatedForUseWithV1;
314     
315     // Version 2.
316     void                                                                (*didReceiveIntentForFrame_unavailable)(void);
317     void                                                                (*registerIntentServiceForFrame_unavailable)(void);
318     
319     WKPageDidLayoutCallback                                             didLayout;
320     WKPagePluginLoadPolicyCallback_deprecatedForUseWithV2               pluginLoadPolicy_deprecatedForUseWithV2;
321     WKPagePluginDidFailCallback                                         pluginDidFail;
322     
323     // Version 3.
324     WKPagePluginLoadPolicyCallback                                      pluginLoadPolicy;
325     
326     // Version 4
327     WKPageWebGLLoadPolicyCallback                                       webGLLoadPolicy;
328     WKPageWebGLLoadPolicyCallback                                       resolveWebGLLoadPolicy;
329 } WKPageLoaderClientV4;
330
331 typedef struct WKPageLoaderClientV5 {
332     WKPageLoaderClientBase                                              base;
333
334     // Version 0.
335     WKPageDidStartProvisionalLoadForFrameCallback                       didStartProvisionalLoadForFrame;
336     WKPageDidReceiveServerRedirectForProvisionalLoadForFrameCallback    didReceiveServerRedirectForProvisionalLoadForFrame;
337     WKPageDidFailProvisionalLoadWithErrorForFrameCallback               didFailProvisionalLoadWithErrorForFrame;
338     WKPageDidCommitLoadForFrameCallback                                 didCommitLoadForFrame;
339     WKPageDidFinishDocumentLoadForFrameCallback                         didFinishDocumentLoadForFrame;
340     WKPageDidFinishLoadForFrameCallback                                 didFinishLoadForFrame;
341     WKPageDidFailLoadWithErrorForFrameCallback                          didFailLoadWithErrorForFrame;
342     WKPageDidSameDocumentNavigationForFrameCallback                     didSameDocumentNavigationForFrame;
343     WKPageDidReceiveTitleForFrameCallback                               didReceiveTitleForFrame;
344     WKPageDidFirstLayoutForFrameCallback                                didFirstLayoutForFrame;
345     WKPageDidFirstVisuallyNonEmptyLayoutForFrameCallback                didFirstVisuallyNonEmptyLayoutForFrame;
346     WKPageDidRemoveFrameFromHierarchyCallback                           didRemoveFrameFromHierarchy;
347     WKPageDidDisplayInsecureContentForFrameCallback                     didDisplayInsecureContentForFrame;
348     WKPageDidRunInsecureContentForFrameCallback                         didRunInsecureContentForFrame;
349     WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback          canAuthenticateAgainstProtectionSpaceInFrame;
350     WKPageDidReceiveAuthenticationChallengeInFrameCallback              didReceiveAuthenticationChallengeInFrame;
351
352     // FIXME: Move to progress client.
353     WKPageLoaderClientCallback                                          didStartProgress;
354     WKPageLoaderClientCallback                                          didChangeProgress;
355     WKPageLoaderClientCallback                                          didFinishProgress;
356
357     // FIXME: These three functions should not be part of this client.
358     WKPageLoaderClientCallback                                          processDidBecomeUnresponsive;
359     WKPageLoaderClientCallback                                          processDidBecomeResponsive;
360     WKPageLoaderClientCallback                                          processDidCrash;
361     WKPageDidChangeBackForwardListCallback                              didChangeBackForwardList;
362     WKPageShouldGoToBackForwardListItemCallback                         shouldGoToBackForwardListItem;
363     WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0      didFailToInitializePlugin_deprecatedForUseWithV0;
364
365     // Version 1.
366     WKPageDidDetectXSSForFrameCallback                                  didDetectXSSForFrame;
367
368     void*                                                               didNewFirstVisuallyNonEmptyLayout_unavailable;
369
370     WKPageWillGoToBackForwardListItemCallback                           willGoToBackForwardListItem;
371
372     WKPageLoaderClientCallback                                          interactionOccurredWhileProcessUnresponsive;
373     WKPagePluginDidFailCallback_deprecatedForUseWithV1                  pluginDidFail_deprecatedForUseWithV1;
374
375     // Version 2.
376     void                                                                (*didReceiveIntentForFrame_unavailable)(void);
377     void                                                                (*registerIntentServiceForFrame_unavailable)(void);
378
379     WKPageDidLayoutCallback                                             didLayout;
380     WKPagePluginLoadPolicyCallback_deprecatedForUseWithV2               pluginLoadPolicy_deprecatedForUseWithV2;
381     WKPagePluginDidFailCallback                                         pluginDidFail;
382
383     // Version 3.
384     WKPagePluginLoadPolicyCallback                                      pluginLoadPolicy;
385
386     // Version 4.
387     WKPageWebGLLoadPolicyCallback                                       webGLLoadPolicy;
388     WKPageWebGLLoadPolicyCallback                                       resolveWebGLLoadPolicy;
389
390     // Version 5.
391     WKPageShouldKeepCurrentBackForwardListItemInListCallback            shouldKeepCurrentBackForwardListItemInList;
392 } WKPageLoaderClientV5;
393
394 // FIXME: These should be deprecated.
395 enum { kWKPageLoaderClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 3 };
396 typedef struct WKPageLoaderClient {
397     int                                                                 version;
398     const void *                                                        clientInfo;
399
400     // Version 0.
401     WKPageDidStartProvisionalLoadForFrameCallback                       didStartProvisionalLoadForFrame;
402     WKPageDidReceiveServerRedirectForProvisionalLoadForFrameCallback    didReceiveServerRedirectForProvisionalLoadForFrame;
403     WKPageDidFailProvisionalLoadWithErrorForFrameCallback               didFailProvisionalLoadWithErrorForFrame;
404     WKPageDidCommitLoadForFrameCallback                                 didCommitLoadForFrame;
405     WKPageDidFinishDocumentLoadForFrameCallback                         didFinishDocumentLoadForFrame;
406     WKPageDidFinishLoadForFrameCallback                                 didFinishLoadForFrame;
407     WKPageDidFailLoadWithErrorForFrameCallback                          didFailLoadWithErrorForFrame;
408     WKPageDidSameDocumentNavigationForFrameCallback                     didSameDocumentNavigationForFrame;
409     WKPageDidReceiveTitleForFrameCallback                               didReceiveTitleForFrame;
410     WKPageDidFirstLayoutForFrameCallback                                didFirstLayoutForFrame;
411     WKPageDidFirstVisuallyNonEmptyLayoutForFrameCallback                didFirstVisuallyNonEmptyLayoutForFrame;
412     WKPageDidRemoveFrameFromHierarchyCallback                           didRemoveFrameFromHierarchy;
413     WKPageDidDisplayInsecureContentForFrameCallback                     didDisplayInsecureContentForFrame;
414     WKPageDidRunInsecureContentForFrameCallback                         didRunInsecureContentForFrame;
415     WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback          canAuthenticateAgainstProtectionSpaceInFrame;
416     WKPageDidReceiveAuthenticationChallengeInFrameCallback              didReceiveAuthenticationChallengeInFrame;
417
418     // FIXME: Move to progress client.
419     WKPageLoaderClientCallback                                          didStartProgress;
420     WKPageLoaderClientCallback                                          didChangeProgress;
421     WKPageLoaderClientCallback                                          didFinishProgress;
422
423     // FIXME: These three functions should not be part of this client.
424     WKPageLoaderClientCallback                                          processDidBecomeUnresponsive;
425     WKPageLoaderClientCallback                                          processDidBecomeResponsive;
426     WKPageLoaderClientCallback                                          processDidCrash;
427     WKPageDidChangeBackForwardListCallback                              didChangeBackForwardList;
428     WKPageShouldGoToBackForwardListItemCallback                         shouldGoToBackForwardListItem;
429     WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0      didFailToInitializePlugin_deprecatedForUseWithV0;
430
431     // Version 1.
432     WKPageDidDetectXSSForFrameCallback                                  didDetectXSSForFrame;
433
434     void*                                                               didNewFirstVisuallyNonEmptyLayout_unavailable;
435
436     WKPageWillGoToBackForwardListItemCallback                           willGoToBackForwardListItem;
437
438     WKPageLoaderClientCallback                                          interactionOccurredWhileProcessUnresponsive;
439     WKPagePluginDidFailCallback_deprecatedForUseWithV1                  pluginDidFail_deprecatedForUseWithV1;
440
441     // Version 2.
442     void                                                                (*didReceiveIntentForFrame_unavailable)(void);
443     void                                                                (*registerIntentServiceForFrame_unavailable)(void);
444
445     WKPageDidLayoutCallback                                             didLayout;
446     WKPagePluginLoadPolicyCallback_deprecatedForUseWithV2               pluginLoadPolicy_deprecatedForUseWithV2;
447     WKPagePluginDidFailCallback                                         pluginDidFail;
448
449     // Version 3.
450     WKPagePluginLoadPolicyCallback                                      pluginLoadPolicy;
451 } WKPageLoaderClient;
452
453 #ifdef __cplusplus
454 }
455 #endif
456
457 #endif // WKPageLoaderClient_h