LEFT | RIGHT |
1 /* | 1 /* |
2 * Copyright (C) 2010-2018 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010-2018 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "APIArray.h" | 31 #include "APIArray.h" |
32 #include "APIGeometry.h" | 32 #include "APIGeometry.h" |
33 #include "AssistedNodeInformation.h" | 33 #include "AssistedNodeInformation.h" |
34 #include "DataReference.h" | 34 #include "DataReference.h" |
35 #include "DragControllerAction.h" | 35 #include "DragControllerAction.h" |
36 #include "DrawingArea.h" | 36 #include "DrawingArea.h" |
37 #include "DrawingAreaMessages.h" | 37 #include "DrawingAreaMessages.h" |
38 #include "EditorState.h" | 38 #include "EditorState.h" |
39 #include "EventDispatcher.h" | 39 #include "EventDispatcher.h" |
40 #include "FindController.h" | 40 #include "FindController.h" |
| 41 #include "FormDataReference.h" |
41 #include "GeolocationPermissionRequestManager.h" | 42 #include "GeolocationPermissionRequestManager.h" |
42 #include "InjectedBundle.h" | 43 #include "InjectedBundle.h" |
43 #include "InjectedBundleBackForwardList.h" | 44 #include "InjectedBundleBackForwardList.h" |
44 #include "InjectedBundleScriptWorld.h" | 45 #include "InjectedBundleScriptWorld.h" |
45 #include "LibWebRTCProvider.h" | 46 #include "LibWebRTCProvider.h" |
46 #include "LoadParameters.h" | 47 #include "LoadParameters.h" |
47 #include "Logging.h" | 48 #include "Logging.h" |
48 #include "NetscapePlugin.h" | 49 #include "NetscapePlugin.h" |
49 #include "NetworkConnectionToWebProcessMessages.h" | 50 #include "NetworkConnectionToWebProcessMessages.h" |
50 #include "NetworkProcessConnection.h" | 51 #include "NetworkProcessConnection.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 #include <WebCore/HitTestResult.h> | 171 #include <WebCore/HitTestResult.h> |
171 #include <WebCore/InspectorController.h> | 172 #include <WebCore/InspectorController.h> |
172 #include <WebCore/JSDOMExceptionHandling.h> | 173 #include <WebCore/JSDOMExceptionHandling.h> |
173 #include <WebCore/JSDOMWindow.h> | 174 #include <WebCore/JSDOMWindow.h> |
174 #include <WebCore/KeyboardEvent.h> | 175 #include <WebCore/KeyboardEvent.h> |
175 #include <WebCore/MIMETypeRegistry.h> | 176 #include <WebCore/MIMETypeRegistry.h> |
176 #include <WebCore/MouseEvent.h> | 177 #include <WebCore/MouseEvent.h> |
177 #include <WebCore/NotImplemented.h> | 178 #include <WebCore/NotImplemented.h> |
178 #include <WebCore/Page.h> | 179 #include <WebCore/Page.h> |
179 #include <WebCore/PageConfiguration.h> | 180 #include <WebCore/PageConfiguration.h> |
| 181 #include <WebCore/PingLoader.h> |
180 #include <WebCore/PlatformKeyboardEvent.h> | 182 #include <WebCore/PlatformKeyboardEvent.h> |
181 #include <WebCore/PluginDocument.h> | 183 #include <WebCore/PluginDocument.h> |
182 #include <WebCore/PrintContext.h> | 184 #include <WebCore/PrintContext.h> |
183 #include <WebCore/PromisedBlobInfo.h> | 185 #include <WebCore/PromisedBlobInfo.h> |
184 #include <WebCore/Range.h> | 186 #include <WebCore/Range.h> |
| 187 #include <WebCore/RemoteDOMWindow.h> |
| 188 #include <WebCore/RemoteFrame.h> |
185 #include <WebCore/RenderLayer.h> | 189 #include <WebCore/RenderLayer.h> |
186 #include <WebCore/RenderTheme.h> | 190 #include <WebCore/RenderTheme.h> |
187 #include <WebCore/RenderTreeAsText.h> | 191 #include <WebCore/RenderTreeAsText.h> |
188 #include <WebCore/RenderView.h> | 192 #include <WebCore/RenderView.h> |
189 #include <WebCore/ResourceRequest.h> | 193 #include <WebCore/ResourceRequest.h> |
190 #include <WebCore/ResourceResponse.h> | 194 #include <WebCore/ResourceResponse.h> |
191 #include <WebCore/RuntimeEnabledFeatures.h> | 195 #include <WebCore/RuntimeEnabledFeatures.h> |
192 #include <WebCore/SchemeRegistry.h> | 196 #include <WebCore/SchemeRegistry.h> |
193 #include <WebCore/ScriptController.h> | 197 #include <WebCore/ScriptController.h> |
194 #include <WebCore/SerializedScriptValue.h> | 198 #include <WebCore/SerializedScriptValue.h> |
195 #include <WebCore/ServiceWorkerProvider.h> | 199 #include <WebCore/ServiceWorkerProvider.h> |
196 #include <WebCore/Settings.h> | 200 #include <WebCore/Settings.h> |
197 #include <WebCore/ShadowRoot.h> | 201 #include <WebCore/ShadowRoot.h> |
198 #include <WebCore/SharedBuffer.h> | 202 #include <WebCore/SharedBuffer.h> |
199 #include <WebCore/StyleProperties.h> | 203 #include <WebCore/StyleProperties.h> |
200 #include <WebCore/SubframeLoader.h> | 204 #include <WebCore/SubframeLoader.h> |
201 #include <WebCore/SubstituteData.h> | 205 #include <WebCore/SubstituteData.h> |
202 #include <WebCore/TextIterator.h> | 206 #include <WebCore/TextIterator.h> |
203 #include <WebCore/UserGestureIndicator.h> | 207 #include <WebCore/UserGestureIndicator.h> |
204 #include <WebCore/UserInputBridge.h> | 208 #include <WebCore/UserInputBridge.h> |
205 #include <WebCore/UserScript.h> | 209 #include <WebCore/UserScript.h> |
206 #include <WebCore/UserStyleSheet.h> | 210 #include <WebCore/UserStyleSheet.h> |
| 211 #include <WebCore/UserTypingGestureIndicator.h> |
207 #include <WebCore/VisiblePosition.h> | 212 #include <WebCore/VisiblePosition.h> |
208 #include <WebCore/VisibleUnits.h> | 213 #include <WebCore/VisibleUnits.h> |
209 #include <WebCore/WebGLStateTracker.h> | 214 #include <WebCore/WebGLStateTracker.h> |
210 #include <WebCore/markup.h> | 215 #include <WebCore/markup.h> |
211 #include <pal/SessionID.h> | 216 #include <pal/SessionID.h> |
| 217 #include <wtf/ProcessID.h> |
212 #include <wtf/RunLoop.h> | 218 #include <wtf/RunLoop.h> |
213 #include <wtf/SetForScope.h> | 219 #include <wtf/SetForScope.h> |
214 #include <wtf/text/TextStream.h> | 220 #include <wtf/text/TextStream.h> |
215 | 221 |
216 #if ENABLE(DATA_DETECTION) | 222 #if ENABLE(DATA_DETECTION) |
217 #include "DataDetectionResult.h" | 223 #include "DataDetectionResult.h" |
218 #endif | 224 #endif |
219 | 225 |
220 #if ENABLE(MHTML) | 226 #if ENABLE(MHTML) |
221 #include <WebCore/MHTMLArchive.h> | 227 #include <WebCore/MHTMLArchive.h> |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 setUseSystemAppearance(parameters.useSystemAppearance); | 505 setUseSystemAppearance(parameters.useSystemAppearance); |
500 setDefaultAppearance(parameters.defaultAppearance); | 506 setDefaultAppearance(parameters.defaultAppearance); |
501 #endif | 507 #endif |
502 // If the page is created off-screen, its visibilityState should be prerende
r. | 508 // If the page is created off-screen, its visibilityState should be prerende
r. |
503 m_page->setActivityState(m_activityState); | 509 m_page->setActivityState(m_activityState); |
504 if (!isVisible()) | 510 if (!isVisible()) |
505 m_page->setIsPrerender(); | 511 m_page->setIsPrerender(); |
506 | 512 |
507 updateIsInWindow(true); | 513 updateIsInWindow(true); |
508 | 514 |
509 setMinimumLayoutSize(parameters.minimumLayoutSize); | 515 setViewLayoutSize(parameters.viewLayoutSize); |
510 setAutoSizingShouldExpandToViewHeight(parameters.autoSizingShouldExpandToVie
wHeight); | 516 setAutoSizingShouldExpandToViewHeight(parameters.autoSizingShouldExpandToVie
wHeight); |
511 setViewportSizeForCSSViewportUnits(parameters.viewportSizeForCSSViewportUnit
s); | 517 setViewportSizeForCSSViewportUnits(parameters.viewportSizeForCSSViewportUnit
s); |
512 ···· | 518 ···· |
513 setScrollPinningBehavior(parameters.scrollPinningBehavior); | 519 setScrollPinningBehavior(parameters.scrollPinningBehavior); |
514 if (parameters.scrollbarOverlayStyle) | 520 if (parameters.scrollbarOverlayStyle) |
515 m_scrollbarOverlayStyle = static_cast<ScrollbarOverlayStyle>(parameters.
scrollbarOverlayStyle.value()); | 521 m_scrollbarOverlayStyle = static_cast<ScrollbarOverlayStyle>(parameters.
scrollbarOverlayStyle.value()); |
516 else | 522 else |
517 m_scrollbarOverlayStyle = std::optional<ScrollbarOverlayStyle>(); | 523 m_scrollbarOverlayStyle = std::optional<ScrollbarOverlayStyle>(); |
518 | 524 |
519 setBackgroundExtendsBeyondPage(parameters.backgroundExtendsBeyondPage); | 525 setBackgroundExtendsBeyondPage(parameters.backgroundExtendsBeyondPage); |
520 | 526 |
521 setTopContentInset(parameters.topContentInset); | 527 setTopContentInset(parameters.topContentInset); |
522 | 528 |
523 m_userAgent = parameters.userAgent; | 529 m_userAgent = parameters.userAgent; |
524 | |
525 WebBackForwardListProxy::setHighestItemIDFromUIProcess(parameters.highestUse
dBackForwardItemID); | |
526 ···· | 530 ···· |
527 if (!parameters.itemStates.isEmpty()) | 531 if (!parameters.itemStates.isEmpty()) |
528 restoreSessionInternal(parameters.itemStates, WasRestoredByAPIRequest::N
o); | 532 restoreSessionInternal(parameters.itemStates, WasRestoredByAPIRequest::N
o, WebBackForwardListProxy::OverwriteExistingItem::Yes); |
529 | 533 |
530 if (parameters.sessionID.isValid()) | 534 if (parameters.sessionID.isValid()) |
531 setSessionID(parameters.sessionID); | 535 setSessionID(parameters.sessionID); |
532 | 536 |
533 m_drawingArea->setPaintingEnabled(true); | 537 m_drawingArea->setPaintingEnabled(true); |
534 ···· | 538 ···· |
535 setMediaVolume(parameters.mediaVolume); | 539 setMediaVolume(parameters.mediaVolume); |
536 | 540 |
537 setMuted(parameters.muted); | 541 setMuted(parameters.muted); |
538 | 542 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 | 607 |
604 m_userContentController->addUserContentWorlds(parameters.userContentWorlds); | 608 m_userContentController->addUserContentWorlds(parameters.userContentWorlds); |
605 m_userContentController->addUserScripts(parameters.userScripts); | 609 m_userContentController->addUserScripts(parameters.userScripts); |
606 m_userContentController->addUserStyleSheets(parameters.userStyleSheets); | 610 m_userContentController->addUserStyleSheets(parameters.userStyleSheets); |
607 m_userContentController->addUserScriptMessageHandlers(parameters.messageHand
lers); | 611 m_userContentController->addUserScriptMessageHandlers(parameters.messageHand
lers); |
608 #if ENABLE(CONTENT_EXTENSIONS) | 612 #if ENABLE(CONTENT_EXTENSIONS) |
609 m_userContentController->addContentRuleLists(parameters.contentRuleLists); | 613 m_userContentController->addContentRuleLists(parameters.contentRuleLists); |
610 #endif | 614 #endif |
611 | 615 |
612 #if PLATFORM(IOS) | 616 #if PLATFORM(IOS) |
613 setViewportConfigurationMinimumLayoutSize(parameters.viewportConfigurationMi
nimumLayoutSize, parameters.viewportConfigurationViewSize); | 617 setViewportConfigurationViewLayoutSize(parameters.viewportConfigurationViewL
ayoutSize); |
614 setMaximumUnobscuredSize(parameters.maximumUnobscuredSize); | 618 setMaximumUnobscuredSize(parameters.maximumUnobscuredSize); |
615 #endif | 619 #endif |
616 } | 620 } |
617 | 621 |
618 #if ENABLE(WEB_RTC) | 622 #if ENABLE(WEB_RTC) |
619 void WebPage::disableICECandidateFiltering() | 623 void WebPage::disableICECandidateFiltering() |
620 { | 624 { |
621 m_page->disableICECandidateFiltering(); | 625 m_page->disableICECandidateFiltering(); |
622 } | 626 } |
623 | 627 |
(...skipping 10 matching lines...) Expand all Loading... |
634 | 638 |
635 void WebPage::enableEnumeratingAllNetworkInterfaces() | 639 void WebPage::enableEnumeratingAllNetworkInterfaces() |
636 { | 640 { |
637 m_page->libWebRTCProvider().enableEnumeratingAllNetworkInterfaces(); | 641 m_page->libWebRTCProvider().enableEnumeratingAllNetworkInterfaces(); |
638 } | 642 } |
639 #endif | 643 #endif |
640 #endif | 644 #endif |
641 | 645 |
642 void WebPage::reinitializeWebPage(WebPageCreationParameters&& parameters) | 646 void WebPage::reinitializeWebPage(WebPageCreationParameters&& parameters) |
643 { | 647 { |
| 648 ASSERT(m_drawingArea); |
| 649 m_drawingArea->attachDrawingArea(); |
| 650 |
644 if (m_activityState != parameters.activityState) | 651 if (m_activityState != parameters.activityState) |
645 setActivityState(parameters.activityState, false, Vector<CallbackID>()); | 652 setActivityState(parameters.activityState, false, Vector<CallbackID>()); |
646 if (m_layerHostingMode != parameters.layerHostingMode) | 653 if (m_layerHostingMode != parameters.layerHostingMode) |
647 setLayerHostingMode(parameters.layerHostingMode); | 654 setLayerHostingMode(parameters.layerHostingMode); |
648 } | 655 } |
649 | 656 |
650 void WebPage::updateThrottleState() | 657 void WebPage::updateThrottleState() |
651 { | 658 { |
652 // We should suppress if the page is not active, is visually idle, and supre
ssion is enabled. | 659 // We should suppress if the page is not active, is visually idle, and supre
ssion is enabled. |
653 bool isLoading = m_activityState & ActivityState::IsLoading; | 660 bool isLoading = m_activityState & ActivityState::IsLoading; |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 FrameLoadRequest frameLoadRequest { *m_mainFrame->coreFrame(), loadParameter
s.request, ShouldOpenExternalURLsPolicy::ShouldNotAllow }; | 1270 FrameLoadRequest frameLoadRequest { *m_mainFrame->coreFrame(), loadParameter
s.request, ShouldOpenExternalURLsPolicy::ShouldNotAllow }; |
1264 ShouldOpenExternalURLsPolicy externalURLsPolicy = static_cast<ShouldOpenExte
rnalURLsPolicy>(loadParameters.shouldOpenExternalURLsPolicy); | 1271 ShouldOpenExternalURLsPolicy externalURLsPolicy = static_cast<ShouldOpenExte
rnalURLsPolicy>(loadParameters.shouldOpenExternalURLsPolicy); |
1265 frameLoadRequest.setShouldOpenExternalURLsPolicy(externalURLsPolicy); | 1272 frameLoadRequest.setShouldOpenExternalURLsPolicy(externalURLsPolicy); |
1266 frameLoadRequest.setShouldCheckNavigationPolicy(loadParameters.shouldCheckNa
vigationPolicy); | 1273 frameLoadRequest.setShouldCheckNavigationPolicy(loadParameters.shouldCheckNa
vigationPolicy); |
1267 | 1274 |
1268 corePage()->userInputBridge().loadRequest(WTFMove(frameLoadRequest)); | 1275 corePage()->userInputBridge().loadRequest(WTFMove(frameLoadRequest)); |
1269 | 1276 |
1270 ASSERT(!m_pendingNavigationID); | 1277 ASSERT(!m_pendingNavigationID); |
1271 } | 1278 } |
1272 | 1279 |
1273 void WebPage::loadDataImpl(uint64_t navigationID, Ref<SharedBuffer>&& sharedBuff
er, const String& MIMEType, const String& encodingName, const URL& baseURL, cons
t URL& unreachableURL, const UserData& userData) | 1280 void WebPage::loadDataImpl(uint64_t navigationID, Ref<SharedBuffer>&& sharedBuff
er, const String& MIMEType, const String& encodingName, const URL& baseURL, cons
t URL& unreachableURL, const UserData& userData, LockBackForwardList lockBackFor
wardList) |
1274 { | 1281 { |
1275 SendStopResponsivenessTimer stopper; | 1282 SendStopResponsivenessTimer stopper; |
1276 | 1283 |
1277 m_pendingNavigationID = navigationID; | 1284 m_pendingNavigationID = navigationID; |
1278 | 1285 |
1279 ResourceRequest request(baseURL); | 1286 ResourceRequest request(baseURL); |
1280 ResourceResponse response(URL(), MIMEType, sharedBuffer->size(), encodingNam
e); | 1287 ResourceResponse response(URL(), MIMEType, sharedBuffer->size(), encodingNam
e); |
1281 SubstituteData substituteData(WTFMove(sharedBuffer), unreachableURL, respons
e, SubstituteData::SessionHistoryVisibility::Hidden); | 1288 SubstituteData substituteData(WTFMove(sharedBuffer), unreachableURL, respons
e, SubstituteData::SessionHistoryVisibility::Hidden); |
1282 | 1289 |
1283 // Let the InjectedBundle know we are about to start the load, passing the u
ser data from the UIProcess | 1290 // Let the InjectedBundle know we are about to start the load, passing the u
ser data from the UIProcess |
1284 // to all the client to set up any needed state. | 1291 // to all the client to set up any needed state. |
1285 m_loaderClient->willLoadDataRequest(*this, request, const_cast<SharedBuffer*
>(substituteData.content()), substituteData.mimeType(), substituteData.textEncod
ing(), substituteData.failingURL(), WebProcess::singleton().transformHandlesToOb
jects(userData.object()).get()); | 1292 m_loaderClient->willLoadDataRequest(*this, request, const_cast<SharedBuffer*
>(substituteData.content()), substituteData.mimeType(), substituteData.textEncod
ing(), substituteData.failingURL(), WebProcess::singleton().transformHandlesToOb
jects(userData.object()).get()); |
1286 | 1293 |
1287 // Initate the load in WebCore. | 1294 // Initate the load in WebCore. |
1288 m_mainFrame->coreFrame()->loader().load(FrameLoadRequest(*m_mainFrame->coreF
rame(), request, ShouldOpenExternalURLsPolicy::ShouldNotAllow, substituteData)); | 1295 m_mainFrame->coreFrame()->loader().load(FrameLoadRequest(*m_mainFrame->coreF
rame(), request, ShouldOpenExternalURLsPolicy::ShouldNotAllow, substituteData, l
ockBackForwardList)); |
1289 } | 1296 } |
1290 | 1297 |
1291 void WebPage::loadStringImpl(uint64_t navigationID, const String& htmlString, co
nst String& MIMEType, const URL& baseURL, const URL& unreachableURL, const UserD
ata& userData) | 1298 void WebPage::loadStringImpl(uint64_t navigationID, const String& htmlString, co
nst String& MIMEType, const URL& baseURL, const URL& unreachableURL, const UserD
ata& userData, LockBackForwardList lockBackForwardList) |
1292 { | 1299 { |
1293 if (!htmlString.isNull() && htmlString.is8Bit()) { | 1300 if (!htmlString.isNull() && htmlString.is8Bit()) { |
1294 auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(h
tmlString.characters8()), htmlString.length() * sizeof(LChar)); | 1301 auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(h
tmlString.characters8()), htmlString.length() * sizeof(LChar)); |
1295 loadDataImpl(navigationID, WTFMove(sharedBuffer), MIMEType, ASCIILiteral
("latin1"), baseURL, unreachableURL, userData); | 1302 loadDataImpl(navigationID, WTFMove(sharedBuffer), MIMEType, ASCIILiteral
("latin1"), baseURL, unreachableURL, userData, lockBackForwardList); |
1296 } else { | 1303 } else { |
1297 auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(h
tmlString.characters16()), htmlString.length() * sizeof(UChar)); | 1304 auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(h
tmlString.characters16()), htmlString.length() * sizeof(UChar)); |
1298 loadDataImpl(navigationID, WTFMove(sharedBuffer), MIMEType, ASCIILiteral
("utf-16"), baseURL, unreachableURL, userData); | 1305 loadDataImpl(navigationID, WTFMove(sharedBuffer), MIMEType, ASCIILiteral
("utf-16"), baseURL, unreachableURL, userData, lockBackForwardList); |
1299 } | 1306 } |
1300 } | 1307 } |
1301 | 1308 |
1302 void WebPage::loadData(const LoadParameters& loadParameters) | 1309 void WebPage::loadData(const LoadParameters& loadParameters) |
1303 { | 1310 { |
1304 platformDidReceiveLoadParameters(loadParameters); | 1311 platformDidReceiveLoadParameters(loadParameters); |
1305 | 1312 |
1306 auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadP
arameters.data.data()), loadParameters.data.size()); | 1313 auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadP
arameters.data.data()), loadParameters.data.size()); |
1307 URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(
), loadParameters.baseURLString); | 1314 URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(
), loadParameters.baseURLString); |
1308 loadDataImpl(loadParameters.navigationID, WTFMove(sharedBuffer), loadParamet
ers.MIMEType, loadParameters.encodingName, baseURL, URL(), loadParameters.userDa
ta); | 1315 loadDataImpl(loadParameters.navigationID, WTFMove(sharedBuffer), loadParamet
ers.MIMEType, loadParameters.encodingName, baseURL, URL(), loadParameters.userDa
ta); |
1309 } | 1316 } |
1310 | 1317 |
1311 void WebPage::loadString(const LoadParameters& loadParameters) | 1318 void WebPage::loadString(const LoadParameters& loadParameters) |
1312 { | 1319 { |
1313 platformDidReceiveLoadParameters(loadParameters); | 1320 platformDidReceiveLoadParameters(loadParameters); |
1314 | 1321 |
1315 URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(
), loadParameters.baseURLString); | 1322 URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(
), loadParameters.baseURLString); |
1316 loadStringImpl(loadParameters.navigationID, loadParameters.string, loadParam
eters.MIMEType, baseURL, URL(), loadParameters.userData); | 1323 loadStringImpl(loadParameters.navigationID, loadParameters.string, loadParam
eters.MIMEType, baseURL, URL(), loadParameters.userData); |
1317 } | 1324 } |
1318 | 1325 |
1319 void WebPage::loadAlternateHTMLString(const LoadParameters& loadParameters) | 1326 void WebPage::loadAlternateHTMLString(const LoadParameters& loadParameters) |
1320 { | 1327 { |
1321 platformDidReceiveLoadParameters(loadParameters); | 1328 platformDidReceiveLoadParameters(loadParameters); |
1322 | 1329 |
1323 URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(
), loadParameters.baseURLString); | 1330 URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(
), loadParameters.baseURLString); |
1324 URL unreachableURL = loadParameters.unreachableURLString.isEmpty() ? URL() :
URL(URL(), loadParameters.unreachableURLString); | 1331 URL unreachableURL = loadParameters.unreachableURLString.isEmpty() ? URL() :
URL(URL(), loadParameters.unreachableURLString); |
1325 URL provisionalLoadErrorURL = loadParameters.provisionalLoadErrorURLString.i
sEmpty() ? URL() : URL(URL(), loadParameters.provisionalLoadErrorURLString); | 1332 URL provisionalLoadErrorURL = loadParameters.provisionalLoadErrorURLString.i
sEmpty() ? URL() : URL(URL(), loadParameters.provisionalLoadErrorURLString); |
1326 m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL(pr
ovisionalLoadErrorURL); | 1333 m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL(pr
ovisionalLoadErrorURL); |
1327 loadStringImpl(loadParameters.navigationID, loadParameters.string, ASCIILite
ral("text/html"), baseURL, unreachableURL, loadParameters.userData); | 1334 loadStringImpl(loadParameters.navigationID, loadParameters.string, ASCIILite
ral("text/html"), baseURL, unreachableURL, loadParameters.userData, loadParamete
rs.lockBackForwardList); |
1328 m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL({
}); | 1335 m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL({
}); |
1329 } | 1336 } |
1330 | 1337 |
1331 void WebPage::navigateToPDFLinkWithSimulatedClick(const String& url, IntPoint do
cumentPoint, IntPoint screenPoint) | 1338 void WebPage::navigateToPDFLinkWithSimulatedClick(const String& url, IntPoint do
cumentPoint, IntPoint screenPoint) |
1332 { | 1339 { |
1333 Frame* mainFrame = m_mainFrame->coreFrame(); | 1340 Frame* mainFrame = m_mainFrame->coreFrame(); |
1334 Document* mainFrameDocument = mainFrame->document(); | 1341 Document* mainFrameDocument = mainFrame->document(); |
1335 if (!mainFrameDocument) | 1342 if (!mainFrameDocument) |
1336 return; | 1343 return; |
1337 | 1344 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), WTFMove(sandboxExtens
ionHandle)); | 1388 m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), WTFMove(sandboxExtens
ionHandle)); |
1382 corePage()->userInputBridge().reloadFrame(m_mainFrame->coreFrame(), OptionSe
t<ReloadOption>::fromRaw(reloadOptions)); | 1389 corePage()->userInputBridge().reloadFrame(m_mainFrame->coreFrame(), OptionSe
t<ReloadOption>::fromRaw(reloadOptions)); |
1383 | 1390 |
1384 if (m_pendingNavigationID) { | 1391 if (m_pendingNavigationID) { |
1385 // This can happen if FrameLoader::reload() returns early because the do
cument URL is empty. | 1392 // This can happen if FrameLoader::reload() returns early because the do
cument URL is empty. |
1386 // The reload does nothing so we need to reset the pending navigation. S
ee webkit.org/b/153210. | 1393 // The reload does nothing so we need to reset the pending navigation. S
ee webkit.org/b/153210. |
1387 m_pendingNavigationID = 0; | 1394 m_pendingNavigationID = 0; |
1388 } | 1395 } |
1389 } | 1396 } |
1390 | 1397 |
1391 void WebPage::goToBackForwardItem(uint64_t navigationID, uint64_t backForwardIte
mID, FrameLoadType backForwardType, NavigationPolicyCheck navigationPolicyCheck) | 1398 void WebPage::goToBackForwardItem(uint64_t navigationID, const BackForwardItemId
entifier& backForwardItemID, FrameLoadType backForwardType, NavigationPolicyChec
k navigationPolicyCheck) |
1392 { | 1399 { |
1393 SendStopResponsivenessTimer stopper; | 1400 SendStopResponsivenessTimer stopper; |
1394 | 1401 |
1395 ASSERT(isBackForwardLoadType(backForwardType)); | 1402 ASSERT(isBackForwardLoadType(backForwardType)); |
1396 | 1403 |
1397 HistoryItem* item = WebBackForwardListProxy::itemForID(backForwardItemID); | 1404 HistoryItem* item = WebBackForwardListProxy::itemForID(backForwardItemID); |
1398 ASSERT(item); | 1405 ASSERT(item); |
1399 if (!item) | 1406 if (!item) |
1400 return; | 1407 return; |
1401 | 1408 |
1402 LOG(Loading, "In WebProcess, WebPage %" PRIu64 " is navigating to back/forwa
rd URL %s", m_pageID, item->url().string().utf8().data()); | 1409 LOG(Loading, "In WebProcess pid %i, WebPage %" PRIu64 " is navigating to bac
k/forward URL %s", getCurrentProcessID(), m_pageID, item->url().string().utf8().
data()); |
1403 | 1410 |
1404 ASSERT(!m_pendingNavigationID); | 1411 ASSERT(!m_pendingNavigationID); |
1405 m_pendingNavigationID = navigationID; | 1412 m_pendingNavigationID = navigationID; |
1406 | 1413 |
1407 m_page->goToItem(*item, backForwardType, navigationPolicyCheck); | 1414 m_page->goToItem(*item, backForwardType, navigationPolicyCheck); |
1408 } | 1415 } |
1409 | 1416 |
1410 void WebPage::tryRestoreScrollPosition() | 1417 void WebPage::tryRestoreScrollPosition() |
1411 { | 1418 { |
1412 m_page->mainFrame().loader().history().restoreScrollPositionAndViewState(); | 1419 m_page->mainFrame().loader().history().restoreScrollPositionAndViewState(); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 float WebPage::deviceScaleFactor() const | 1731 float WebPage::deviceScaleFactor() const |
1725 { | 1732 { |
1726 return m_page->deviceScaleFactor(); | 1733 return m_page->deviceScaleFactor(); |
1727 } | 1734 } |
1728 | 1735 |
1729 void WebPage::accessibilitySettingsDidChange() | 1736 void WebPage::accessibilitySettingsDidChange() |
1730 { | 1737 { |
1731 m_page->accessibilitySettingsDidChange(); | 1738 m_page->accessibilitySettingsDidChange(); |
1732 } | 1739 } |
1733 | 1740 |
| 1741 #if ENABLE(ACCESSIBILITY_EVENTS) |
| 1742 void WebPage::updateAccessibilityEventsEnabled(bool enabled) |
| 1743 { |
| 1744 m_page->settings().setAccessibilityEventsEnabled(enabled); |
| 1745 } |
| 1746 #endif |
| 1747 |
1734 void WebPage::setUseFixedLayout(bool fixed) | 1748 void WebPage::setUseFixedLayout(bool fixed) |
1735 { | 1749 { |
1736 // Do not overwrite current settings if initially setting it to false. | 1750 // Do not overwrite current settings if initially setting it to false. |
1737 if (m_useFixedLayout == fixed) | 1751 if (m_useFixedLayout == fixed) |
1738 return; | 1752 return; |
1739 m_useFixedLayout = fixed; | 1753 m_useFixedLayout = fixed; |
1740 | 1754 |
1741 #if !PLATFORM(IOS) | 1755 #if !PLATFORM(IOS) |
1742 m_page->settings().setFixedElementsLayoutRelativeToFrame(fixed); | 1756 m_page->settings().setFixedElementsLayoutRelativeToFrame(fixed); |
1743 #endif | 1757 #endif |
1744 #if USE(COORDINATED_GRAPHICS) | |
1745 m_page->settings().setAcceleratedCompositingForFixedPositionEnabled(fixed); | |
1746 m_page->settings().setDelegatesPageScaling(fixed); | |
1747 m_page->settings().setScrollingCoordinatorEnabled(fixed); | |
1748 #endif | |
1749 | |
1750 #if USE(COORDINATED_GRAPHICS) && ENABLE(SMOOTH_SCROLLING) | |
1751 // Delegated scrolling will be enabled when the FrameView is created if fixe
d layout is enabled. | |
1752 // Ensure we don't do animated scrolling in the WebProcess in that case. | |
1753 m_page->settings().setScrollAnimatorEnabled(!fixed); | |
1754 #endif | |
1755 | 1758 |
1756 FrameView* view = mainFrameView(); | 1759 FrameView* view = mainFrameView(); |
1757 if (!view) | 1760 if (!view) |
1758 return; | 1761 return; |
1759 | 1762 |
1760 #if USE(COORDINATED_GRAPHICS) | |
1761 view->setDelegatesScrolling(fixed); | |
1762 view->setPaintsEntireContents(fixed); | |
1763 #endif | |
1764 view->setUseFixedLayout(fixed); | 1763 view->setUseFixedLayout(fixed); |
1765 if (!fixed) | 1764 if (!fixed) |
1766 setFixedLayoutSize(IntSize()); | 1765 setFixedLayoutSize(IntSize()); |
1767 | 1766 |
1768 send(Messages::WebPageProxy::UseFixedLayoutDidChange(fixed)); | 1767 send(Messages::WebPageProxy::UseFixedLayoutDidChange(fixed)); |
1769 } | 1768 } |
1770 | 1769 |
1771 bool WebPage::setFixedLayoutSize(const IntSize& size) | 1770 bool WebPage::setFixedLayoutSize(const IntSize& size) |
1772 { | 1771 { |
1773 FrameView* view = mainFrameView(); | 1772 FrameView* view = mainFrameView(); |
1774 if (!view || view->fixedLayoutSize() == size) | 1773 if (!view || view->fixedLayoutSize() == size) |
1775 return false; | 1774 return false; |
1776 | 1775 |
1777 LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " setFixed
LayoutSize " << size); | 1776 LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " setFixed
LayoutSize " << size); |
1778 view->setFixedLayoutSize(size); | 1777 view->setFixedLayoutSize(size); |
1779 | 1778 |
1780 send(Messages::WebPageProxy::FixedLayoutSizeDidChange(size)); | 1779 send(Messages::WebPageProxy::FixedLayoutSizeDidChange(size)); |
1781 return true; | 1780 return true; |
1782 } | 1781 } |
1783 | 1782 |
1784 IntSize WebPage::fixedLayoutSize() const | 1783 IntSize WebPage::fixedLayoutSize() const |
1785 { | 1784 { |
1786 FrameView* view = mainFrameView(); | 1785 FrameView* view = mainFrameView(); |
1787 if (!view) | 1786 if (!view) |
1788 return IntSize(); | 1787 return IntSize(); |
1789 return view->fixedLayoutSize(); | 1788 return view->fixedLayoutSize(); |
| 1789 } |
| 1790 |
| 1791 void WebPage::disabledAdaptationsDidChange(const OptionSet<DisabledAdaptations>&
disabledAdaptations) |
| 1792 { |
| 1793 #if PLATFORM(IOS) |
| 1794 if (m_viewportConfiguration.setDisabledAdaptations(disabledAdaptations)) |
| 1795 viewportConfigurationChanged(); |
| 1796 #else |
| 1797 UNUSED_PARAM(disabledAdaptations); |
| 1798 #endif |
1790 } | 1799 } |
1791 | 1800 |
1792 void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum
ents) | 1801 void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum
ents) |
1793 { | 1802 { |
1794 #if PLATFORM(IOS) | 1803 #if PLATFORM(IOS) |
1795 if (m_viewportConfiguration.setViewportArguments(viewportArguments)) | 1804 if (m_viewportConfiguration.setViewportArguments(viewportArguments)) |
1796 viewportConfigurationChanged(); | 1805 viewportConfigurationChanged(); |
1797 #endif | 1806 #endif |
1798 | 1807 |
1799 #if USE(COORDINATED_GRAPHICS) | 1808 #if USE(COORDINATED_GRAPHICS) |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2152 send(Messages::WebPageProxy::PageDidScroll()); | 2161 send(Messages::WebPageProxy::PageDidScroll()); |
2153 } | 2162 } |
2154 | 2163 |
2155 void WebPage::pageStoppedScrolling() | 2164 void WebPage::pageStoppedScrolling() |
2156 { | 2165 { |
2157 // Maintain the current history item's scroll position up-to-date. | 2166 // Maintain the current history item's scroll position up-to-date. |
2158 if (Frame* frame = m_mainFrame->coreFrame()) | 2167 if (Frame* frame = m_mainFrame->coreFrame()) |
2159 frame->loader().history().saveScrollPositionAndViewStateToItem(frame->lo
ader().history().currentItem()); | 2168 frame->loader().history().saveScrollPositionAndViewStateToItem(frame->lo
ader().history().currentItem()); |
2160 } | 2169 } |
2161 | 2170 |
2162 #if USE(COORDINATED_GRAPHICS) | |
2163 void WebPage::pageDidRequestScroll(const IntPoint& point) | |
2164 { | |
2165 #if USE(COORDINATED_GRAPHICS_THREADED) | |
2166 drawingArea()->scroll(IntRect(point, IntSize()), IntSize()); | |
2167 #endif | |
2168 } | |
2169 #endif | |
2170 | |
2171 #if ENABLE(CONTEXT_MENUS) | 2171 #if ENABLE(CONTEXT_MENUS) |
2172 WebContextMenu* WebPage::contextMenu() | 2172 WebContextMenu* WebPage::contextMenu() |
2173 { | 2173 { |
2174 if (!m_contextMenu) | 2174 if (!m_contextMenu) |
2175 m_contextMenu = WebContextMenu::create(this); | 2175 m_contextMenu = WebContextMenu::create(this); |
2176 return m_contextMenu.get(); | 2176 return m_contextMenu.get(); |
2177 } | 2177 } |
2178 | 2178 |
2179 WebContextMenu* WebPage::contextMenuAtPointInWindow(const IntPoint& point) | 2179 WebContextMenu* WebPage::contextMenuAtPointInWindow(const IntPoint& point) |
2180 { | 2180 { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 } | 2476 } |
2477 | 2477 |
2478 send(Messages::WebPageProxy::ValidateCommandCallback(commandName, isEnabled,
state, callbackID)); | 2478 send(Messages::WebPageProxy::ValidateCommandCallback(commandName, isEnabled,
state, callbackID)); |
2479 } | 2479 } |
2480 | 2480 |
2481 void WebPage::executeEditCommand(const String& commandName, const String& argume
nt) | 2481 void WebPage::executeEditCommand(const String& commandName, const String& argume
nt) |
2482 { | 2482 { |
2483 executeEditingCommand(commandName, argument); | 2483 executeEditingCommand(commandName, argument); |
2484 } | 2484 } |
2485 | 2485 |
2486 void WebPage::restoreSessionInternal(const Vector<BackForwardListItemState>& ite
mStates, WasRestoredByAPIRequest restoredByAPIRequest) | 2486 void WebPage::restoreSessionInternal(const Vector<BackForwardListItemState>& ite
mStates, WasRestoredByAPIRequest restoredByAPIRequest, WebBackForwardListProxy::
OverwriteExistingItem overwrite) |
2487 { | 2487 { |
2488 for (const auto& itemState : itemStates) { | 2488 for (const auto& itemState : itemStates) { |
2489 auto historyItem = toHistoryItem(itemState.pageState); | 2489 auto historyItem = toHistoryItem(itemState); |
2490 historyItem->setWasRestoredFromSession(restoredByAPIRequest == WasRestor
edByAPIRequest::Yes); | 2490 historyItem->setWasRestoredFromSession(restoredByAPIRequest == WasRestor
edByAPIRequest::Yes); |
2491 static_cast<WebBackForwardListProxy*>(corePage()->backForward().client()
)->addItemFromUIProcess(itemState.identifier, WTFMove(historyItem), m_pageID); | 2491 static_cast<WebBackForwardListProxy*>(corePage()->backForward().client()
)->addItemFromUIProcess(itemState.identifier, WTFMove(historyItem), m_pageID, ov
erwrite); |
2492 } | 2492 } |
2493 } | 2493 } |
2494 | 2494 |
2495 void WebPage::restoreSession(const Vector<BackForwardListItemState>& itemStates) | 2495 void WebPage::restoreSession(const Vector<BackForwardListItemState>& itemStates) |
2496 { | 2496 { |
2497 restoreSessionInternal(itemStates, WasRestoredByAPIRequest::Yes); | 2497 restoreSessionInternal(itemStates, WasRestoredByAPIRequest::Yes, WebBackForw
ardListProxy::OverwriteExistingItem::No); |
| 2498 } |
| 2499 |
| 2500 void WebPage::updateBackForwardListForReattach(const Vector<WebKit::BackForwardL
istItemState>& itemStates) |
| 2501 { |
| 2502 restoreSessionInternal(itemStates, WasRestoredByAPIRequest::No, WebBackForwa
rdListProxy::OverwriteExistingItem::Yes); |
2498 } | 2503 } |
2499 | 2504 |
2500 #if ENABLE(TOUCH_EVENTS) | 2505 #if ENABLE(TOUCH_EVENTS) |
2501 static bool handleTouchEvent(const WebTouchEvent& touchEvent, Page* page) | 2506 static bool handleTouchEvent(const WebTouchEvent& touchEvent, Page* page) |
2502 { | 2507 { |
2503 if (!page->mainFrame().view()) | 2508 if (!page->mainFrame().view()) |
2504 return false; | 2509 return false; |
2505 | 2510 |
2506 return page->mainFrame().eventHandler().handleTouchEvent(platform(touchEvent
)); | 2511 return page->mainFrame().eventHandler().handleTouchEvent(platform(touchEvent
)); |
2507 } | 2512 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2705 return; | 2710 return; |
2706 | 2711 |
2707 SetForScope<bool> userIsInteractingChange { m_userIsInteracting, true }; | 2712 SetForScope<bool> userIsInteractingChange { m_userIsInteracting, true }; |
2708 | 2713 |
2709 Frame& frame = m_page->focusController().focusedOrMainFrame(); | 2714 Frame& frame = m_page->focusController().focusedOrMainFrame(); |
2710 frame.document()->setFocusedElement(0); | 2715 frame.document()->setFocusedElement(0); |
2711 | 2716 |
2712 if (isKeyboardEventValid && event.type() == WebEvent::KeyDown) { | 2717 if (isKeyboardEventValid && event.type() == WebEvent::KeyDown) { |
2713 PlatformKeyboardEvent platformEvent(platform(event)); | 2718 PlatformKeyboardEvent platformEvent(platform(event)); |
2714 platformEvent.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown); | 2719 platformEvent.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown); |
2715 m_page->focusController().setInitialFocus(forward ? FocusDirectionForwar
d : FocusDirectionBackward, &KeyboardEvent::create(platformEvent, frame.document
()->defaultView()).get()); | 2720 m_page->focusController().setInitialFocus(forward ? FocusDirectionForwar
d : FocusDirectionBackward, &KeyboardEvent::create(platformEvent, &frame.windowP
roxy()).get()); |
2716 | 2721 |
2717 send(Messages::WebPageProxy::VoidCallback(callbackID)); | 2722 send(Messages::WebPageProxy::VoidCallback(callbackID)); |
2718 return; | 2723 return; |
2719 } | 2724 } |
2720 | 2725 |
2721 m_page->focusController().setInitialFocus(forward ? FocusDirectionForward :
FocusDirectionBackward, nullptr); | 2726 m_page->focusController().setInitialFocus(forward ? FocusDirectionForward :
FocusDirectionBackward, nullptr); |
2722 send(Messages::WebPageProxy::VoidCallback(callbackID)); | 2727 send(Messages::WebPageProxy::VoidCallback(callbackID)); |
2723 } | 2728 } |
2724 | 2729 |
2725 void WebPage::setCanStartMediaTimerFired() | 2730 void WebPage::setCanStartMediaTimerFired() |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2816 } | 2821 } |
2817 | 2822 |
2818 void WebPage::continueWillSubmitForm(uint64_t frameID, uint64_t listenerID) | 2823 void WebPage::continueWillSubmitForm(uint64_t frameID, uint64_t listenerID) |
2819 { | 2824 { |
2820 WebFrame* frame = WebProcess::singleton().webFrame(frameID); | 2825 WebFrame* frame = WebProcess::singleton().webFrame(frameID); |
2821 if (!frame) | 2826 if (!frame) |
2822 return; | 2827 return; |
2823 frame->continueWillSubmitForm(listenerID); | 2828 frame->continueWillSubmitForm(listenerID); |
2824 } | 2829 } |
2825 | 2830 |
2826 void WebPage::didStartNavigationPolicyCheck() | |
2827 { | |
2828 m_drawingArea->setLayerTreeStateIsFrozen(true); | |
2829 } | |
2830 | |
2831 void WebPage::didCompleteNavigationPolicyCheck() | |
2832 { | |
2833 m_drawingArea->setLayerTreeStateIsFrozen(false); | |
2834 } | |
2835 | |
2836 void WebPage::didStartPageTransition() | 2831 void WebPage::didStartPageTransition() |
2837 { | 2832 { |
2838 m_drawingArea->setLayerTreeStateIsFrozen(true); | 2833 m_drawingArea->setLayerTreeStateIsFrozen(true); |
2839 | 2834 |
2840 #if PLATFORM(MAC) | 2835 #if PLATFORM(MAC) |
2841 bool hasPreviouslyFocusedDueToUserInteraction = m_hasEverFocusedElementDueTo
UserInteractionSincePageTransition; | 2836 bool hasPreviouslyFocusedDueToUserInteraction = m_hasEverFocusedElementDueTo
UserInteractionSincePageTransition; |
2842 #endif | 2837 #endif |
2843 m_hasEverFocusedElementDueToUserInteractionSincePageTransition = false; | 2838 m_hasEverFocusedElementDueToUserInteractionSincePageTransition = false; |
2844 m_isAssistingNodeDueToUserInteraction = false; | 2839 m_isAssistingNodeDueToUserInteraction = false; |
2845 m_lastEditorStateWasContentEditable = EditorStateIsContentEditable::Unset; | 2840 m_lastEditorStateWasContentEditable = EditorStateIsContentEditable::Unset; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3178 #endif | 3173 #endif |
3179 | 3174 |
3180 #if ENABLE(SERVICE_WORKER) | 3175 #if ENABLE(SERVICE_WORKER) |
3181 if (store.getBoolValueForKey(WebPreferencesKey::serviceWorkersEnabledKey()))
{ | 3176 if (store.getBoolValueForKey(WebPreferencesKey::serviceWorkersEnabledKey()))
{ |
3182 ASSERT(parentProcessHasServiceWorkerEntitlement()); | 3177 ASSERT(parentProcessHasServiceWorkerEntitlement()); |
3183 if (!parentProcessHasServiceWorkerEntitlement()) | 3178 if (!parentProcessHasServiceWorkerEntitlement()) |
3184 RuntimeEnabledFeatures::sharedFeatures().setServiceWorkerEnabled(fal
se); | 3179 RuntimeEnabledFeatures::sharedFeatures().setServiceWorkerEnabled(fal
se); |
3185 } | 3180 } |
3186 #endif | 3181 #endif |
3187 | 3182 |
| 3183 settings.setLayoutViewportHeightExpansionFactor(store.getDoubleValueForKey(W
ebPreferencesKey::layoutViewportHeightExpansionFactorKey())); |
| 3184 |
3188 if (m_drawingArea) | 3185 if (m_drawingArea) |
3189 m_drawingArea->updatePreferences(store); | 3186 m_drawingArea->updatePreferences(store); |
3190 } | 3187 } |
3191 | 3188 |
3192 #if ENABLE(DATA_DETECTION) | 3189 #if ENABLE(DATA_DETECTION) |
3193 void WebPage::setDataDetectionResults(NSArray *detectionResults) | 3190 void WebPage::setDataDetectionResults(NSArray *detectionResults) |
3194 { | 3191 { |
3195 DataDetectionResult dataDetectionResult; | 3192 DataDetectionResult dataDetectionResult; |
3196 dataDetectionResult.results = detectionResults; | 3193 dataDetectionResult.results = detectionResults; |
3197 send(Messages::WebPageProxy::SetDataDetectionResult(dataDetectionResult)); | 3194 send(Messages::WebPageProxy::SetDataDetectionResult(dataDetectionResult)); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3273 | 3270 |
3274 RemoteWebInspectorUI* WebPage::remoteInspectorUI() | 3271 RemoteWebInspectorUI* WebPage::remoteInspectorUI() |
3275 { | 3272 { |
3276 if (m_isClosed) | 3273 if (m_isClosed) |
3277 return nullptr; | 3274 return nullptr; |
3278 if (!m_remoteInspectorUI) | 3275 if (!m_remoteInspectorUI) |
3279 m_remoteInspectorUI = RemoteWebInspectorUI::create(*this); | 3276 m_remoteInspectorUI = RemoteWebInspectorUI::create(*this); |
3280 return m_remoteInspectorUI.get(); | 3277 return m_remoteInspectorUI.get(); |
3281 } | 3278 } |
3282 | 3279 |
| 3280 void WebPage::inspectorFrontendCountChanged(unsigned count) |
| 3281 { |
| 3282 send(Messages::WebPageProxy::DidChangeInspectorFrontendCount(count)); |
| 3283 } |
| 3284 |
3283 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATIO
N_MODE)) | 3285 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATIO
N_MODE)) |
3284 PlaybackSessionManager& WebPage::playbackSessionManager() | 3286 PlaybackSessionManager& WebPage::playbackSessionManager() |
3285 { | 3287 { |
3286 if (!m_playbackSessionManager) | 3288 if (!m_playbackSessionManager) |
3287 m_playbackSessionManager = PlaybackSessionManager::create(*this); | 3289 m_playbackSessionManager = PlaybackSessionManager::create(*this); |
3288 return *m_playbackSessionManager; | 3290 return *m_playbackSessionManager; |
3289 } | 3291 } |
3290 | 3292 |
3291 VideoFullscreenManager& WebPage::videoFullscreenManager() | 3293 VideoFullscreenManager& WebPage::videoFullscreenManager() |
3292 { | 3294 { |
(...skipping 11 matching lines...) Expand all Loading... |
3304 #endif | 3306 #endif |
3305 | 3307 |
3306 #if ENABLE(FULLSCREEN_API) | 3308 #if ENABLE(FULLSCREEN_API) |
3307 WebFullScreenManager* WebPage::fullScreenManager() | 3309 WebFullScreenManager* WebPage::fullScreenManager() |
3308 { | 3310 { |
3309 if (!m_fullScreenManager) | 3311 if (!m_fullScreenManager) |
3310 m_fullScreenManager = WebFullScreenManager::create(this); | 3312 m_fullScreenManager = WebFullScreenManager::create(this); |
3311 return m_fullScreenManager.get(); | 3313 return m_fullScreenManager.get(); |
3312 } | 3314 } |
3313 #endif | 3315 #endif |
| 3316 |
| 3317 void WebPage::addConsoleMessage(uint64_t frameID, MessageSource messageSource, M
essageLevel messageLevel, const String& message, uint64_t requestID) |
| 3318 { |
| 3319 if (auto* frame = WebProcess::singleton().webFrame(frameID)) |
| 3320 frame->addConsoleMessage(messageSource, messageLevel, message, requestID
); |
| 3321 } |
| 3322 |
| 3323 void WebPage::sendCSPViolationReport(uint64_t frameID, const WebCore::URL& repor
tURL, IPC::FormDataReference&& reportData) |
| 3324 { |
| 3325 auto report = reportData.takeData(); |
| 3326 if (!report) |
| 3327 return; |
| 3328 if (auto* frame = WebProcess::singleton().webFrame(frameID)) |
| 3329 PingLoader::sendViolationReport(*frame->coreFrame(), reportURL, report.r
eleaseNonNull(), ViolationReportType::ContentSecurityPolicy); |
| 3330 } |
3314 | 3331 |
3315 NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana
ger() | 3332 NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana
ger() |
3316 { | 3333 { |
3317 if (m_notificationPermissionRequestManager) | 3334 if (m_notificationPermissionRequestManager) |
3318 return m_notificationPermissionRequestManager.get(); | 3335 return m_notificationPermissionRequestManager.get(); |
3319 | 3336 |
3320 m_notificationPermissionRequestManager = NotificationPermissionRequestManage
r::create(this); | 3337 m_notificationPermissionRequestManager = NotificationPermissionRequestManage
r::create(this); |
3321 return m_notificationPermissionRequestManager.get(); | 3338 return m_notificationPermissionRequestManager.get(); |
3322 } | 3339 } |
3323 | 3340 |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4073 return true; | 4090 return true; |
4074 | 4091 |
4075 return platformHasLocalDataForURL(url); | 4092 return platformHasLocalDataForURL(url); |
4076 } | 4093 } |
4077 | 4094 |
4078 void WebPage::setCustomTextEncodingName(const String& encoding) | 4095 void WebPage::setCustomTextEncodingName(const String& encoding) |
4079 { | 4096 { |
4080 m_page->mainFrame().loader().reloadWithOverrideEncoding(encoding); | 4097 m_page->mainFrame().loader().reloadWithOverrideEncoding(encoding); |
4081 } | 4098 } |
4082 | 4099 |
4083 void WebPage::didRemoveBackForwardItem(uint64_t itemID) | 4100 void WebPage::didRemoveBackForwardItem(const BackForwardItemIdentifier& itemID) |
4084 { | 4101 { |
4085 WebBackForwardListProxy::removeItem(itemID); | 4102 WebBackForwardListProxy::removeItem(itemID); |
4086 } | 4103 } |
4087 | 4104 |
4088 #if PLATFORM(COCOA) | 4105 #if PLATFORM(COCOA) |
4089 | 4106 |
4090 bool WebPage::isSpeaking() | 4107 bool WebPage::isSpeaking() |
4091 { | 4108 { |
4092 bool result; | 4109 bool result; |
4093 return sendSync(Messages::WebPageProxy::GetIsSpeaking(), Messages::WebPagePr
oxy::GetIsSpeaking::Reply(result)) && result; | 4110 return sendSync(Messages::WebPageProxy::GetIsSpeaking(), Messages::WebPagePr
oxy::GetIsSpeaking::Reply(result)) && result; |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4591 | 4608 |
4592 // If a plug-in exists that claims to support this response, it should take
precedence over the custom content provider. | 4609 // If a plug-in exists that claims to support this response, it should take
precedence over the custom content provider. |
4593 // canPluginHandleResponse() is called last because it performs synchronous
IPC. | 4610 // canPluginHandleResponse() is called last because it performs synchronous
IPC. |
4594 return m_mimeTypesWithCustomContentProviders.contains(mimeType) && !canPlugi
nHandleResponse(response); | 4611 return m_mimeTypesWithCustomContentProviders.contains(mimeType) && !canPlugi
nHandleResponse(response); |
4595 } | 4612 } |
4596 | 4613 |
4597 #if PLATFORM(COCOA) | 4614 #if PLATFORM(COCOA) |
4598 | 4615 |
4599 void WebPage::setTextAsync(const String& text) | 4616 void WebPage::setTextAsync(const String& text) |
4600 { | 4617 { |
| 4618 auto frame = makeRef(m_page->focusController().focusedOrMainFrame()); |
| 4619 if (frame->selection().selection().isContentEditable()) { |
| 4620 UserTypingGestureIndicator indicator(frame.get()); |
| 4621 frame->selection().selectAll(); |
| 4622 frame->editor().insertText(text, nullptr, TextEventInputKeyboard); |
| 4623 return; |
| 4624 } |
| 4625 |
4601 if (is<HTMLInputElement>(m_assistedNode.get())) { | 4626 if (is<HTMLInputElement>(m_assistedNode.get())) { |
4602 downcast<HTMLInputElement>(*m_assistedNode).setValueForUser(text); | 4627 downcast<HTMLInputElement>(*m_assistedNode).setValueForUser(text); |
4603 return; | 4628 return; |
4604 } | 4629 } |
4605 | 4630 |
4606 auto frame = makeRef(m_page->focusController().focusedOrMainFrame()); | 4631 ASSERT_NOT_REACHED(); |
4607 if (!frame->selection().selection().isContentEditable()) | |
4608 return; | |
4609 | |
4610 frame->selection().selectAll(); | |
4611 frame->editor().insertText(text, nullptr, TextEventInputKeyboard); | |
4612 } | 4632 } |
4613 | 4633 |
4614 void WebPage::insertTextAsync(const String& text, const EditingRange& replacemen
tEditingRange, bool registerUndoGroup, uint32_t editingRangeIsRelativeTo, bool s
uppressSelectionUpdate) | 4634 void WebPage::insertTextAsync(const String& text, const EditingRange& replacemen
tEditingRange, bool registerUndoGroup, uint32_t editingRangeIsRelativeTo, bool s
uppressSelectionUpdate) |
4615 { | 4635 { |
4616 Frame& frame = m_page->focusController().focusedOrMainFrame(); | 4636 Frame& frame = m_page->focusController().focusedOrMainFrame(); |
4617 | 4637 |
4618 Ref<Frame> protector(frame); | 4638 Ref<Frame> protector(frame); |
4619 | 4639 |
4620 bool replacesText = false; | 4640 bool replacesText = false; |
4621 if (replacementEditingRange.location != notFound) { | 4641 if (replacementEditingRange.location != notFound) { |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5002 if (alwaysShowsVerticalScroller == m_alwaysShowsVerticalScroller) | 5022 if (alwaysShowsVerticalScroller == m_alwaysShowsVerticalScroller) |
5003 return; | 5023 return; |
5004 | 5024 |
5005 m_alwaysShowsVerticalScroller = alwaysShowsVerticalScroller; | 5025 m_alwaysShowsVerticalScroller = alwaysShowsVerticalScroller; |
5006 auto view = corePage()->mainFrame().view(); | 5026 auto view = corePage()->mainFrame().view(); |
5007 if (!alwaysShowsVerticalScroller) | 5027 if (!alwaysShowsVerticalScroller) |
5008 view->setVerticalScrollbarLock(false); | 5028 view->setVerticalScrollbarLock(false); |
5009 view->setVerticalScrollbarMode(alwaysShowsVerticalScroller ? ScrollbarAlways
On : m_mainFrameIsScrollable ? ScrollbarAuto : ScrollbarAlwaysOff, alwaysShowsVe
rticalScroller || !m_mainFrameIsScrollable); | 5029 view->setVerticalScrollbarMode(alwaysShowsVerticalScroller ? ScrollbarAlways
On : m_mainFrameIsScrollable ? ScrollbarAuto : ScrollbarAlwaysOff, alwaysShowsVe
rticalScroller || !m_mainFrameIsScrollable); |
5010 } | 5030 } |
5011 | 5031 |
5012 void WebPage::setMinimumLayoutSize(const IntSize& minimumLayoutSize) | 5032 void WebPage::setViewLayoutSize(const IntSize& viewLayoutSize) |
5013 { | 5033 { |
5014 if (m_minimumLayoutSize == minimumLayoutSize) | 5034 if (m_viewLayoutSize == viewLayoutSize) |
5015 return; | 5035 return; |
5016 | 5036 |
5017 m_minimumLayoutSize = minimumLayoutSize; | 5037 m_viewLayoutSize = viewLayoutSize; |
5018 if (minimumLayoutSize.width() <= 0) { | 5038 if (viewLayoutSize.width() <= 0) { |
5019 corePage()->mainFrame().view()->enableAutoSizeMode(false, IntSize(), Int
Size()); | 5039 corePage()->mainFrame().view()->enableAutoSizeMode(false, IntSize(), Int
Size()); |
5020 return; | 5040 return; |
5021 } | 5041 } |
5022 | 5042 |
5023 int minimumLayoutWidth = minimumLayoutSize.width(); | 5043 int viewLayoutWidth = viewLayoutSize.width(); |
5024 int minimumLayoutHeight = std::max(minimumLayoutSize.height(), 1); | 5044 int viewLayoutHeight = std::max(viewLayoutSize.height(), 1); |
5025 | 5045 |
5026 int maximumSize = std::numeric_limits<int>::max(); | 5046 int maximumSize = std::numeric_limits<int>::max(); |
5027 | 5047 |
5028 corePage()->mainFrame().view()->enableAutoSizeMode(true, IntSize(minimumLayo
utWidth, minimumLayoutHeight), IntSize(maximumSize, maximumSize)); | 5048 corePage()->mainFrame().view()->enableAutoSizeMode(true, IntSize(viewLayoutW
idth, viewLayoutHeight), IntSize(maximumSize, maximumSize)); |
5029 } | 5049 } |
5030 | 5050 |
5031 void WebPage::setAutoSizingShouldExpandToViewHeight(bool shouldExpand) | 5051 void WebPage::setAutoSizingShouldExpandToViewHeight(bool shouldExpand) |
5032 { | 5052 { |
5033 if (m_autoSizingShouldExpandToViewHeight == shouldExpand) | 5053 if (m_autoSizingShouldExpandToViewHeight == shouldExpand) |
5034 return; | 5054 return; |
5035 | 5055 |
5036 m_autoSizingShouldExpandToViewHeight = shouldExpand; | 5056 m_autoSizingShouldExpandToViewHeight = shouldExpand; |
5037 | 5057 |
5038 corePage()->mainFrame().view()->setAutoSizeFixedMinimumHeight(shouldExpand ?
m_viewSize.height() : 0); | 5058 corePage()->mainFrame().view()->setAutoSizeFixedMinimumHeight(shouldExpand ?
m_viewSize.height() : 0); |
(...skipping 28 matching lines...) Expand all Loading... |
5067 } | 5087 } |
5068 | 5088 |
5069 void WebPage::setSelectTrailingWhitespaceEnabled(bool enabled) | 5089 void WebPage::setSelectTrailingWhitespaceEnabled(bool enabled) |
5070 { | 5090 { |
5071 if (m_page->settings().selectTrailingWhitespaceEnabled() != enabled) { | 5091 if (m_page->settings().selectTrailingWhitespaceEnabled() != enabled) { |
5072 m_page->settings().setSelectTrailingWhitespaceEnabled(enabled); | 5092 m_page->settings().setSelectTrailingWhitespaceEnabled(enabled); |
5073 setSmartInsertDeleteEnabled(!enabled); | 5093 setSmartInsertDeleteEnabled(!enabled); |
5074 } | 5094 } |
5075 } | 5095 } |
5076 | 5096 |
5077 bool WebPage::canShowMIMEType(const String& MIMEType) const | 5097 bool WebPage::canShowResponse(const WebCore::ResourceResponse& response) const |
5078 { | 5098 { |
5079 if (MIMETypeRegistry::canShowMIMEType(MIMEType)) | 5099 return canShowMIMEType(response.mimeType(), [&](auto& mimeType, auto allowed
Plugins) { |
| 5100 return m_page->pluginData().supportsWebVisibleMimeTypeForURL(mimeType, a
llowedPlugins, response.url()); |
| 5101 }); |
| 5102 } |
| 5103 |
| 5104 bool WebPage::canShowMIMEType(const String& mimeType) const |
| 5105 { |
| 5106 return canShowMIMEType(mimeType, [&](auto& mimeType, auto allowedPlugins) { |
| 5107 return m_page->pluginData().supportsWebVisibleMimeType(mimeType, allowed
Plugins); |
| 5108 }); |
| 5109 } |
| 5110 |
| 5111 bool WebPage::canShowMIMEType(const String& mimeType, const Function<bool(const
String&, PluginData::AllowedPluginTypes)>& pluginsSupport) const |
| 5112 { |
| 5113 if (MIMETypeRegistry::canShowMIMEType(mimeType)) |
5080 return true; | 5114 return true; |
5081 | 5115 |
5082 if (!MIMEType.isNull() && m_mimeTypesWithCustomContentProviders.contains(MIM
EType)) | 5116 if (!mimeType.isNull() && m_mimeTypesWithCustomContentProviders.contains(mim
eType)) |
5083 return true; | 5117 return true; |
5084 | 5118 |
5085 const PluginData& pluginData = m_page->pluginData(); | 5119 if (corePage()->mainFrame().loader().subframeLoader().allowPlugins() && plug
insSupport(mimeType, PluginData::AllPlugins)) |
5086 if (pluginData.supportsWebVisibleMimeType(MIMEType, PluginData::AllPlugins)
&& corePage()->mainFrame().loader().subframeLoader().allowPlugins()) | |
5087 return true; | 5120 return true; |
5088 | 5121 |
5089 // We can use application plugins even if plugins aren't enabled. | 5122 // We can use application plugins even if plugins aren't enabled. |
5090 if (pluginData.supportsWebVisibleMimeType(MIMEType, PluginData::OnlyApplicat
ionPlugins)) | 5123 if (pluginsSupport(mimeType, PluginData::OnlyApplicationPlugins)) |
5091 return true; | 5124 return true; |
5092 | 5125 |
5093 return false; | 5126 return false; |
5094 } | 5127 } |
5095 | 5128 |
5096 void WebPage::addTextCheckingRequest(uint64_t requestID, Ref<TextCheckingRequest
>&& request) | 5129 void WebPage::addTextCheckingRequest(uint64_t requestID, Ref<TextCheckingRequest
>&& request) |
5097 { | 5130 { |
5098 m_pendingTextCheckingRequestMap.add(requestID, WTFMove(request)); | 5131 m_pendingTextCheckingRequestMap.add(requestID, WTFMove(request)); |
5099 } | 5132 } |
5100 | 5133 |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5864 ASSERT(handler); | 5897 ASSERT(handler); |
5865 | 5898 |
5866 handler->taskDidComplete(taskIdentifier, error); | 5899 handler->taskDidComplete(taskIdentifier, error); |
5867 } | 5900 } |
5868 | 5901 |
5869 void WebPage::setIsSuspended(bool suspended) | 5902 void WebPage::setIsSuspended(bool suspended) |
5870 { | 5903 { |
5871 m_isSuspended = suspended; | 5904 m_isSuspended = suspended; |
5872 } | 5905 } |
5873 | 5906 |
| 5907 void WebPage::frameBecameRemote(uint64_t frameID, GlobalFrameIdentifier&& remote
FrameIdentifier, GlobalWindowIdentifier&& remoteWindowIdentifier) |
| 5908 { |
| 5909 RefPtr<WebFrame> frame = WebProcess::singleton().webFrame(frameID); |
| 5910 if (!frame) |
| 5911 return; |
| 5912 |
| 5913 if (frame->page() != this) |
| 5914 return; |
| 5915 |
| 5916 auto* coreFrame = frame->coreFrame(); |
| 5917 auto* previousWindow = coreFrame->window(); |
| 5918 if (!previousWindow) |
| 5919 return; |
| 5920 |
| 5921 auto remoteFrame = RemoteFrame::create(WTFMove(remoteFrameIdentifier)); |
| 5922 auto remoteWindow = RemoteDOMWindow::create(remoteFrame.copyRef(), WTFMove(r
emoteWindowIdentifier)); |
| 5923 remoteWindow->setCrossOriginOptions(previousWindow->crossOriginOptions()); |
| 5924 |
| 5925 remoteFrame->setOpener(frame->coreFrame()->loader().opener()); |
| 5926 |
| 5927 auto jsWindowProxies = frame->coreFrame()->windowProxy().releaseJSWindowProx
ies(); |
| 5928 remoteFrame->windowProxy().setJSWindowProxies(WTFMove(jsWindowProxies)); |
| 5929 remoteFrame->windowProxy().setDOMWindow(remoteWindow.ptr()); |
| 5930 |
| 5931 coreFrame->setView(nullptr); |
| 5932 coreFrame->willDetachPage(); |
| 5933 coreFrame->detachFromPage(); |
| 5934 |
| 5935 if (frame->isMainFrame()) |
| 5936 close(); |
| 5937 } |
| 5938 |
5874 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) | 5939 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) |
5875 static uint64_t nextRequestStorageAccessContextId() | 5940 static uint64_t nextRequestStorageAccessContextId() |
5876 { | 5941 { |
5877 static uint64_t nextContextId = 0; | 5942 static uint64_t nextContextId = 0; |
5878 return ++nextContextId; | 5943 return ++nextContextId; |
5879 } | 5944 } |
5880 | 5945 |
5881 void WebPage::hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uin
t64_t frameID, uint64_t pageID, WTF::CompletionHandler<void (bool)>&& callback) | 5946 void WebPage::hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uin
t64_t frameID, CompletionHandler<void(bool)>&& callback) |
5882 { | 5947 { |
5883 auto contextId = nextRequestStorageAccessContextId(); | 5948 auto contextId = nextRequestStorageAccessContextId(); |
5884 auto addResult = m_storageAccessResponseCallbackMap.add(contextId, WTFMove(c
allback)); | 5949 auto addResult = m_storageAccessResponseCallbackMap.add(contextId, WTFMove(c
allback)); |
5885 ASSERT(addResult.isNewEntry); | 5950 ASSERT(addResult.isNewEntry); |
5886 if (addResult.iterator->value) | 5951 if (addResult.iterator->value) |
5887 send(Messages::WebPageProxy::HasStorageAccess(WTFMove(subFrameHost), WTF
Move(topFrameHost), frameID, pageID, contextId)); | 5952 send(Messages::WebPageProxy::HasStorageAccess(WTFMove(subFrameHost), WTF
Move(topFrameHost), frameID, contextId)); |
5888 else | 5953 else |
5889 callback(false); | 5954 callback(false); |
5890 } | 5955 } |
5891 ···· | 5956 ···· |
5892 void WebPage::requestStorageAccess(String&& subFrameHost, String&& topFrameHost,
uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void (bool)>&& callba
ck) | 5957 void WebPage::requestStorageAccess(String&& subFrameHost, String&& topFrameHost,
uint64_t frameID, CompletionHandler<void(bool)>&& callback) |
5893 { | 5958 { |
5894 auto contextId = nextRequestStorageAccessContextId(); | 5959 auto contextId = nextRequestStorageAccessContextId(); |
5895 auto addResult = m_storageAccessResponseCallbackMap.add(contextId, WTFMove(c
allback)); | 5960 auto addResult = m_storageAccessResponseCallbackMap.add(contextId, WTFMove(c
allback)); |
5896 ASSERT(addResult.isNewEntry); | 5961 ASSERT(addResult.isNewEntry); |
5897 if (addResult.iterator->value) | 5962 if (addResult.iterator->value) { |
5898 send(Messages::WebPageProxy::RequestStorageAccess(WTFMove(subFrameHost),
WTFMove(topFrameHost), frameID, pageID, contextId)); | 5963 bool promptEnabled = RuntimeEnabledFeatures::sharedFeatures().storageAcc
essPromptsEnabled(); |
5899 else | 5964 send(Messages::WebPageProxy::RequestStorageAccess(WTFMove(subFrameHost),
WTFMove(topFrameHost), frameID, contextId, promptEnabled)); |
| 5965 } else |
5900 callback(false); | 5966 callback(false); |
5901 } | 5967 } |
5902 | 5968 |
5903 void WebPage::storageAccessResponse(bool wasGranted, uint64_t contextId) | 5969 void WebPage::storageAccessResponse(bool wasGranted, uint64_t contextId) |
5904 { | 5970 { |
5905 auto callback = m_storageAccessResponseCallbackMap.take(contextId); | 5971 auto callback = m_storageAccessResponseCallbackMap.take(contextId); |
5906 ASSERT(callback); | 5972 ASSERT(callback); |
5907 callback(wasGranted); | 5973 callback(wasGranted); |
5908 } | 5974 } |
5909 #endif | 5975 #endif |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5982 } | 6048 } |
5983 | 6049 |
5984 void WebPage::didFinishLoadingApplicationManifest(uint64_t coreCallbackID, const
std::optional<WebCore::ApplicationManifest>& manifest) | 6050 void WebPage::didFinishLoadingApplicationManifest(uint64_t coreCallbackID, const
std::optional<WebCore::ApplicationManifest>& manifest) |
5985 { | 6051 { |
5986 auto callbackID = CallbackID::fromInteger(m_applicationManifestFetchCallback
Map.take(coreCallbackID)); | 6052 auto callbackID = CallbackID::fromInteger(m_applicationManifestFetchCallback
Map.take(coreCallbackID)); |
5987 send(Messages::WebPageProxy::ApplicationManifestCallback(manifest, callbackI
D)); | 6053 send(Messages::WebPageProxy::ApplicationManifestCallback(manifest, callbackI
D)); |
5988 } | 6054 } |
5989 #endif // ENABLE(APPLICATION_MANIFEST) | 6055 #endif // ENABLE(APPLICATION_MANIFEST) |
5990 | 6056 |
5991 } // namespace WebKit | 6057 } // namespace WebKit |
LEFT | RIGHT |