Changeset 235398 in webkit
- Timestamp:
- Aug 27, 2018 2:00:25 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r235397 r235398 1 2018-08-27 Alex Christensen <achristensen@webkit.org> 2 3 Remove most of LoaderClient 4 https://bugs.webkit.org/show_bug.cgi?id=188997 5 6 Reviewed by Tim Horton. 7 8 We still have a few clients using basic functionality that are transitioning to WKPageNavigationClient, 9 but most of it can be removed. 10 11 * UIProcess/API/APILoaderClient.h: 12 (API::LoaderClient::~LoaderClient): 13 (API::LoaderClient::didFailProvisionalLoadWithErrorForFrame): 14 (API::LoaderClient::didFailLoadWithErrorForFrame): 15 (API::LoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): 16 (API::LoaderClient::didReachLayoutMilestone): 17 (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList): 18 (API::LoaderClient::didCommitLoadForFrame): Deleted. 19 (API::LoaderClient::didFinishDocumentLoadForFrame): Deleted. 20 (API::LoaderClient::didSameDocumentNavigationForFrame): Deleted. 21 (API::LoaderClient::didReceiveTitleForFrame): Deleted. 22 (API::LoaderClient::didFirstLayoutForFrame): Deleted. 23 (API::LoaderClient::didDisplayInsecureContentForFrame): Deleted. 24 (API::LoaderClient::didRunInsecureContentForFrame): Deleted. 25 (API::LoaderClient::didDetectXSSForFrame): Deleted. 26 (API::LoaderClient::didReceiveAuthenticationChallengeInFrame): Deleted. 27 (API::LoaderClient::didStartProgress): Deleted. 28 (API::LoaderClient::didChangeProgress): Deleted. 29 (API::LoaderClient::didFinishProgress): Deleted. 30 (API::LoaderClient::processDidBecomeUnresponsive): Deleted. 31 (API::LoaderClient::processDidBecomeResponsive): Deleted. 32 (API::LoaderClient::processDidCrash): Deleted. 33 (API::LoaderClient::didChangeBackForwardList): Deleted. 34 (API::LoaderClient::willGoToBackForwardListItem): Deleted. 35 (API::LoaderClient::didNavigateWithNavigationData): Deleted. 36 (API::LoaderClient::didPerformClientRedirect): Deleted. 37 (API::LoaderClient::didPerformServerRedirect): Deleted. 38 (API::LoaderClient::didUpdateHistoryTitle): Deleted. 39 (API::LoaderClient::navigationGestureDidBegin): Deleted. 40 (API::LoaderClient::navigationGestureWillEnd): Deleted. 41 (API::LoaderClient::navigationGestureDidEnd): Deleted. 42 (API::LoaderClient::pluginLoadPolicy): Deleted. 43 (API::LoaderClient::didFailToInitializePlugin): Deleted. 44 (API::LoaderClient::didBlockInsecurePluginVersion): Deleted. 45 (API::LoaderClient::webGLLoadPolicy const): Deleted. 46 (API::LoaderClient::resolveWebGLLoadPolicy const): Deleted. 47 (API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame): Deleted. 48 (API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame): Deleted. 49 * UIProcess/API/C/WKPage.cpp: 50 (WKPageSetPageLoaderClient): 51 * UIProcess/WebPageProxy.cpp: 52 (WebKit::WebPageProxy::didChangeBackForwardList): 53 (WebKit::WebPageProxy::willGoToBackForwardListItem): 54 (WebKit::WebPageProxy::didStartProgress): 55 (WebKit::WebPageProxy::didChangeProgress): 56 (WebKit::WebPageProxy::didFinishProgress): 57 (WebKit::WebPageProxy::didCommitLoadForFrame): 58 (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): 59 (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): 60 (WebKit::WebPageProxy::didReceiveTitleForFrame): 61 (WebKit::WebPageProxy::didFirstLayoutForFrame): 62 (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): 63 (WebKit::WebPageProxy::didRunInsecureContentForFrame): 64 (WebKit::WebPageProxy::didDetectXSSForFrame): 65 (WebKit::WebPageProxy::didNavigateWithNavigationData): 66 (WebKit::WebPageProxy::didPerformClientRedirect): 67 (WebKit::WebPageProxy::didPerformServerRedirect): 68 (WebKit::WebPageProxy::didUpdateHistoryTitle): 69 (WebKit::WebPageProxy::webGLPolicyForURL): 70 (WebKit::WebPageProxy::resolveWebGLPolicyForURL): 71 (WebKit::WebPageProxy::processDidBecomeUnresponsive): 72 (WebKit::WebPageProxy::processDidBecomeResponsive): 73 (WebKit::WebPageProxy::dispatchProcessDidTerminate): 74 (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy): 75 (WebKit::WebPageProxy::navigationGestureDidBegin): 76 (WebKit::WebPageProxy::navigationGestureWillEnd): 77 (WebKit::WebPageProxy::navigationGestureDidEnd): 78 * UIProcess/ios/WebPageProxyIOS.mm: 79 (WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame): 80 (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame): 81 1 82 2018-08-27 Alex Christensen <achristensen@webkit.org> 2 83 -
trunk/Source/WebKit/UIProcess/API/APILoaderClient.h
r235364 r235398 24 24 */ 25 25 26 #ifndef APILoaderClient_h 27 #define APILoaderClient_h 26 #pragma once 28 27 29 28 #include "APIData.h" … … 57 56 public: 58 57 virtual ~LoaderClient() { } 59 60 58 virtual void didStartProvisionalLoadForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, API::Object*) { } 61 59 virtual void didReceiveServerRedirectForProvisionalLoadForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, API::Object*) { } 62 60 virtual void didFailProvisionalLoadWithErrorForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) { } 63 virtual void didCommitLoadForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, API::Object*) { }64 virtual void didFinishDocumentLoadForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, API::Object*) { }65 61 virtual void didFinishLoadForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, API::Object*) { } 66 62 virtual void didFailLoadWithErrorForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) { } 67 virtual void didSameDocumentNavigationForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, WebKit::SameDocumentNavigationType, API::Object*) { }68 virtual void didReceiveTitleForFrame(WebKit::WebPageProxy&, const WTF::String&, WebKit::WebFrameProxy&, API::Object*) { }69 virtual void didFirstLayoutForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Object*) { }70 71 // FIXME: We should consider removing didFirstVisuallyNonEmptyLayoutForFrame since it is replaced by didLayout.72 63 virtual void didFirstVisuallyNonEmptyLayoutForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Object*) { } 73 74 virtual void didDisplayInsecureContentForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Object*) { }75 virtual void didRunInsecureContentForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Object*) { }76 virtual void didDetectXSSForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Object*) { }77 78 64 virtual void didReachLayoutMilestone(WebKit::WebPageProxy&, WebCore::LayoutMilestones) { } 79 virtual void didReceiveAuthenticationChallengeInFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, WebKit::AuthenticationChallengeProxy&) { }80 81 virtual void didStartProgress(WebKit::WebPageProxy&) { }82 virtual void didChangeProgress(WebKit::WebPageProxy&) { }83 virtual void didFinishProgress(WebKit::WebPageProxy&) { }84 85 // FIXME: These functions should not be part of this client.86 virtual void processDidBecomeUnresponsive(WebKit::WebPageProxy&) { }87 virtual void processDidBecomeResponsive(WebKit::WebPageProxy&) { }88 virtual bool processDidCrash(WebKit::WebPageProxy&) { return false; }89 90 virtual void didChangeBackForwardList(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem*, Vector<Ref<WebKit::WebBackForwardListItem>>&&) { }91 65 virtual bool shouldKeepCurrentBackForwardListItemInList(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem&) { return true; } 92 virtual void willGoToBackForwardListItem(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem&, API::Object*) { }93 94 virtual void didNavigateWithNavigationData(WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore&, WebKit::WebFrameProxy&) { }95 virtual void didPerformClientRedirect(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }96 virtual void didPerformServerRedirect(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }97 virtual void didUpdateHistoryTitle(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }98 99 virtual void navigationGestureDidBegin(WebKit::WebPageProxy&) { }100 virtual void navigationGestureWillEnd(WebKit::WebPageProxy&, bool willNavigate, WebKit::WebBackForwardListItem&) { }101 virtual void navigationGestureDidEnd(WebKit::WebPageProxy&, bool willNavigate, WebKit::WebBackForwardListItem&) { }102 103 #if ENABLE(NETSCAPE_PLUGIN_API)104 virtual void pluginLoadPolicy(WebKit::WebPageProxy&, WebKit::PluginModuleLoadPolicy currentPluginLoadPolicy, API::Dictionary&, CompletionHandler<void(WebKit::PluginModuleLoadPolicy, const WTF::String&)>&& completionHandler) { completionHandler(currentPluginLoadPolicy, { }); }105 virtual void didFailToInitializePlugin(WebKit::WebPageProxy&, API::Dictionary&) { }106 virtual void didBlockInsecurePluginVersion(WebKit::WebPageProxy&, API::Dictionary&) { }107 #endif // ENABLE(NETSCAPE_PLUGIN_API)108 109 #if ENABLE(WEBGL)110 virtual WebCore::WebGLLoadPolicy webGLLoadPolicy(WebKit::WebPageProxy&, const WTF::String&) const { return WebCore::WebGLLoadPolicy::WebGLAllowCreation; }111 virtual WebCore::WebGLLoadPolicy resolveWebGLLoadPolicy(WebKit::WebPageProxy&, const WTF::String&) const { return WebCore::WebGLLoadPolicy::WebGLAllowCreation; }112 #endif // ENABLE(WEBGL)113 114 #if USE(QUICK_LOOK)115 virtual void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String& fileName, const WTF::String& uti) { }116 virtual void didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData&) { }117 #endif118 66 }; 119 67 120 68 } // namespace API 121 122 #endif // APILoaderClient_h -
trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp
r235397 r235398 1043 1043 { 1044 1044 initialize(client); 1045 1046 // WKPageSetPageLoaderClient is deprecated. Use WKPageSetPageNavigationClient instead. 1047 RELEASE_ASSERT(!m_client.didCommitLoadForFrame); 1048 RELEASE_ASSERT(!m_client.didFinishDocumentLoadForFrame); 1049 RELEASE_ASSERT(!m_client.didSameDocumentNavigationForFrame); 1050 RELEASE_ASSERT(!m_client.didReceiveTitleForFrame); 1051 RELEASE_ASSERT(!m_client.didFirstLayoutForFrame); 1052 RELEASE_ASSERT(!m_client.didRemoveFrameFromHierarchy); 1053 RELEASE_ASSERT(!m_client.didDisplayInsecureContentForFrame); 1054 RELEASE_ASSERT(!m_client.didRunInsecureContentForFrame); 1055 RELEASE_ASSERT(!m_client.canAuthenticateAgainstProtectionSpaceInFrame); 1056 RELEASE_ASSERT(!m_client.didReceiveAuthenticationChallengeInFrame); 1057 RELEASE_ASSERT(!m_client.didStartProgress); 1058 RELEASE_ASSERT(!m_client.didChangeProgress); 1059 RELEASE_ASSERT(!m_client.didFinishProgress); 1060 RELEASE_ASSERT(!m_client.processDidBecomeUnresponsive); 1061 RELEASE_ASSERT(!m_client.processDidBecomeResponsive); 1062 RELEASE_ASSERT(!m_client.processDidCrash); 1063 RELEASE_ASSERT(!m_client.didChangeBackForwardList); 1064 RELEASE_ASSERT(!m_client.shouldGoToBackForwardListItem); 1065 RELEASE_ASSERT(!m_client.didFailToInitializePlugin_deprecatedForUseWithV0); 1066 RELEASE_ASSERT(!m_client.didDetectXSSForFrame); 1067 RELEASE_ASSERT(!m_client.didNewFirstVisuallyNonEmptyLayout_unavailable); 1068 RELEASE_ASSERT(!m_client.willGoToBackForwardListItem); 1069 RELEASE_ASSERT(!m_client.interactionOccurredWhileProcessUnresponsive); 1070 RELEASE_ASSERT(!m_client.pluginDidFail_deprecatedForUseWithV1); 1071 RELEASE_ASSERT(!m_client.didReceiveIntentForFrame_unavailable); 1072 RELEASE_ASSERT(!m_client.registerIntentServiceForFrame_unavailable); 1073 RELEASE_ASSERT(!m_client.pluginLoadPolicy_deprecatedForUseWithV2); 1074 RELEASE_ASSERT(!m_client.pluginDidFail); 1075 RELEASE_ASSERT(!m_client.pluginLoadPolicy); 1076 RELEASE_ASSERT(!m_client.webGLLoadPolicy); 1077 RELEASE_ASSERT(!m_client.resolveWebGLLoadPolicy); 1078 RELEASE_ASSERT(!m_client.navigationGestureDidBegin); 1079 RELEASE_ASSERT(!m_client.navigationGestureWillEnd); 1080 RELEASE_ASSERT(!m_client.navigationGestureDidEnd); 1045 1081 } 1046 1082 … … 1070 1106 } 1071 1107 1072 void didCommitLoadForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, API::Object* userData) override1073 {1074 if (!m_client.didCommitLoadForFrame)1075 return;1076 1077 m_client.didCommitLoadForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);1078 }1079 1080 void didFinishDocumentLoadForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, API::Object* userData) override1081 {1082 if (!m_client.didFinishDocumentLoadForFrame)1083 return;1084 1085 m_client.didFinishDocumentLoadForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);1086 }1087 1088 1108 void didFinishLoadForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, API::Object* userData) override 1089 1109 { … … 1102 1122 } 1103 1123 1104 void didSameDocumentNavigationForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, SameDocumentNavigationType type, API::Object* userData) override1105 {1106 if (!m_client.didSameDocumentNavigationForFrame)1107 return;1108 1109 m_client.didSameDocumentNavigationForFrame(toAPI(&page), toAPI(&frame), toAPI(type), toAPI(userData), m_client.base.clientInfo);1110 }1111 1112 void didReceiveTitleForFrame(WebPageProxy& page, const String& title, WebFrameProxy& frame, API::Object* userData) override1113 {1114 if (!m_client.didReceiveTitleForFrame)1115 return;1116 1117 m_client.didReceiveTitleForFrame(toAPI(&page), toAPI(title.impl()), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);1118 }1119 1120 void didFirstLayoutForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override1121 {1122 if (!m_client.didFirstLayoutForFrame)1123 return;1124 1125 m_client.didFirstLayoutForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);1126 }1127 1128 1124 void didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override 1129 1125 { … … 1140 1136 1141 1137 m_client.didLayout(toAPI(&page), toWKLayoutMilestones(milestones), nullptr, m_client.base.clientInfo); 1142 }1143 1144 void didDisplayInsecureContentForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override1145 {1146 if (!m_client.didDisplayInsecureContentForFrame)1147 return;1148 1149 m_client.didDisplayInsecureContentForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);1150 }1151 1152 void didRunInsecureContentForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override1153 {1154 if (!m_client.didRunInsecureContentForFrame)1155 return;1156 1157 m_client.didRunInsecureContentForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);1158 }1159 1160 void didDetectXSSForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override1161 {1162 if (!m_client.didDetectXSSForFrame)1163 return;1164 1165 m_client.didDetectXSSForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);1166 }1167 1168 void didReceiveAuthenticationChallengeInFrame(WebPageProxy& page, WebFrameProxy& frame, AuthenticationChallengeProxy& authenticationChallenge) override1169 {1170 if (m_client.canAuthenticateAgainstProtectionSpaceInFrame && !m_client.canAuthenticateAgainstProtectionSpaceInFrame(toAPI(&page), toAPI(&frame), toAPI(authenticationChallenge.protectionSpace()), m_client.base.clientInfo))1171 return authenticationChallenge.rejectProtectionSpaceAndContinue();1172 if (!m_client.didReceiveAuthenticationChallengeInFrame)1173 return authenticationChallenge.performDefaultHandling();1174 1175 m_client.didReceiveAuthenticationChallengeInFrame(toAPI(&page), toAPI(&frame), toAPI(&authenticationChallenge), m_client.base.clientInfo);1176 }1177 1178 void didStartProgress(WebPageProxy& page) override1179 {1180 if (!m_client.didStartProgress)1181 return;1182 1183 m_client.didStartProgress(toAPI(&page), m_client.base.clientInfo);1184 }1185 1186 void didChangeProgress(WebPageProxy& page) override1187 {1188 if (!m_client.didChangeProgress)1189 return;1190 1191 m_client.didChangeProgress(toAPI(&page), m_client.base.clientInfo);1192 }1193 1194 void didFinishProgress(WebPageProxy& page) override1195 {1196 if (!m_client.didFinishProgress)1197 return;1198 1199 m_client.didFinishProgress(toAPI(&page), m_client.base.clientInfo);1200 }1201 1202 void processDidBecomeUnresponsive(WebPageProxy& page) override1203 {1204 if (!m_client.processDidBecomeUnresponsive)1205 return;1206 1207 m_client.processDidBecomeUnresponsive(toAPI(&page), m_client.base.clientInfo);1208 }1209 1210 void processDidBecomeResponsive(WebPageProxy& page) override1211 {1212 if (!m_client.processDidBecomeResponsive)1213 return;1214 1215 m_client.processDidBecomeResponsive(toAPI(&page), m_client.base.clientInfo);1216 }1217 1218 bool processDidCrash(WebPageProxy& page) override1219 {1220 if (!m_client.processDidCrash)1221 return false;1222 1223 m_client.processDidCrash(toAPI(&page), m_client.base.clientInfo);1224 return true;1225 }1226 1227 void didChangeBackForwardList(WebPageProxy& page, WebBackForwardListItem* addedItem, Vector<Ref<WebBackForwardListItem>>&& removedItems) override1228 {1229 if (!m_client.didChangeBackForwardList)1230 return;1231 1232 RefPtr<API::Array> removedItemsArray;1233 if (!removedItems.isEmpty()) {1234 Vector<RefPtr<API::Object>> removedItemsVector;1235 removedItemsVector.reserveInitialCapacity(removedItems.size());1236 for (auto& removedItem : removedItems)1237 removedItemsVector.append(WTFMove(removedItem));1238 1239 removedItemsArray = API::Array::create(WTFMove(removedItemsVector));1240 }1241 1242 m_client.didChangeBackForwardList(toAPI(&page), toAPI(addedItem), toAPI(removedItemsArray.get()), m_client.base.clientInfo);1243 1138 } 1244 1139 … … 1250 1145 return m_client.shouldKeepCurrentBackForwardListItemInList(toAPI(&page), toAPI(&item), m_client.base.clientInfo); 1251 1146 } 1252 1253 void willGoToBackForwardListItem(WebPageProxy& page, WebBackForwardListItem& item, API::Object* userData) override1254 {1255 if (m_client.willGoToBackForwardListItem)1256 m_client.willGoToBackForwardListItem(toAPI(&page), toAPI(&item), toAPI(userData), m_client.base.clientInfo);1257 }1258 1259 void navigationGestureDidBegin(WebPageProxy& page) override1260 {1261 if (m_client.navigationGestureDidBegin)1262 m_client.navigationGestureDidBegin(toAPI(&page), m_client.base.clientInfo);1263 }1264 1265 void navigationGestureWillEnd(WebPageProxy& page, bool willNavigate, WebBackForwardListItem& item) override1266 {1267 if (m_client.navigationGestureWillEnd)1268 m_client.navigationGestureWillEnd(toAPI(&page), willNavigate, toAPI(&item), m_client.base.clientInfo);1269 }1270 1271 void navigationGestureDidEnd(WebPageProxy& page, bool willNavigate, WebBackForwardListItem& item) override1272 {1273 if (m_client.navigationGestureDidEnd)1274 m_client.navigationGestureDidEnd(toAPI(&page), willNavigate, toAPI(&item), m_client.base.clientInfo);1275 }1276 1277 #if ENABLE(NETSCAPE_PLUGIN_API)1278 void didFailToInitializePlugin(WebPageProxy& page, API::Dictionary& pluginInformation) final1279 {1280 if (m_client.didFailToInitializePlugin_deprecatedForUseWithV0)1281 m_client.didFailToInitializePlugin_deprecatedForUseWithV0(toAPI(&page), toAPI(pluginInformation.get<API::String>(pluginInformationMIMETypeKey())), m_client.base.clientInfo);1282 1283 if (m_client.pluginDidFail_deprecatedForUseWithV1)1284 m_client.pluginDidFail_deprecatedForUseWithV1(toAPI(&page), kWKErrorCodeCannotLoadPlugIn, toAPI(pluginInformation.get<API::String>(pluginInformationMIMETypeKey())), 0, 0, m_client.base.clientInfo);1285 1286 if (m_client.pluginDidFail)1287 m_client.pluginDidFail(toAPI(&page), kWKErrorCodeCannotLoadPlugIn, toAPI(&pluginInformation), m_client.base.clientInfo);1288 }1289 1290 void didBlockInsecurePluginVersion(WebPageProxy& page, API::Dictionary& pluginInformation) override1291 {1292 if (m_client.pluginDidFail_deprecatedForUseWithV1)1293 m_client.pluginDidFail_deprecatedForUseWithV1(toAPI(&page), kWKErrorCodeInsecurePlugInVersion, toAPI(pluginInformation.get<API::String>(pluginInformationMIMETypeKey())), toAPI(pluginInformation.get<API::String>(pluginInformationBundleIdentifierKey())), toAPI(pluginInformation.get<API::String>(pluginInformationBundleVersionKey())), m_client.base.clientInfo);1294 1295 if (m_client.pluginDidFail)1296 m_client.pluginDidFail(toAPI(&page), kWKErrorCodeInsecurePlugInVersion, toAPI(&pluginInformation), m_client.base.clientInfo);1297 }1298 1299 void pluginLoadPolicy(WebPageProxy& page, PluginModuleLoadPolicy currentPluginLoadPolicy, API::Dictionary& pluginInformation, CompletionHandler<void(WebKit::PluginModuleLoadPolicy, const String&)>&& completionHandler) override1300 {1301 WKStringRef unavailabilityDescriptionOut = 0;1302 PluginModuleLoadPolicy loadPolicy = currentPluginLoadPolicy;1303 1304 if (m_client.pluginLoadPolicy_deprecatedForUseWithV2)1305 loadPolicy = toPluginModuleLoadPolicy(m_client.pluginLoadPolicy_deprecatedForUseWithV2(toAPI(&page), toWKPluginLoadPolicy(currentPluginLoadPolicy), toAPI(&pluginInformation), m_client.base.clientInfo));1306 else if (m_client.pluginLoadPolicy)1307 loadPolicy = toPluginModuleLoadPolicy(m_client.pluginLoadPolicy(toAPI(&page), toWKPluginLoadPolicy(currentPluginLoadPolicy), toAPI(&pluginInformation), &unavailabilityDescriptionOut, m_client.base.clientInfo));1308 1309 String unavailabilityDescription;1310 if (unavailabilityDescriptionOut) {1311 RefPtr<API::String> webUnavailabilityDescription = adoptRef(toImpl(unavailabilityDescriptionOut));1312 unavailabilityDescription = webUnavailabilityDescription->string();1313 }1314 1315 completionHandler(loadPolicy, unavailabilityDescription);1316 }1317 #endif // ENABLE(NETSCAPE_PLUGIN_API)1318 1319 #if ENABLE(WEBGL)1320 WebCore::WebGLLoadPolicy webGLLoadPolicy(WebPageProxy& page, const String& url) const override1321 {1322 WebCore::WebGLLoadPolicy loadPolicy = WebGLAllowCreation;1323 1324 if (m_client.webGLLoadPolicy)1325 loadPolicy = toWebGLLoadPolicy(m_client.webGLLoadPolicy(toAPI(&page), toAPI(url.impl()), m_client.base.clientInfo));1326 1327 return loadPolicy;1328 }1329 1330 WebCore::WebGLLoadPolicy resolveWebGLLoadPolicy(WebPageProxy& page, const String& url) const override1331 {1332 WebCore::WebGLLoadPolicy loadPolicy = WebGLAllowCreation;1333 1334 if (m_client.resolveWebGLLoadPolicy)1335 loadPolicy = toWebGLLoadPolicy(m_client.resolveWebGLLoadPolicy(toAPI(&page), toAPI(url.impl()), m_client.base.clientInfo));1336 1337 return loadPolicy;1338 }1339 1340 #endif // ENABLE(WEBGL)1341 1147 }; 1342 1148 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r235392 r235398 1271 1271 PageClientProtector protector(m_pageClient); 1272 1272 1273 if ( !m_navigationClient || !m_navigationClient->didChangeBackForwardList(*this, added, removed))1274 m_ loaderClient->didChangeBackForwardList(*this, added, WTFMove(removed));1273 if (m_navigationClient) 1274 m_navigationClient->didChangeBackForwardList(*this, added, removed); 1275 1275 1276 1276 auto transaction = m_pageLoadState.transaction(); … … 1285 1285 1286 1286 if (auto* item = m_backForwardList->itemForID(itemID)) { 1287 if (m_navigationClient && m_navigationClient->willGoToBackForwardListItem(*this, *item, inPageCache, m_process->transformHandlesToObjects(userData.object()).get())) 1288 return; 1289 m_loaderClient->willGoToBackForwardListItem(*this, *item, m_process->transformHandlesToObjects(userData.object()).get()); 1287 if (m_navigationClient) 1288 m_navigationClient->willGoToBackForwardListItem(*this, *item, inPageCache, m_process->transformHandlesToObjects(userData.object()).get()); 1290 1289 } 1291 1290 } … … 2197 2196 if (m_navigationClient) 2198 2197 m_navigationClient->decidePolicyForPluginLoad(*this, static_cast<PluginModuleLoadPolicy>(pluginLoadPolicy), pluginInformation.get(), WTFMove(findPluginCompletion)); 2199 else 2200 m_loaderClient->pluginLoadPolicy(*this, static_cast<PluginModuleLoadPolicy>(pluginLoadPolicy), pluginInformation.get(), WTFMove(findPluginCompletion)); 2201 #else 2198 #endif 2202 2199 findPluginCompletion(pluginLoadPolicy, { }); 2203 #endif2204 2200 } 2205 2201 … … 3376 3372 3377 3373 m_pageLoadState.commitChanges(); 3378 m_loaderClient->didStartProgress(*this);3379 3374 } 3380 3375 … … 3387 3382 3388 3383 m_pageLoadState.commitChanges(); 3389 m_loaderClient->didChangeProgress(*this);3390 3384 } 3391 3385 … … 3398 3392 3399 3393 m_pageLoadState.commitChanges(); 3400 m_loaderClient->didFinishProgress(*this);3401 3394 } 3402 3395 … … 3678 3671 3679 3672 m_pageLoadState.commitChanges(); 3680 if (m_navigationClient) { 3681 if (frame->isMainFrame()) 3682 m_navigationClient->didCommitNavigation(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get()); 3683 } else 3684 m_loaderClient->didCommitLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get()); 3673 if (m_navigationClient && frame->isMainFrame()) 3674 m_navigationClient->didCommitNavigation(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get()); 3685 3675 3686 3676 #if ENABLE(ATTACHMENT_ELEMENT) … … 3707 3697 navigation = &navigationState().navigation(navigationID); 3708 3698 3709 if (m_navigationClient) { 3710 if (frame->isMainFrame()) 3711 m_navigationClient->didFinishDocumentLoad(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get()); 3712 } else 3713 m_loaderClient->didFinishDocumentLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get()); 3699 if (m_navigationClient && frame->isMainFrame()) 3700 m_navigationClient->didFinishDocumentLoad(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get()); 3714 3701 } 3715 3702 … … 3831 3818 3832 3819 SameDocumentNavigationType navigationType = static_cast<SameDocumentNavigationType>(opaqueSameDocumentNavigationType); 3833 if (m_navigationClient) { 3834 if (isMainFrame) 3835 m_navigationClient->didSameDocumentNavigation(*this, navigation.get(), navigationType, m_process->transformHandlesToObjects(userData.object()).get()); 3836 } else 3837 m_loaderClient->didSameDocumentNavigationForFrame(*this, *frame, navigation.get(), navigationType, m_process->transformHandlesToObjects(userData.object()).get()); 3820 if (m_navigationClient && isMainFrame) 3821 m_navigationClient->didSameDocumentNavigation(*this, navigation.get(), navigationType, m_process->transformHandlesToObjects(userData.object()).get()); 3838 3822 3839 3823 if (isMainFrame) … … 3872 3856 3873 3857 m_pageLoadState.commitChanges(); 3874 m_loaderClient->didReceiveTitleForFrame(*this, title, *frame, m_process->transformHandlesToObjects(userData.object()).get()); 3875 } 3876 3877 void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, const UserData& userData) 3878 { 3879 PageClientProtector protector(m_pageClient); 3880 3881 WebFrameProxy* frame = m_process->webFrame(frameID); 3882 MESSAGE_CHECK(frame); 3883 3884 m_loaderClient->didFirstLayoutForFrame(*this, *frame, m_process->transformHandlesToObjects(userData.object()).get()); 3858 } 3859 3860 void WebPageProxy::didFirstLayoutForFrame(uint64_t, const UserData& userData) 3861 { 3885 3862 } 3886 3863 … … 3926 3903 if (m_navigationClient) 3927 3904 m_navigationClient->didDisplayInsecureContent(*this, m_process->transformHandlesToObjects(userData.object()).get()); 3928 else3929 m_loaderClient->didDisplayInsecureContentForFrame(*this, *frame, m_process->transformHandlesToObjects(userData.object()).get());3930 3905 } 3931 3906 … … 3943 3918 if (m_navigationClient) 3944 3919 m_navigationClient->didRunInsecureContent(*this, m_process->transformHandlesToObjects(userData.object()).get()); 3945 else 3946 m_loaderClient->didRunInsecureContentForFrame(*this, *frame, m_process->transformHandlesToObjects(userData.object()).get()); 3947 } 3948 3949 void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, const UserData& userData) 3950 { 3951 PageClientProtector protector(m_pageClient); 3952 3953 WebFrameProxy* frame = m_process->webFrame(frameID); 3954 MESSAGE_CHECK(frame); 3955 3956 m_loaderClient->didDetectXSSForFrame(*this, *frame, m_process->transformHandlesToObjects(userData.object()).get()); 3920 } 3921 3922 void WebPageProxy::didDetectXSSForFrame(uint64_t, const UserData&) 3923 { 3957 3924 } 3958 3925 … … 4204 4171 MESSAGE_CHECK(frame->page() == this); 4205 4172 4206 if (m_historyClient) { 4207 if (frame->isMainFrame()) 4208 m_historyClient->didNavigateWithNavigationData(*this, store); 4209 } else 4210 m_loaderClient->didNavigateWithNavigationData(*this, store, *frame); 4173 if (m_historyClient && frame->isMainFrame()) 4174 m_historyClient->didNavigateWithNavigationData(*this, store); 4211 4175 process().processPool().historyClient().didNavigateWithNavigationData(process().processPool(), *this, store, *frame); 4212 4176 } … … 4226 4190 MESSAGE_CHECK_URL(destinationURLString); 4227 4191 4228 if (m_historyClient) { 4229 if (frame->isMainFrame()) 4230 m_historyClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString); 4231 } else 4232 m_loaderClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString, *frame); 4192 if (m_historyClient && frame->isMainFrame()) 4193 m_historyClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString); 4233 4194 process().processPool().historyClient().didPerformClientRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame); 4234 4195 } … … 4248 4209 MESSAGE_CHECK_URL(destinationURLString); 4249 4210 4250 if (m_historyClient) { 4251 if (frame->isMainFrame()) 4252 m_historyClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString); 4253 } else 4254 m_loaderClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString, *frame); 4211 if (m_historyClient && frame->isMainFrame()) 4212 m_historyClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString); 4255 4213 process().processPool().historyClient().didPerformServerRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame); 4256 4214 } … … 4266 4224 MESSAGE_CHECK_URL(url); 4267 4225 4268 if (m_historyClient) { 4269 if (frame->isMainFrame()) 4270 m_historyClient->didUpdateHistoryTitle(*this, title, url); 4271 } else 4272 m_loaderClient->didUpdateHistoryTitle(*this, title, url, *frame); 4226 if (m_historyClient && frame->isMainFrame()) 4227 m_historyClient->didUpdateHistoryTitle(*this, title, url); 4273 4228 process().processPool().historyClient().didUpdateHistoryTitle(process().processPool(), *this, title, url, *frame); 4274 4229 } … … 4468 4423 }); 4469 4424 } else 4470 reply(static_cast<uint32_t>( m_loaderClient->webGLLoadPolicy(*this, url)));4425 reply(static_cast<uint32_t>(WebCore::WebGLLoadPolicy::WebGLAllowCreation)); 4471 4426 } 4472 4427 … … 4478 4433 }); 4479 4434 } else 4480 reply(static_cast<uint32_t>( m_loaderClient->resolveWebGLLoadPolicy(*this, url)));4435 reply(static_cast<uint32_t>(WebCore::WebGLLoadPolicy::WebGLAllowCreation)); 4481 4436 } 4482 4437 #endif // ENABLE(WEBGL) … … 5874 5829 if (m_navigationClient) 5875 5830 m_navigationClient->processDidBecomeUnresponsive(*this); 5876 else5877 m_loaderClient->processDidBecomeUnresponsive(*this);5878 5831 } 5879 5832 … … 5887 5840 if (m_navigationClient) 5888 5841 m_navigationClient->processDidBecomeResponsive(*this); 5889 else5890 m_loaderClient->processDidBecomeResponsive(*this);5891 5842 } 5892 5843 … … 5966 5917 if (m_navigationClient) 5967 5918 handledByClient = m_navigationClient->processDidTerminate(*this, reason); 5968 else if (reason != ProcessTerminationReason::RequestedByClient)5969 handledByClient = m_loaderClient->processDidCrash(*this);5970 5919 5971 5920 if (!handledByClient && shouldReloadAfterProcessTermination(reason)) … … 6338 6287 #endif 6339 6288 6340 void WebPageProxy::didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&& authenticationChallenge) 6341 { 6342 WebFrameProxy* frame = m_process->webFrame(frameID); 6343 MESSAGE_CHECK(frame); 6344 6289 void WebPageProxy::didReceiveAuthenticationChallengeProxy(uint64_t, Ref<AuthenticationChallengeProxy>&& authenticationChallenge) 6290 { 6345 6291 #if HAVE(SEC_KEY_PROXY) 6346 6292 ASSERT(authenticationChallenge->protectionSpace()); … … 6355 6301 m_navigationClient->didReceiveAuthenticationChallenge(*this, authenticationChallenge.get()); 6356 6302 else 6357 m_loaderClient->didReceiveAuthenticationChallengeInFrame(*this, *frame, authenticationChallenge.get());6303 authenticationChallenge->performDefaultHandling(); 6358 6304 } 6359 6305 … … 6592 6538 void WebPageProxy::didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString) 6593 6539 { 6594 if (m_navigationClient->didFailToInitializePlugIn(*this, createPluginInformationDictionary(mimeType, frameURLString, pageURLString).get())) 6595 return; 6596 m_loaderClient->didFailToInitializePlugin(*this, createPluginInformationDictionary(mimeType, frameURLString, pageURLString).get()); 6540 m_navigationClient->didFailToInitializePlugIn(*this, createPluginInformationDictionary(mimeType, frameURLString, pageURLString).get()); 6597 6541 } 6598 6542 … … 6603 6547 auto pluginInformation = createPluginInformationDictionary(plugin, frameURLString, mimeType, pageURLString, String(), String(), replacementObscured); 6604 6548 6605 if (m_navigationClient->didBlockInsecurePluginVersion(*this, pluginInformation.get())) 6606 return; 6607 m_loaderClient->didBlockInsecurePluginVersion(*this, pluginInformation.get()); 6549 m_navigationClient->didBlockInsecurePluginVersion(*this, pluginInformation.get()); 6608 6550 } 6609 6551 #endif // ENABLE(NETSCAPE_PLUGIN_API) … … 7122 7064 if (m_navigationClient) 7123 7065 m_navigationClient->didBeginNavigationGesture(*this); 7124 else7125 m_loaderClient->navigationGestureDidBegin(*this);7126 7066 } 7127 7067 … … 7134 7074 if (m_navigationClient) 7135 7075 m_navigationClient->willEndNavigationGesture(*this, willNavigate, item); 7136 else7137 m_loaderClient->navigationGestureWillEnd(*this, willNavigate, item);7138 7076 } 7139 7077 … … 7146 7084 if (m_navigationClient) 7147 7085 m_navigationClient->didEndNavigationGesture(*this, willNavigate, item); 7148 else7149 m_loaderClient->navigationGestureDidEnd(*this, willNavigate, item);7150 7086 } 7151 7087 -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r235343 r235398 1126 1126 if (m_navigationClient) 1127 1127 m_navigationClient->didStartLoadForQuickLookDocumentInMainFrame(fileName.substring(fileName.reverseFind('/') + 1), uti); 1128 else1129 m_loaderClient->didStartLoadForQuickLookDocumentInMainFrame(fileName.substring(fileName.reverseFind('/') + 1), uti);1130 1128 } 1131 1129 … … 1134 1132 if (m_navigationClient) 1135 1133 m_navigationClient->didFinishLoadForQuickLookDocumentInMainFrame(data); 1136 else1137 m_loaderClient->didFinishLoadForQuickLookDocumentInMainFrame(data);1138 1134 } 1139 1135
Note: See TracChangeset
for help on using the changeset viewer.