LEFT | RIGHT |
1 /* | 1 /* |
2 * Copyright (C) 2014-2016 Apple Inc. All rights reserved. | 2 * Copyright (C) 2014-2016 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 17 matching lines...) Expand all Loading... |
28 #import "WKFoundation.h" | 28 #import "WKFoundation.h" |
29 | 29 |
30 #if WK_API_ENABLED | 30 #if WK_API_ENABLED |
31 | 31 |
32 #import "APIHistoryClient.h" | 32 #import "APIHistoryClient.h" |
33 #import "APINavigationClient.h" | 33 #import "APINavigationClient.h" |
34 #import "PageLoadState.h" | 34 #import "PageLoadState.h" |
35 #import "ProcessTerminationReason.h" | 35 #import "ProcessTerminationReason.h" |
36 #import "ProcessThrottler.h" | 36 #import "ProcessThrottler.h" |
37 #import "WKNavigationDelegatePrivate.h" | 37 #import "WKNavigationDelegatePrivate.h" |
38 #import "WeakObjCPtr.h" | |
39 #import <wtf/RetainPtr.h> | 38 #import <wtf/RetainPtr.h> |
40 #import <wtf/RunLoop.h> | 39 #import <wtf/RunLoop.h> |
| 40 #import <wtf/WeakObjCPtr.h> |
41 | 41 |
42 @class WKWebView; | 42 @class WKWebView; |
43 @protocol WKHistoryDelegatePrivate; | 43 @protocol WKHistoryDelegatePrivate; |
44 @protocol WKNavigationDelegate; | 44 @protocol WKNavigationDelegate; |
45 | 45 |
46 namespace API { | 46 namespace API { |
47 class Navigation; | 47 class Navigation; |
48 } | 48 } |
49 | 49 |
50 namespace WebCore { | 50 namespace WebCore { |
(...skipping 25 matching lines...) Expand all Loading... |
76 void navigationGestureDidBegin(); | 76 void navigationGestureDidBegin(); |
77 void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&); | 77 void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&); |
78 void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&); | 78 void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&); |
79 void willRecordNavigationSnapshot(WebBackForwardListItem&); | 79 void willRecordNavigationSnapshot(WebBackForwardListItem&); |
80 void navigationGestureSnapshotWasRemoved(); | 80 void navigationGestureSnapshotWasRemoved(); |
81 #if USE(QUICK_LOOK) | 81 #if USE(QUICK_LOOK) |
82 void didRequestPasswordForQuickLookDocument(); | 82 void didRequestPasswordForQuickLookDocument(); |
83 #endif | 83 #endif |
84 | 84 |
85 void didFirstPaint(); | 85 void didFirstPaint(); |
| 86 |
| 87 #if PLATFORM(IOS) |
| 88 enum class NetworkActivityTokenReleaseReason { LoadCompleted, ScreenLocked }
; |
| 89 void releaseNetworkActivityToken(NetworkActivityTokenReleaseReason); |
| 90 #endif |
86 | 91 |
87 private: | 92 private: |
88 class NavigationClient final : public API::NavigationClient { | 93 class NavigationClient final : public API::NavigationClient { |
89 public: | 94 public: |
90 explicit NavigationClient(NavigationState&); | 95 explicit NavigationClient(NavigationState&); |
91 ~NavigationClient(); | 96 ~NavigationClient(); |
92 | 97 |
93 private: | 98 private: |
94 void didStartProvisionalNavigation(WebPageProxy&, API::Navigation*, API:
:Object*) override; | 99 void didStartProvisionalNavigation(WebPageProxy&, API::Navigation*, API:
:Object*) override; |
95 void didReceiveServerRedirectForProvisionalNavigation(WebPageProxy&, API
::Navigation*, API::Object*) override; | 100 void didReceiveServerRedirectForProvisionalNavigation(WebPageProxy&, API
::Navigation*, API::Object*) override; |
96 void willPerformClientRedirect(WebPageProxy&, const WTF::String&, double
) override; | 101 void willPerformClientRedirect(WebPageProxy&, const WTF::String&, double
) override; |
97 void didCancelClientRedirect(WebPageProxy&) override; | 102 void didCancelClientRedirect(WebPageProxy&) override; |
98 void didFailProvisionalNavigationWithError(WebPageProxy&, WebFrameProxy&
, API::Navigation*, const WebCore::ResourceError&, API::Object*) override; | 103 void didFailProvisionalNavigationWithError(WebPageProxy&, WebFrameProxy&
, API::Navigation*, const WebCore::ResourceError&, API::Object*) override; |
99 void didFailProvisionalLoadInSubframeWithError(WebPageProxy&, WebFramePr
oxy&, const WebCore::SecurityOriginData&, API::Navigation*, const WebCore::Resou
rceError&, API::Object*) override; | 104 void didFailProvisionalLoadInSubframeWithError(WebPageProxy&, WebFramePr
oxy&, const WebCore::SecurityOriginData&, API::Navigation*, const WebCore::Resou
rceError&, API::Object*) override; |
100 void didCommitNavigation(WebPageProxy&, API::Navigation*, API::Object*)
override; | 105 void didCommitNavigation(WebPageProxy&, API::Navigation*, API::Object*)
override; |
101 void didFinishDocumentLoad(WebPageProxy&, API::Navigation*, API::Object*
) override; | 106 void didFinishDocumentLoad(WebPageProxy&, API::Navigation*, API::Object*
) override; |
102 void didFinishNavigation(WebPageProxy&, API::Navigation*, API::Object*)
override; | 107 void didFinishNavigation(WebPageProxy&, API::Navigation*, API::Object*)
override; |
103 void didFailNavigationWithError(WebPageProxy&, WebFrameProxy&, API::Navi
gation*, const WebCore::ResourceError&, API::Object*) override; | 108 void didFailNavigationWithError(WebPageProxy&, WebFrameProxy&, API::Navi
gation*, const WebCore::ResourceError&, API::Object*) override; |
104 void didSameDocumentNavigation(WebPageProxy&, API::Navigation*, SameDocu
mentNavigationType, API::Object*) override; | 109 void didSameDocumentNavigation(WebPageProxy&, API::Navigation*, SameDocu
mentNavigationType, API::Object*) override; |
105 | 110 |
106 void renderingProgressDidChange(WebPageProxy&, WebCore::LayoutMilestones
) override; | 111 void renderingProgressDidChange(WebPageProxy&, WebCore::LayoutMilestones
) override; |
107 | 112 |
108 bool canAuthenticateAgainstProtectionSpace(WebPageProxy&, WebProtectionS
pace*) override; | 113 bool canAuthenticateAgainstProtectionSpace(WebPageProxy&, WebProtectionS
pace*) override; |
109 void didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChal
lengeProxy&) override; | 114 void didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChal
lengeProxy&) override; |
110 void processDidTerminate(WebPageProxy&, ProcessTerminationReason) overri
de; | 115 bool processDidTerminate(WebPageProxy&, ProcessTerminationReason) overri
de; |
111 void processDidBecomeResponsive(WebPageProxy&) override; | 116 void processDidBecomeResponsive(WebPageProxy&) override; |
112 void processDidBecomeUnresponsive(WebPageProxy&) override; | 117 void processDidBecomeUnresponsive(WebPageProxy&) override; |
113 | 118 |
114 RefPtr<API::Data> webCryptoMasterKey(WebPageProxy&) override; | 119 RefPtr<API::Data> webCryptoMasterKey(WebPageProxy&) override; |
| 120 |
| 121 RefPtr<API::String> signedPublicKeyAndChallengeString(WebPageProxy&, uns
igned keySizeIndex, const RefPtr<API::String>& challengeString, const WebCore::U
RL&) override; |
115 | 122 |
116 #if USE(QUICK_LOOK) | 123 #if USE(QUICK_LOOK) |
117 void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String& file
Name, const WTF::String& uti) override; | 124 void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String& file
Name, const WTF::String& uti) override; |
118 void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumen
tData&) override; | 125 void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumen
tData&) override; |
119 #endif | 126 #endif |
120 | 127 |
121 #if PLATFORM(MAC) | 128 #if PLATFORM(MAC) |
122 void webGLLoadPolicy(WebPageProxy&, const WebCore::URL&, WTF::Function<v
oid(WebCore::WebGLLoadPolicy)>&& completionHandler) const final; | 129 void webGLLoadPolicy(WebPageProxy&, const WebCore::URL&, WTF::Function<v
oid(WebCore::WebGLLoadPolicy)>&& completionHandler) const final; |
123 void resolveWebGLLoadPolicy(WebPageProxy&, const WebCore::URL&, WTF::Fun
ction<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const final; | 130 void resolveWebGLLoadPolicy(WebPageProxy&, const WebCore::URL&, WTF::Fun
ction<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const final; |
124 bool willGoToBackForwardListItem(WebPageProxy&, WebBackForwardListItem&,
bool inPageCache, API::Object*) final; | 131 bool willGoToBackForwardListItem(WebPageProxy&, WebBackForwardListItem&,
bool inPageCache, API::Object*) final; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 void willChangeCanGoForward() override; | 174 void willChangeCanGoForward() override; |
168 void didChangeCanGoForward() override; | 175 void didChangeCanGoForward() override; |
169 void willChangeNetworkRequestsInProgress() override; | 176 void willChangeNetworkRequestsInProgress() override; |
170 void didChangeNetworkRequestsInProgress() override; | 177 void didChangeNetworkRequestsInProgress() override; |
171 void willChangeCertificateInfo() override; | 178 void willChangeCertificateInfo() override; |
172 void didChangeCertificateInfo() override; | 179 void didChangeCertificateInfo() override; |
173 void willChangeWebProcessIsResponsive() override; | 180 void willChangeWebProcessIsResponsive() override; |
174 void didChangeWebProcessIsResponsive() override; | 181 void didChangeWebProcessIsResponsive() override; |
175 | 182 |
176 #if PLATFORM(IOS) | 183 #if PLATFORM(IOS) |
177 void releaseNetworkActivityToken(); | 184 void releaseNetworkActivityTokenAfterLoadCompletion() { releaseNetworkActivi
tyToken(NetworkActivityTokenReleaseReason::LoadCompleted); } |
178 #endif | 185 #endif |
179 | 186 |
180 WKWebView *m_webView; | 187 WKWebView *m_webView; |
181 WeakObjCPtr<id <WKNavigationDelegate> > m_navigationDelegate; | 188 WeakObjCPtr<id <WKNavigationDelegate> > m_navigationDelegate; |
182 std::unique_ptr<SafeBrowsingController> m_safeBrowsingController; | 189 std::unique_ptr<SafeBrowsingController> m_safeBrowsingController; |
183 | 190 |
184 struct { | 191 struct { |
185 bool webViewDecidePolicyForNavigationActionDecisionHandler : 1; | 192 bool webViewDecidePolicyForNavigationActionDecisionHandler : 1; |
186 bool webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicie
s : 1; | 193 bool webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicie
s : 1; |
187 bool webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsit
ePolicies : 1; | 194 bool webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsit
ePolicies : 1; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 251 |
245 #if PLATFORM(IOS) | 252 #if PLATFORM(IOS) |
246 ProcessThrottler::BackgroundActivityToken m_activityToken; | 253 ProcessThrottler::BackgroundActivityToken m_activityToken; |
247 RunLoop::Timer<NavigationState> m_releaseActivityTimer; | 254 RunLoop::Timer<NavigationState> m_releaseActivityTimer; |
248 #endif | 255 #endif |
249 }; | 256 }; |
250 | 257 |
251 } // namespace WebKit | 258 } // namespace WebKit |
252 | 259 |
253 #endif | 260 #endif |
LEFT | RIGHT |