OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 | 27 |
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 <wtf/RetainPtr.h> | 38 #import <wtf/RetainPtr.h> |
38 #import <wtf/RunLoop.h> | 39 #import <wtf/RunLoop.h> |
39 #import <wtf/WeakObjCPtr.h> | 40 #import <wtf/WeakObjCPtr.h> |
40 | 41 |
41 @class WKWebView; | 42 @class WKWebView; |
42 @protocol WKHistoryDelegatePrivate; | 43 @protocol WKHistoryDelegatePrivate; |
43 @protocol WKNavigationDelegate; | 44 @protocol WKNavigationDelegate; |
44 | 45 |
45 namespace API { | 46 namespace API { |
46 class Navigation; | 47 class Navigation; |
47 } | 48 } |
48 | 49 |
49 namespace WebCore { | 50 namespace WebCore { |
50 struct SecurityOriginData; | 51 struct SecurityOriginData; |
51 } | 52 } |
52 | 53 |
53 namespace WebKit { | 54 namespace WebKit { |
54 | 55 |
| 56 class SafeBrowsingController; |
55 struct WebNavigationDataStore; | 57 struct WebNavigationDataStore; |
56 | 58 |
57 class NavigationState final : private PageLoadState::Observer { | 59 class NavigationState final : private PageLoadState::Observer { |
58 public: | 60 public: |
59 explicit NavigationState(WKWebView *); | 61 explicit NavigationState(WKWebView *); |
60 ~NavigationState(); | 62 ~NavigationState(); |
61 | 63 |
62 static NavigationState& fromWebPage(WebPageProxy&); | 64 static NavigationState& fromWebPage(WebPageProxy&); |
63 | 65 |
64 std::unique_ptr<API::NavigationClient> createNavigationClient(); | 66 std::unique_ptr<API::NavigationClient> createNavigationClient(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 bool didFailToInitializePlugIn(WebPageProxy&, API::Dictionary&) final; | 132 bool didFailToInitializePlugIn(WebPageProxy&, API::Dictionary&) final; |
131 bool didBlockInsecurePluginVersion(WebPageProxy&, API::Dictionary&) fina
l; | 133 bool didBlockInsecurePluginVersion(WebPageProxy&, API::Dictionary&) fina
l; |
132 WebKit::PluginModuleLoadPolicy decidePolicyForPluginLoad(WebKit::WebPage
Proxy&, WebKit::PluginModuleLoadPolicy, API::Dictionary&, WTF::String&) final; | 134 WebKit::PluginModuleLoadPolicy decidePolicyForPluginLoad(WebKit::WebPage
Proxy&, WebKit::PluginModuleLoadPolicy, API::Dictionary&, WTF::String&) final; |
133 bool didChangeBackForwardList(WebPageProxy&, WebBackForwardListItem*, co
nst Vector<Ref<WebBackForwardListItem>>&) final; | 135 bool didChangeBackForwardList(WebPageProxy&, WebBackForwardListItem*, co
nst Vector<Ref<WebBackForwardListItem>>&) final; |
134 #endif | 136 #endif |
135 | 137 |
136 void contentRuleListNotification(WebPageProxy&, WebCore::URL&&, Vector<S
tring>&&, Vector<String>&&) final; | 138 void contentRuleListNotification(WebPageProxy&, WebCore::URL&&, Vector<S
tring>&&, Vector<String>&&) final; |
137 void decidePolicyForNavigationAction(WebPageProxy&, Ref<API::NavigationA
ction>&&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override; | 139 void decidePolicyForNavigationAction(WebPageProxy&, Ref<API::NavigationA
ction>&&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override; |
138 void decidePolicyForNavigationResponse(WebPageProxy&, Ref<API::Navigatio
nResponse>&&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) overrid
e; | 140 void decidePolicyForNavigationResponse(WebPageProxy&, Ref<API::Navigatio
nResponse>&&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) overrid
e; |
139 | 141 |
| 142 void decidePolicyForNavigationActionInternal(WebPageProxy&, Ref<API::Nav
igationAction>&&, WTF::Function<void(WKNavigationActionPolicy, std::optional<Web
sitePoliciesData>&&)>&& completionHandler, API::Object* userData); |
| 143 |
140 NavigationState& m_navigationState; | 144 NavigationState& m_navigationState; |
141 }; | 145 }; |
142 ···· | 146 ···· |
143 class HistoryClient final : public API::HistoryClient { | 147 class HistoryClient final : public API::HistoryClient { |
144 public: | 148 public: |
145 explicit HistoryClient(NavigationState&); | 149 explicit HistoryClient(NavigationState&); |
146 ~HistoryClient(); | 150 ~HistoryClient(); |
147 ········ | 151 ········ |
148 private: | 152 private: |
149 void didNavigateWithNavigationData(WebPageProxy&, const WebNavigationDat
aStore&) override; | 153 void didNavigateWithNavigationData(WebPageProxy&, const WebNavigationDat
aStore&) override; |
(...skipping 25 matching lines...) Expand all Loading... |
175 void didChangeCertificateInfo() override; | 179 void didChangeCertificateInfo() override; |
176 void willChangeWebProcessIsResponsive() override; | 180 void willChangeWebProcessIsResponsive() override; |
177 void didChangeWebProcessIsResponsive() override; | 181 void didChangeWebProcessIsResponsive() override; |
178 | 182 |
179 #if PLATFORM(IOS) | 183 #if PLATFORM(IOS) |
180 void releaseNetworkActivityTokenAfterLoadCompletion() { releaseNetworkActivi
tyToken(NetworkActivityTokenReleaseReason::LoadCompleted); } | 184 void releaseNetworkActivityTokenAfterLoadCompletion() { releaseNetworkActivi
tyToken(NetworkActivityTokenReleaseReason::LoadCompleted); } |
181 #endif | 185 #endif |
182 | 186 |
183 WKWebView *m_webView; | 187 WKWebView *m_webView; |
184 WeakObjCPtr<id <WKNavigationDelegate> > m_navigationDelegate; | 188 WeakObjCPtr<id <WKNavigationDelegate> > m_navigationDelegate; |
| 189 std::unique_ptr<SafeBrowsingController> m_safeBrowsingController; |
185 | 190 |
186 struct { | 191 struct { |
187 bool webViewDecidePolicyForNavigationActionDecisionHandler : 1; | 192 bool webViewDecidePolicyForNavigationActionDecisionHandler : 1; |
188 bool webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicie
s : 1; | 193 bool webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicie
s : 1; |
189 bool webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsit
ePolicies : 1; | 194 bool webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsit
ePolicies : 1; |
190 bool webViewDecidePolicyForNavigationResponseDecisionHandler : 1; | 195 bool webViewDecidePolicyForNavigationResponseDecisionHandler : 1; |
191 | 196 |
192 bool webViewDidStartProvisionalNavigation : 1; | 197 bool webViewDidStartProvisionalNavigation : 1; |
193 bool webViewDidStartProvisionalNavigationUserInfo : 1; | 198 bool webViewDidStartProvisionalNavigationUserInfo : 1; |
194 bool webViewDidReceiveServerRedirectForProvisionalNavigation : 1; | 199 bool webViewDidReceiveServerRedirectForProvisionalNavigation : 1; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 251 |
247 #if PLATFORM(IOS) | 252 #if PLATFORM(IOS) |
248 ProcessThrottler::BackgroundActivityToken m_activityToken; | 253 ProcessThrottler::BackgroundActivityToken m_activityToken; |
249 RunLoop::Timer<NavigationState> m_releaseActivityTimer; | 254 RunLoop::Timer<NavigationState> m_releaseActivityTimer; |
250 #endif | 255 #endif |
251 }; | 256 }; |
252 | 257 |
253 } // namespace WebKit | 258 } // namespace WebKit |
254 | 259 |
255 #endif | 260 #endif |
OLD | NEW |