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 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 #endif | 197 #endif |
198 | 198 |
199 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) | 199 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) |
200 #include "PlaybackSessionManagerProxy.h" | 200 #include "PlaybackSessionManagerProxy.h" |
201 #endif | 201 #endif |
202 | 202 |
203 #if ENABLE(WEB_AUTHN) | 203 #if ENABLE(WEB_AUTHN) |
204 #include "WebCredentialsMessengerProxy.h" | 204 #include "WebCredentialsMessengerProxy.h" |
205 #endif | 205 #endif |
206 | 206 |
| 207 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) |
| 208 #include "WebResourceLoadStatisticsStore.h" |
| 209 #endif |
| 210 |
207 // This controls what strategy we use for mouse wheel coalescing. | 211 // This controls what strategy we use for mouse wheel coalescing. |
208 #define MERGE_WHEEL_EVENTS 1 | 212 #define MERGE_WHEEL_EVENTS 1 |
209 | 213 |
210 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_process->connec
tion()) | 214 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_process->connec
tion()) |
211 #define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFro
mWebProcess(url), m_process->connection()) | 215 #define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFro
mWebProcess(url), m_process->connection()) |
212 | 216 |
213 #define RELEASE_LOG_IF_ALLOWED(channel, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAll
owed(), channel, __VA_ARGS__) | 217 #define RELEASE_LOG_IF_ALLOWED(channel, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAll
owed(), channel, __VA_ARGS__) |
214 | 218 |
215 using namespace WebCore; | 219 using namespace WebCore; |
216 | 220 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 #endif | 431 #endif |
428 #if PLATFORM(IOS) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_
MODE)) | 432 #if PLATFORM(IOS) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_
MODE)) |
429 m_playbackSessionManager = PlaybackSessionManagerProxy::create(*this); | 433 m_playbackSessionManager = PlaybackSessionManagerProxy::create(*this); |
430 m_videoFullscreenManager = VideoFullscreenManagerProxy::create(*this, *m_pla
ybackSessionManager); | 434 m_videoFullscreenManager = VideoFullscreenManagerProxy::create(*this, *m_pla
ybackSessionManager); |
431 #endif | 435 #endif |
432 | 436 |
433 #if ENABLE(APPLE_PAY) | 437 #if ENABLE(APPLE_PAY) |
434 m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this); | 438 m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this); |
435 #endif | 439 #endif |
436 | 440 |
| 441 #if USE(SYSTEM_PREVIEW) |
437 m_systemPreviewController = std::make_unique<SystemPreviewController>(*this)
; | 442 m_systemPreviewController = std::make_unique<SystemPreviewController>(*this)
; |
| 443 #endif |
438 | 444 |
439 #if ENABLE(WEB_AUTHN) | 445 #if ENABLE(WEB_AUTHN) |
440 m_credentialsMessenger = std::make_unique<WebCredentialsMessengerProxy>(*thi
s); | 446 m_credentialsMessenger = std::make_unique<WebCredentialsMessengerProxy>(*thi
s); |
441 #endif | 447 #endif |
442 | 448 |
443 m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(),
m_pageID, *this); | 449 m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(),
m_pageID, *this); |
444 | 450 |
445 #if PLATFORM(COCOA) | 451 #if PLATFORM(COCOA) |
446 m_activityStateChangeDispatcher = std::make_unique<RunLoopObserver>(static_c
ast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::ActivityStateChange), [thi
s] { | 452 m_activityStateChangeDispatcher = std::make_unique<RunLoopObserver>(static_c
ast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::ActivityStateChange), [thi
s] { |
447 this->dispatchActivityStateChange(); | 453 this->dispatchActivityStateChange(); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 #endif | 745 #endif |
740 #if PLATFORM(IOS) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_
MODE)) | 746 #if PLATFORM(IOS) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_
MODE)) |
741 m_playbackSessionManager = PlaybackSessionManagerProxy::create(*this); | 747 m_playbackSessionManager = PlaybackSessionManagerProxy::create(*this); |
742 m_videoFullscreenManager = VideoFullscreenManagerProxy::create(*this, *m_pla
ybackSessionManager); | 748 m_videoFullscreenManager = VideoFullscreenManagerProxy::create(*this, *m_pla
ybackSessionManager); |
743 #endif | 749 #endif |
744 | 750 |
745 #if ENABLE(APPLE_PAY) | 751 #if ENABLE(APPLE_PAY) |
746 m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this); | 752 m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this); |
747 #endif | 753 #endif |
748 | 754 |
| 755 #if USE(SYSTEM_PREVIEW) |
749 m_systemPreviewController = std::make_unique<SystemPreviewController>(*this)
; | 756 m_systemPreviewController = std::make_unique<SystemPreviewController>(*this)
; |
| 757 #endif |
750 | 758 |
751 #if ENABLE(WEB_AUTHN) | 759 #if ENABLE(WEB_AUTHN) |
752 m_credentialsMessenger = std::make_unique<WebCredentialsMessengerProxy>(*thi
s); | 760 m_credentialsMessenger = std::make_unique<WebCredentialsMessengerProxy>(*thi
s); |
753 #endif | 761 #endif |
754 | 762 |
755 initializeWebPage(); | 763 initializeWebPage(); |
756 | 764 |
757 m_pageClient.didRelaunchProcess(); | 765 m_pageClient.didRelaunchProcess(); |
758 m_drawingArea->waitForBackingStoreUpdateOnNextPaint(); | 766 m_drawingArea->waitForBackingStoreUpdateOnNextPaint(); |
759 } | 767 } |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 loadParameters.userData = UserData(process().transformObjectsToHandles(userD
ata).get()); | 1078 loadParameters.userData = UserData(process().transformObjectsToHandles(userD
ata).get()); |
1071 addPlatformLoadParameters(loadParameters); | 1079 addPlatformLoadParameters(loadParameters); |
1072 | 1080 |
1073 m_process->assumeReadAccessToBaseURL(baseURL); | 1081 m_process->assumeReadAccessToBaseURL(baseURL); |
1074 m_process->send(Messages::WebPage::LoadString(loadParameters), m_pageID); | 1082 m_process->send(Messages::WebPage::LoadString(loadParameters), m_pageID); |
1075 m_process->responsivenessTimer().start(); | 1083 m_process->responsivenessTimer().start(); |
1076 | 1084 |
1077 return WTFMove(navigation); | 1085 return WTFMove(navigation); |
1078 } | 1086 } |
1079 | 1087 |
1080 void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const WebCo
re::URL& baseURL, const WebCore::URL& unreachableURL, API::Object* userData) | 1088 void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const WebCo
re::URL& baseURL, const WebCore::URL& unreachableURL, API::Object* userData, Web
Core::LockBackForwardList lockBackForwardList) |
1081 { | 1089 { |
1082 // When the UIProcess is in the process of handling a failing provisional lo
ad, do not attempt to | 1090 // When the UIProcess is in the process of handling a failing provisional lo
ad, do not attempt to |
1083 // start a second alternative HTML load as this will prevent the page load s
tate from being | 1091 // start a second alternative HTML load as this will prevent the page load s
tate from being |
1084 // handled properly. | 1092 // handled properly. |
1085 if (m_isClosed || m_isLoadingAlternateHTMLStringForFailingProvisionalLoad) | 1093 if (m_isClosed || m_isLoadingAlternateHTMLStringForFailingProvisionalLoad) |
1086 return; | 1094 return; |
1087 | 1095 |
1088 if (!m_failingProvisionalLoadURL.isEmpty()) | 1096 if (!m_failingProvisionalLoadURL.isEmpty()) |
1089 m_isLoadingAlternateHTMLStringForFailingProvisionalLoad = true; | 1097 m_isLoadingAlternateHTMLStringForFailingProvisionalLoad = true; |
1090 | 1098 |
1091 if (!isValid()) | 1099 if (!isValid()) |
1092 reattachToWebProcess(); | 1100 reattachToWebProcess(); |
1093 | 1101 |
1094 auto transaction = m_pageLoadState.transaction(); | 1102 auto transaction = m_pageLoadState.transaction(); |
1095 | 1103 |
1096 m_pageLoadState.setPendingAPIRequestURL(transaction, unreachableURL); | 1104 m_pageLoadState.setPendingAPIRequestURL(transaction, unreachableURL); |
1097 m_pageLoadState.setUnreachableURL(transaction, unreachableURL); | 1105 m_pageLoadState.setUnreachableURL(transaction, unreachableURL); |
1098 | 1106 |
1099 if (m_mainFrame) | 1107 if (m_mainFrame) |
1100 m_mainFrame->setUnreachableURL(unreachableURL); | 1108 m_mainFrame->setUnreachableURL(unreachableURL); |
1101 | 1109 |
1102 auto navigation = m_navigationState->createLoadDataNavigation(); | 1110 auto navigation = m_navigationState->createLoadDataNavigation(); |
1103 | 1111 |
1104 LoadParameters loadParameters; | 1112 LoadParameters loadParameters; |
1105 loadParameters.navigationID = navigation->navigationID(); | 1113 loadParameters.navigationID = navigation->navigationID(); |
1106 loadParameters.string = htmlString; | 1114 loadParameters.string = htmlString; |
1107 loadParameters.baseURLString = baseURL; | 1115 loadParameters.baseURLString = baseURL; |
1108 loadParameters.unreachableURLString = unreachableURL; | 1116 loadParameters.unreachableURLString = unreachableURL; |
1109 loadParameters.provisionalLoadErrorURLString = m_failingProvisionalLoadURL; | 1117 loadParameters.provisionalLoadErrorURLString = m_failingProvisionalLoadURL; |
| 1118 loadParameters.lockBackForwardList = lockBackForwardList; |
1110 loadParameters.userData = UserData(process().transformObjectsToHandles(userD
ata).get()); | 1119 loadParameters.userData = UserData(process().transformObjectsToHandles(userD
ata).get()); |
1111 addPlatformLoadParameters(loadParameters); | 1120 addPlatformLoadParameters(loadParameters); |
1112 | 1121 |
1113 m_process->assumeReadAccessToBaseURL(baseURL); | 1122 m_process->assumeReadAccessToBaseURL(baseURL); |
1114 m_process->assumeReadAccessToBaseURL(unreachableURL); | 1123 m_process->assumeReadAccessToBaseURL(unreachableURL); |
1115 m_process->send(Messages::WebPage::LoadAlternateHTMLString(loadParameters),
m_pageID); | 1124 m_process->send(Messages::WebPage::LoadAlternateHTMLString(loadParameters),
m_pageID); |
1116 m_process->responsivenessTimer().start(); | 1125 m_process->responsivenessTimer().start(); |
1117 } | 1126 } |
1118 | 1127 |
1119 void WebPageProxy::loadPlainTextString(const String& string, API::Object* userDa
ta) | 1128 void WebPageProxy::loadPlainTextString(const String& string, API::Object* userDa
ta) |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 // This must happen after the SetActivityState message is sent, to ensure th
e page visibility event can fire. | 1582 // This must happen after the SetActivityState message is sent, to ensure th
e page visibility event can fire. |
1574 updateThrottleState(); | 1583 updateThrottleState(); |
1575 | 1584 |
1576 #if ENABLE(POINTER_LOCK) | 1585 #if ENABLE(POINTER_LOCK) |
1577 if (((changed & ActivityState::IsVisible) && !isViewVisible()) || ((changed
& ActivityState::WindowIsActive) && !m_pageClient.isViewWindowActive()) | 1586 if (((changed & ActivityState::IsVisible) && !isViewVisible()) || ((changed
& ActivityState::WindowIsActive) && !m_pageClient.isViewWindowActive()) |
1578 || ((changed & ActivityState::IsFocused) && !(m_activityState & Activity
State::IsFocused))) | 1587 || ((changed & ActivityState::IsFocused) && !(m_activityState & Activity
State::IsFocused))) |
1579 requestPointerUnlock(); | 1588 requestPointerUnlock(); |
1580 #endif | 1589 #endif |
1581 | 1590 |
1582 if (changed & ActivityState::IsVisible) { | 1591 if (changed & ActivityState::IsVisible) { |
1583 if (isViewVisible()) | 1592 if (isViewVisible()) { |
1584 m_visiblePageToken = m_process->visiblePageToken(); | 1593 m_visiblePageToken = m_process->visiblePageToken(); |
| 1594 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
| 1595 if (m_displayLink) |
| 1596 m_displayLink->resume(); |
| 1597 #endif |
| 1598 } |
1585 else { | 1599 else { |
1586 m_visiblePageToken = nullptr; | 1600 m_visiblePageToken = nullptr; |
1587 | 1601 |
1588 // If we've started the responsiveness timer as part of telling the
web process to update the backing store | 1602 // If we've started the responsiveness timer as part of telling the
web process to update the backing store |
1589 // state, it might not send back a reply (since it won't paint anyth
ing if the web page is hidden) so we | 1603 // state, it might not send back a reply (since it won't paint anyth
ing if the web page is hidden) so we |
1590 // stop the unresponsiveness timer here. | 1604 // stop the unresponsiveness timer here. |
1591 m_process->responsivenessTimer().stop(); | 1605 m_process->responsivenessTimer().stop(); |
| 1606 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
| 1607 if (m_displayLink) |
| 1608 m_displayLink->pause(); |
| 1609 #endif |
1592 } | 1610 } |
1593 } | 1611 } |
1594 | 1612 |
1595 if (changed & ActivityState::IsInWindow) { | 1613 if (changed & ActivityState::IsInWindow) { |
1596 if (isInWindow()) | 1614 if (isInWindow()) |
1597 viewDidEnterWindow(); | 1615 viewDidEnterWindow(); |
1598 else | 1616 else |
1599 viewDidLeaveWindow(); | 1617 viewDidLeaveWindow(); |
1600 } | 1618 } |
1601 | 1619 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1919 | 1937 |
1920 #endif | 1938 #endif |
1921 | 1939 |
1922 #endif // ENABLE(DRAG_SUPPORT) | 1940 #endif // ENABLE(DRAG_SUPPORT) |
1923 | 1941 |
1924 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event) | 1942 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event) |
1925 { | 1943 { |
1926 if (!isValid()) | 1944 if (!isValid()) |
1927 return; | 1945 return; |
1928 | 1946 |
1929 LOG(MouseHandling, "UIProcess: enqueued mouse event %s (queue size %zu)", we
bMouseEventTypeString(event.type()), m_mouseEventQueue.size()); | 1947 // If we receive multiple mousemove events and the most recent mousemove eve
nt has not been |
1930 m_mouseEventQueue.append(event); | 1948 // sent to WebProcess for processing, replace the pending mousemove event wi
th a new one. |
| 1949 if (event.type() == WebEvent::MouseMove && m_mouseEventQueue.size() > 1 && m
_mouseEventQueue.last().type() == WebEvent::MouseMove) { |
| 1950 LOG(MouseHandling, "UIProcess: updated pending mousemove event (queue si
ze %zu)", m_mouseEventQueue.size()); |
| 1951 m_mouseEventQueue.removeLast(); |
| 1952 m_mouseEventQueue.append(event); |
| 1953 } else { |
| 1954 LOG(MouseHandling, "UIProcess: enqueued mouse event %s (queue size %zu)"
, webMouseEventTypeString(event.type()), m_mouseEventQueue.size()); |
| 1955 m_mouseEventQueue.append(event); |
| 1956 } |
1931 if (m_mouseEventQueue.size() == 1) // Otherwise, called from DidReceiveEvent
message handler. | 1957 if (m_mouseEventQueue.size() == 1) // Otherwise, called from DidReceiveEvent
message handler. |
1932 processNextQueuedMouseEvent(); | 1958 processNextQueuedMouseEvent(); |
1933 } | 1959 } |
1934 ···· | 1960 ···· |
1935 void WebPageProxy::processNextQueuedMouseEvent() | 1961 void WebPageProxy::processNextQueuedMouseEvent() |
1936 { | 1962 { |
1937 if (!isValid()) | 1963 if (!isValid()) |
1938 return; | 1964 return; |
1939 | 1965 |
1940 ASSERT(!m_mouseEventQueue.isEmpty()); | 1966 ASSERT(!m_mouseEventQueue.isEmpty()); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2270 #endif | 2296 #endif |
2271 | 2297 |
2272 #if ENABLE(IOS_TOUCH_EVENTS) | 2298 #if ENABLE(IOS_TOUCH_EVENTS) |
2273 void WebPageProxy::handleTouchEventSynchronously(NativeWebTouchEvent& event) | 2299 void WebPageProxy::handleTouchEventSynchronously(NativeWebTouchEvent& event) |
2274 { | 2300 { |
2275 if (!isValid()) | 2301 if (!isValid()) |
2276 return; | 2302 return; |
2277 | 2303 |
2278 TraceScope scope(SyncTouchEventStart, SyncTouchEventEnd); | 2304 TraceScope scope(SyncTouchEventStart, SyncTouchEventEnd); |
2279 | 2305 |
2280 if (event.type() == WebEvent::TouchStart) | 2306 updateTouchEventTracking(event); |
2281 updateTouchEventTracking(event); | |
2282 | 2307 |
2283 TrackingType touchEventsTrackingType = touchEventTrackingType(event); | 2308 TrackingType touchEventsTrackingType = touchEventTrackingType(event); |
2284 if (touchEventsTrackingType == TrackingType::NotTracking) | 2309 if (touchEventsTrackingType == TrackingType::NotTracking) |
2285 return; | 2310 return; |
2286 | 2311 |
2287 if (touchEventsTrackingType == TrackingType::Asynchronous) { | 2312 if (touchEventsTrackingType == TrackingType::Asynchronous) { |
2288 // We can end up here if a native gesture has not started but the event
handlers are passive. | 2313 // We can end up here if a native gesture has not started but the event
handlers are passive. |
2289 // | 2314 // |
2290 // The client of WebPageProxy asks the event to be sent synchronously si
nce the touch event | 2315 // The client of WebPageProxy asks the event to be sent synchronously si
nce the touch event |
2291 // can prevent a native gesture. | 2316 // can prevent a native gesture. |
2292 // But, here we know that all events handlers that can handle this event
s are passive. | 2317 // But, here we know that all events handlers that can handle this event
s are passive. |
2293 // We can use asynchronous dispatch and pretend to the client that the p
age does nothing with the events. | 2318 // We can use asynchronous dispatch and pretend to the client that the p
age does nothing with the events. |
2294 event.setCanPreventNativeGestures(false); | 2319 event.setCanPreventNativeGestures(false); |
2295 handleTouchEventAsynchronously(event); | 2320 handleTouchEventAsynchronously(event); |
2296 didReceiveEvent(event.type(), false); | 2321 didReceiveEvent(event.type(), false); |
2297 return; | 2322 return; |
2298 } | 2323 } |
2299 | 2324 |
2300 m_process->responsivenessTimer().start(); | 2325 m_process->responsivenessTimer().start(); |
2301 bool handled = false; | 2326 bool handled = false; |
2302 m_process->sendSync(Messages::WebPage::TouchEventSync(event), Messages::WebP
age::TouchEventSync::Reply(handled), m_pageID); | 2327 bool replyReceived = m_process->sendSync(Messages::WebPage::TouchEventSync(e
vent), Messages::WebPage::TouchEventSync::Reply(handled), m_pageID, 1_s); |
| 2328 // If the sync request has timed out, we should consider the event handled.
The Web Process is too busy to answer any questions, so the default action is al
so likely to have issues. |
| 2329 if (!replyReceived) |
| 2330 handled = true; |
2303 didReceiveEvent(event.type(), handled); | 2331 didReceiveEvent(event.type(), handled); |
2304 m_pageClient.doneWithTouchEvent(event, handled); | 2332 m_pageClient.doneWithTouchEvent(event, handled); |
2305 m_process->responsivenessTimer().stop(); | 2333 m_process->responsivenessTimer().stop(); |
2306 | 2334 |
2307 if (event.allTouchPointsAreReleased()) | 2335 if (event.allTouchPointsAreReleased()) |
2308 m_touchEventTracking.reset(); | 2336 m_touchEventTracking.reset(); |
2309 } | 2337 } |
2310 | 2338 |
2311 void WebPageProxy::handleTouchEventAsynchronously(const NativeWebTouchEvent& eve
nt) | 2339 void WebPageProxy::handleTouchEventAsynchronously(const NativeWebTouchEvent& eve
nt) |
2312 { | 2340 { |
2313 if (!isValid()) | 2341 if (!isValid()) |
2314 return; | 2342 return; |
2315 | 2343 |
2316 TrackingType touchEventsTrackingType = touchEventTrackingType(event); | 2344 TrackingType touchEventsTrackingType = touchEventTrackingType(event); |
2317 if (touchEventsTrackingType == TrackingType::NotTracking) | 2345 if (touchEventsTrackingType == TrackingType::NotTracking) |
2318 return; | 2346 return; |
2319 | 2347 |
2320 m_process->send(Messages::EventDispatcher::TouchEvent(m_pageID, event), 0); | 2348 m_process->send(Messages::EventDispatcher::TouchEvent(m_pageID, event), 0); |
2321 | 2349 |
2322 if (event.allTouchPointsAreReleased()) | 2350 if (event.allTouchPointsAreReleased()) |
2323 m_touchEventTracking.reset(); | 2351 m_touchEventTracking.reset(); |
2324 } | 2352 } |
2325 | 2353 |
2326 #elif ENABLE(TOUCH_EVENTS) | 2354 #elif ENABLE(TOUCH_EVENTS) |
2327 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event) | 2355 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event) |
2328 { | 2356 { |
2329 if (!isValid()) | 2357 if (!isValid()) |
2330 return; | 2358 return; |
2331 | 2359 |
2332 if (event.type() == WebEvent::TouchStart) | 2360 updateTouchEventTracking(event); |
2333 updateTouchEventTracking(event); | |
2334 | 2361 |
2335 if (touchEventTrackingType(event) == TrackingType::NotTracking) | 2362 if (touchEventTrackingType(event) == TrackingType::NotTracking) |
2336 return; | 2363 return; |
2337 | 2364 |
2338 // If the page is suspended, which should be the case during panning, pinchi
ng | 2365 // If the page is suspended, which should be the case during panning, pinchi
ng |
2339 // and animation on the page itself (kinetic scrolling, tap to zoom) etc, th
en | 2366 // and animation on the page itself (kinetic scrolling, tap to zoom) etc, th
en |
2340 // we do not send any of the events to the page even if is has listeners. | 2367 // we do not send any of the events to the page even if is has listeners. |
2341 if (!m_isPageSuspended) { | 2368 if (!m_isPageSuspended) { |
2342 m_touchEventQueue.append(event); | 2369 m_touchEventQueue.append(event); |
2343 m_process->responsivenessTimer().start(); | 2370 m_process->responsivenessTimer().start(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2403 } | 2430 } |
2404 | 2431 |
2405 auto* activePolicyListener = frame.activePolicyListenerProxy(); | 2432 auto* activePolicyListener = frame.activePolicyListenerProxy(); |
2406 if (activePolicyListener && activePolicyListener->policyListenerType() == Po
licyListenerType::NavigationAction) { | 2433 if (activePolicyListener && activePolicyListener->policyListenerType() == Po
licyListenerType::NavigationAction) { |
2407 ASSERT(activePolicyListener->listenerID() == listenerID); | 2434 ASSERT(activePolicyListener->listenerID() == listenerID); |
2408 | 2435 |
2409 if (action == PolicyAction::Use && navigation && frame.isMainFrame()) { | 2436 if (action == PolicyAction::Use && navigation && frame.isMainFrame()) { |
2410 auto proposedProcess = process().processPool().processForNavigation(
*this, *navigation, action); | 2437 auto proposedProcess = process().processPool().processForNavigation(
*this, *navigation, action); |
2411 | 2438 |
2412 if (proposedProcess.ptr() != &process()) { | 2439 if (proposedProcess.ptr() != &process()) { |
2413 LOG(ProcessSwapping, "Switching from process %i to new process f
or navigation %" PRIu64 " '%s'", processIdentifier(), navigation->navigationID()
, navigation->loggingString()); | 2440 LOG(ProcessSwapping, "(ProcessSwapping) Switching from process %
i to new process (%i) for navigation %" PRIu64 " '%s'", processIdentifier(), pro
posedProcess->processIdentifier(), navigation->navigationID(), navigation->loggi
ngString()); |
2414 | 2441 |
2415 RunLoop::main().dispatch([this, protectedThis = makeRef(*this),
navigation = makeRef(*navigation), proposedProcess = WTFMove(proposedProcess)]()
mutable { | 2442 RunLoop::main().dispatch([this, protectedThis = makeRef(*this),
navigation = makeRef(*navigation), proposedProcess = WTFMove(proposedProcess)]()
mutable { |
2416 continueNavigationInNewProcess(navigation.get(), WTFMove(pro
posedProcess)); | 2443 continueNavigationInNewProcess(navigation.get(), WTFMove(pro
posedProcess)); |
2417 }); | 2444 }); |
2418 } | 2445 } |
2419 } | 2446 } |
2420 } | 2447 } |
2421 | 2448 |
2422 if (auto syncNavigationActionPolicyReply = WTFMove(m_syncNavigationActionPol
icyReply)) { | 2449 if (auto syncNavigationActionPolicyReply = WTFMove(m_syncNavigationActionPol
icyReply)) { |
2423 syncNavigationActionPolicyReply->send(navigation ? navigation->navigatio
nID() : 0, action, downloadID, WTFMove(websitePolicies)); | 2450 syncNavigationActionPolicyReply->send(navigation ? navigation->navigatio
nID() : 0, action, downloadID, WTFMove(websitePolicies)); |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3944 auto transaction = m_pageLoadState.transaction(); | 3971 auto transaction = m_pageLoadState.transaction(); |
3945 | 3972 |
3946 bool fromAPI = request.url() == m_pageLoadState.pendingAPIRequestURL(); | 3973 bool fromAPI = request.url() == m_pageLoadState.pendingAPIRequestURL(); |
3947 if (!fromAPI) | 3974 if (!fromAPI) |
3948 m_pageLoadState.clearPendingAPIRequestURL(transaction); | 3975 m_pageLoadState.clearPendingAPIRequestURL(transaction); |
3949 | 3976 |
3950 WebFrameProxy* frame = m_process->webFrame(frameID); | 3977 WebFrameProxy* frame = m_process->webFrame(frameID); |
3951 MESSAGE_CHECK(frame); | 3978 MESSAGE_CHECK(frame); |
3952 MESSAGE_CHECK_URL(request.url()); | 3979 MESSAGE_CHECK_URL(request.url()); |
3953 MESSAGE_CHECK_URL(originalRequest.url()); | 3980 MESSAGE_CHECK_URL(originalRequest.url()); |
3954 ···· | 3981 |
3955 Ref<API::Navigation> navigation = navigationID ? makeRef(m_navigationState->
navigation(navigationID)) : m_navigationState->createLoadRequestNavigation(Resou
rceRequest(request), m_backForwardList->currentItem()); | 3982 RefPtr<API::Navigation> navigation; |
| 3983 if (navigationID) |
| 3984 navigation = makeRef(m_navigationState->navigation(navigationID)); |
| 3985 |
| 3986 if (auto targetBackForwardItemIdentifier = navigationActionData.targetBackFo
rwardItemIdentifier) { |
| 3987 if (auto* item = m_backForwardList->itemForID(*navigationActionData.targ
etBackForwardItemIdentifier)) { |
| 3988 if (!navigation) |
| 3989 navigation = m_navigationState->createBackForwardNavigation(*ite
m, m_backForwardList->currentItem(), FrameLoadType::IndexedBackForward); |
| 3990 else |
| 3991 navigation->setTargetItem(*item); |
| 3992 } |
| 3993 } |
| 3994 |
| 3995 if (!navigation) |
| 3996 navigation = m_navigationState->createLoadRequestNavigation(ResourceRequ
est(request), m_backForwardList->currentItem()); |
3956 | 3997 |
3957 uint64_t newNavigationID = navigation->navigationID(); | 3998 uint64_t newNavigationID = navigation->navigationID(); |
3958 navigation->setWasUserInitiated(!!navigationActionData.userGestureTokenIdent
ifier); | 3999 navigation->setWasUserInitiated(!!navigationActionData.userGestureTokenIdent
ifier); |
3959 navigation->setShouldForceDownload(!navigationActionData.downloadAttribute.i
sNull()); | 4000 navigation->setShouldForceDownload(!navigationActionData.downloadAttribute.i
sNull() || request.isSystemPreview()); |
3960 navigation->setCurrentRequest(ResourceRequest(request), m_process->coreProce
ssIdentifier()); | 4001 navigation->setCurrentRequest(ResourceRequest(request), m_process->coreProce
ssIdentifier()); |
3961 navigation->setCurrentRequestIsRedirect(navigationActionData.isRedirect); | 4002 navigation->setCurrentRequestIsRedirect(navigationActionData.isRedirect); |
3962 navigation->setTreatAsSameOriginNavigation(navigationActionData.treatAsSameO
riginNavigation); | 4003 navigation->setTreatAsSameOriginNavigation(navigationActionData.treatAsSameO
riginNavigation); |
3963 navigation->setIsCrossOriginWindowOpenNavigation(navigationActionData.isCros
sOriginWindowOpenNavigation); | 4004 navigation->setIsCrossOriginWindowOpenNavigation(navigationActionData.isCros
sOriginWindowOpenNavigation); |
3964 navigation->setOpener(navigationActionData.opener); | 4005 navigation->setOpener(navigationActionData.opener); |
3965 | 4006 |
3966 auto listener = makeRef(frame->setUpPolicyListenerProxy(listenerID, PolicyLi
stenerType::NavigationAction)); | 4007 auto listener = makeRef(frame->setUpPolicyListenerProxy(listenerID, PolicyLi
stenerType::NavigationAction)); |
3967 listener->setNavigation(WTFMove(navigation)); | 4008 listener->setNavigation(navigation.releaseNonNull()); |
3968 | 4009 |
3969 #if ENABLE(CONTENT_FILTERING) | 4010 #if ENABLE(CONTENT_FILTERING) |
3970 if (frame->didHandleContentFilterUnblockNavigation(request)) | 4011 if (frame->didHandleContentFilterUnblockNavigation(request)) |
3971 return receivedPolicyDecision(PolicyAction::Ignore, *frame, listenerID,
&m_navigationState->navigation(newNavigationID), { }); | 4012 return receivedPolicyDecision(PolicyAction::Ignore, *frame, listenerID,
&m_navigationState->navigation(newNavigationID), { }); |
3972 #else | 4013 #else |
3973 UNUSED_PARAM(newNavigationID); | 4014 UNUSED_PARAM(newNavigationID); |
3974 #endif | 4015 #endif |
3975 | 4016 |
3976 WebFrameProxy* originatingFrame = m_process->webFrame(originatingFrameInfoDa
ta.frameID); | 4017 WebFrameProxy* originatingFrame = m_process->webFrame(originatingFrameInfoDa
ta.frameID); |
3977 | 4018 |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4403 | 4444 |
4404 void WebPageProxy::getWindowFrame(Ref<Messages::WebPageProxy::GetWindowFrame::De
layedReply>&& reply) | 4445 void WebPageProxy::getWindowFrame(Ref<Messages::WebPageProxy::GetWindowFrame::De
layedReply>&& reply) |
4405 { | 4446 { |
4406 m_uiClient->windowFrame(*this, [this, protectedThis = makeRef(*this), reply
= WTFMove(reply)] (FloatRect frame) { | 4447 m_uiClient->windowFrame(*this, [this, protectedThis = makeRef(*this), reply
= WTFMove(reply)] (FloatRect frame) { |
4407 reply->send(m_pageClient.convertToUserSpace(frame)); | 4448 reply->send(m_pageClient.convertToUserSpace(frame)); |
4408 }); | 4449 }); |
4409 } | 4450 } |
4410 | 4451 |
4411 void WebPageProxy::getWindowFrameWithCallback(Function<void(FloatRect)>&& comple
tionHandler) | 4452 void WebPageProxy::getWindowFrameWithCallback(Function<void(FloatRect)>&& comple
tionHandler) |
4412 { | 4453 { |
4413 m_uiClient->windowFrame(*this, WTFMove(completionHandler)); | 4454 m_uiClient->windowFrame(*this, [this, protectedThis = makeRef(*this), comple
tionHandler = WTFMove(completionHandler)] (FloatRect frame) { |
| 4455 completionHandler(m_pageClient.convertToUserSpace(frame)); |
| 4456 }); |
4414 } | 4457 } |
4415 | 4458 |
4416 void WebPageProxy::screenToRootView(const IntPoint& screenPoint, Ref<Messages::W
ebPageProxy::ScreenToRootView::DelayedReply>&& reply) | 4459 void WebPageProxy::screenToRootView(const IntPoint& screenPoint, Ref<Messages::W
ebPageProxy::ScreenToRootView::DelayedReply>&& reply) |
4417 { | 4460 { |
4418 reply->send(m_pageClient.screenToRootView(screenPoint)); | 4461 reply->send(m_pageClient.screenToRootView(screenPoint)); |
4419 } | 4462 } |
4420 ···· | 4463 ···· |
4421 void WebPageProxy::rootViewToScreen(const IntRect& viewRect, Ref<Messages::WebPa
geProxy::RootViewToScreen::DelayedReply>&& reply) | 4464 void WebPageProxy::rootViewToScreen(const IntRect& viewRect, Ref<Messages::WebPa
geProxy::RootViewToScreen::DelayedReply>&& reply) |
4422 { | 4465 { |
4423 reply->send(m_pageClient.rootViewToScreen(viewRect)); | 4466 reply->send(m_pageClient.rootViewToScreen(viewRect)); |
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5906 #endif | 5949 #endif |
5907 | 5950 |
5908 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS) | 5951 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS) |
5909 m_pageClient.mediaSessionManager().removeAllPlaybackTargetPickerClients(*thi
s); | 5952 m_pageClient.mediaSessionManager().removeAllPlaybackTargetPickerClients(*thi
s); |
5910 #endif | 5953 #endif |
5911 | 5954 |
5912 #if ENABLE(APPLE_PAY) | 5955 #if ENABLE(APPLE_PAY) |
5913 m_paymentCoordinator = nullptr; | 5956 m_paymentCoordinator = nullptr; |
5914 #endif | 5957 #endif |
5915 | 5958 |
| 5959 #if USE(SYSTEM_PREVIEW) |
5916 m_systemPreviewController = nullptr; | 5960 m_systemPreviewController = nullptr; |
| 5961 #endif |
5917 | 5962 |
5918 #if ENABLE(WEB_AUTHN) | 5963 #if ENABLE(WEB_AUTHN) |
5919 m_credentialsMessenger = nullptr; | 5964 m_credentialsMessenger = nullptr; |
5920 #endif | 5965 #endif |
5921 | 5966 |
5922 CallbackBase::Error error; | 5967 CallbackBase::Error error; |
5923 switch (resetStateReason) { | 5968 switch (resetStateReason) { |
5924 case ResetStateReason::NavigationSwap: | 5969 case ResetStateReason::NavigationSwap: |
5925 FALLTHROUGH; | 5970 FALLTHROUGH; |
5926 case ResetStateReason::PageInvalidated: | 5971 case ResetStateReason::PageInvalidated: |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6027 parameters.visitedLinkTableID = m_visitedLinkStore->identifier(); | 6072 parameters.visitedLinkTableID = m_visitedLinkStore->identifier(); |
6028 parameters.websiteDataStoreID = m_websiteDataStore->identifier(); | 6073 parameters.websiteDataStoreID = m_websiteDataStore->identifier(); |
6029 parameters.canRunBeforeUnloadConfirmPanel = m_uiClient->canRunBeforeUnloadCo
nfirmPanel(); | 6074 parameters.canRunBeforeUnloadConfirmPanel = m_uiClient->canRunBeforeUnloadCo
nfirmPanel(); |
6030 parameters.canRunModal = m_canRunModal; | 6075 parameters.canRunModal = m_canRunModal; |
6031 parameters.deviceScaleFactor = deviceScaleFactor(); | 6076 parameters.deviceScaleFactor = deviceScaleFactor(); |
6032 parameters.viewScaleFactor = m_viewScaleFactor; | 6077 parameters.viewScaleFactor = m_viewScaleFactor; |
6033 parameters.topContentInset = m_topContentInset; | 6078 parameters.topContentInset = m_topContentInset; |
6034 parameters.mediaVolume = m_mediaVolume; | 6079 parameters.mediaVolume = m_mediaVolume; |
6035 parameters.muted = m_mutedState; | 6080 parameters.muted = m_mutedState; |
6036 parameters.mayStartMediaWhenInWindow = m_mayStartMediaWhenInWindow; | 6081 parameters.mayStartMediaWhenInWindow = m_mayStartMediaWhenInWindow; |
6037 parameters.minimumLayoutSize = m_minimumLayoutSize; | 6082 parameters.viewLayoutSize = m_viewLayoutSize; |
6038 parameters.autoSizingShouldExpandToViewHeight = m_autoSizingShouldExpandToVi
ewHeight; | 6083 parameters.autoSizingShouldExpandToViewHeight = m_autoSizingShouldExpandToVi
ewHeight; |
6039 parameters.viewportSizeForCSSViewportUnits = m_viewportSizeForCSSViewportUni
ts; | 6084 parameters.viewportSizeForCSSViewportUnits = m_viewportSizeForCSSViewportUni
ts; |
6040 parameters.scrollPinningBehavior = m_scrollPinningBehavior; | 6085 parameters.scrollPinningBehavior = m_scrollPinningBehavior; |
6041 if (m_scrollbarOverlayStyle) | 6086 if (m_scrollbarOverlayStyle) |
6042 parameters.scrollbarOverlayStyle = m_scrollbarOverlayStyle.value(); | 6087 parameters.scrollbarOverlayStyle = m_scrollbarOverlayStyle.value(); |
6043 else | 6088 else |
6044 parameters.scrollbarOverlayStyle = std::nullopt; | 6089 parameters.scrollbarOverlayStyle = std::nullopt; |
6045 parameters.backgroundExtendsBeyondPage = m_backgroundExtendsBeyondPage; | 6090 parameters.backgroundExtendsBeyondPage = m_backgroundExtendsBeyondPage; |
6046 parameters.layerHostingMode = m_layerHostingMode; | 6091 parameters.layerHostingMode = m_layerHostingMode; |
6047 parameters.controlledByAutomation = m_controlledByAutomation; | 6092 parameters.controlledByAutomation = m_controlledByAutomation; |
6048 #if ENABLE(REMOTE_INSPECTOR) | 6093 #if ENABLE(REMOTE_INSPECTOR) |
6049 parameters.allowsRemoteInspection = m_allowsRemoteInspection; | 6094 parameters.allowsRemoteInspection = m_allowsRemoteInspection; |
6050 parameters.remoteInspectionNameOverride = m_remoteInspectionNameOverride; | 6095 parameters.remoteInspectionNameOverride = m_remoteInspectionNameOverride; |
6051 #endif | 6096 #endif |
6052 #if PLATFORM(MAC) | 6097 #if PLATFORM(MAC) |
6053 parameters.colorSpace = m_pageClient.colorSpace(); | 6098 parameters.colorSpace = m_pageClient.colorSpace(); |
6054 parameters.useSystemAppearance = m_useSystemAppearance; | 6099 parameters.useSystemAppearance = m_useSystemAppearance; |
6055 parameters.defaultAppearance = m_defaultAppearance; | 6100 parameters.defaultAppearance = m_defaultAppearance; |
6056 #endif | 6101 #endif |
6057 #if PLATFORM(IOS) | 6102 #if PLATFORM(IOS) |
6058 parameters.screenSize = screenSize(); | 6103 parameters.screenSize = screenSize(); |
6059 parameters.availableScreenSize = availableScreenSize(); | 6104 parameters.availableScreenSize = availableScreenSize(); |
6060 parameters.overrideScreenSize = overrideScreenSize(); | 6105 parameters.overrideScreenSize = overrideScreenSize(); |
6061 parameters.textAutosizingWidth = textAutosizingWidth(); | 6106 parameters.textAutosizingWidth = textAutosizingWidth(); |
6062 parameters.mimeTypesWithCustomContentProviders = m_pageClient.mimeTypesWithC
ustomContentProviders(); | 6107 parameters.mimeTypesWithCustomContentProviders = m_pageClient.mimeTypesWithC
ustomContentProviders(); |
6063 parameters.ignoresViewportScaleLimits = m_forceAlwaysUserScalable; | 6108 parameters.ignoresViewportScaleLimits = m_forceAlwaysUserScalable; |
6064 parameters.viewportConfigurationMinimumLayoutSize = m_viewportConfigurationM
inimumLayoutSize; | 6109 parameters.viewportConfigurationViewLayoutSize = m_viewportConfigurationView
LayoutSize; |
6065 parameters.maximumUnobscuredSize = m_maximumUnobscuredSize; | 6110 parameters.maximumUnobscuredSize = m_maximumUnobscuredSize; |
6066 #endif | 6111 #endif |
6067 | 6112 |
6068 #if PLATFORM(MAC) | 6113 #if PLATFORM(MAC) |
6069 parameters.appleMailPaginationQuirkEnabled = appleMailPaginationQuirkEnabled
(); | 6114 parameters.appleMailPaginationQuirkEnabled = appleMailPaginationQuirkEnabled
(); |
6070 #else | 6115 #else |
6071 parameters.appleMailPaginationQuirkEnabled = false; | 6116 parameters.appleMailPaginationQuirkEnabled = false; |
6072 #endif | 6117 #endif |
6073 ···· | 6118 ···· |
6074 #if PLATFORM(MAC) | 6119 #if PLATFORM(MAC) |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6544 | 6589 |
6545 void WebPageProxy::savePDFToFileInDownloadsFolder(String&& suggestedFilename, UR
L&& originatingURL, const IPC::DataReference& dataReference) | 6590 void WebPageProxy::savePDFToFileInDownloadsFolder(String&& suggestedFilename, UR
L&& originatingURL, const IPC::DataReference& dataReference) |
6546 { | 6591 { |
6547 if (!suggestedFilename.endsWithIgnoringASCIICase(".pdf")) | 6592 if (!suggestedFilename.endsWithIgnoringASCIICase(".pdf")) |
6548 return; | 6593 return; |
6549 | 6594 |
6550 saveDataToFileInDownloadsFolder(WTFMove(suggestedFilename), ASCIILiteral("ap
plication/pdf"), WTFMove(originatingURL), | 6595 saveDataToFileInDownloadsFolder(WTFMove(suggestedFilename), ASCIILiteral("ap
plication/pdf"), WTFMove(originatingURL), |
6551 API::Data::create(dataReference.data(), dataReference.size()).get()); | 6596 API::Data::create(dataReference.data(), dataReference.size()).get()); |
6552 } | 6597 } |
6553 | 6598 |
6554 void WebPageProxy::setMinimumLayoutSize(const IntSize& minimumLayoutSize) | 6599 void WebPageProxy::setViewLayoutSize(const IntSize& viewLayoutSize) |
6555 { | 6600 { |
6556 if (m_minimumLayoutSize == minimumLayoutSize) | 6601 if (m_viewLayoutSize == viewLayoutSize) |
6557 return; | 6602 return; |
6558 | 6603 |
6559 m_minimumLayoutSize = minimumLayoutSize; | 6604 m_viewLayoutSize = viewLayoutSize; |
6560 | 6605 |
6561 if (!isValid()) | 6606 if (!isValid()) |
6562 return; | 6607 return; |
6563 | 6608 |
6564 m_process->send(Messages::WebPage::SetMinimumLayoutSize(minimumLayoutSize),
m_pageID); | 6609 m_process->send(Messages::WebPage::SetViewLayoutSize(viewLayoutSize), m_page
ID); |
6565 m_drawingArea->minimumLayoutSizeDidChange(); | 6610 m_drawingArea->viewLayoutSizeDidChange(); |
6566 | 6611 |
6567 #if USE(APPKIT) | 6612 #if USE(APPKIT) |
6568 if (m_minimumLayoutSize.width() <= 0) | 6613 if (m_viewLayoutSize.width() <= 0) |
6569 intrinsicContentSizeDidChange(IntSize(-1, -1)); | 6614 intrinsicContentSizeDidChange(IntSize(-1, -1)); |
6570 #endif | 6615 #endif |
6571 } | 6616 } |
6572 | 6617 |
6573 void WebPageProxy::setAutoSizingShouldExpandToViewHeight(bool shouldExpand) | 6618 void WebPageProxy::setAutoSizingShouldExpandToViewHeight(bool shouldExpand) |
6574 { | 6619 { |
6575 if (m_autoSizingShouldExpandToViewHeight == shouldExpand) | 6620 if (m_autoSizingShouldExpandToViewHeight == shouldExpand) |
6576 return; | 6621 return; |
6577 | 6622 |
6578 m_autoSizingShouldExpandToViewHeight = shouldExpand; | 6623 m_autoSizingShouldExpandToViewHeight = shouldExpand; |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7464 | 7509 |
7465 void WebPageProxy::stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskId
entifier) | 7510 void WebPageProxy::stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskId
entifier) |
7466 { | 7511 { |
7467 auto iterator = m_urlSchemeHandlersByIdentifier.find(handlerIdentifier); | 7512 auto iterator = m_urlSchemeHandlersByIdentifier.find(handlerIdentifier); |
7468 MESSAGE_CHECK(iterator != m_urlSchemeHandlersByIdentifier.end()); | 7513 MESSAGE_CHECK(iterator != m_urlSchemeHandlersByIdentifier.end()); |
7469 | 7514 |
7470 iterator->value->stopTask(*this, taskIdentifier); | 7515 iterator->value->stopTask(*this, taskIdentifier); |
7471 } | 7516 } |
7472 | 7517 |
7473 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) | 7518 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) |
7474 void WebPageProxy::hasStorageAccess(String&& subFrameHost, String&& topFrameHost
, uint64_t frameID, uint64_t pageID, uint64_t webProcessContextId) | 7519 void WebPageProxy::hasStorageAccess(String&& subFrameHost, String&& topFrameHost
, uint64_t frameID, uint64_t webProcessContextId) |
7475 { | 7520 { |
7476 m_websiteDataStore->hasStorageAccess(WTFMove(subFrameHost), WTFMove(topFrame
Host), frameID, pageID, [this, webProcessContextId] (bool hasAccess) { | 7521 m_websiteDataStore->hasStorageAccess(WTFMove(subFrameHost), WTFMove(topFrame
Host), frameID, m_pageID, [this, webProcessContextId] (bool hasAccess) { |
7477 m_process->send(Messages::WebPage::StorageAccessResponse(hasAccess, webP
rocessContextId), m_pageID); | 7522 m_process->send(Messages::WebPage::StorageAccessResponse(hasAccess, webP
rocessContextId), m_pageID); |
7478 }); | 7523 }); |
7479 } | 7524 } |
7480 | 7525 |
7481 void WebPageProxy::requestStorageAccess(String&& subFrameHost, String&& topFrame
Host, uint64_t frameID, uint64_t pageID, uint64_t webProcessContextId) | 7526 void WebPageProxy::requestStorageAccess(String&& subFrameHost, String&& topFrame
Host, uint64_t frameID, uint64_t webProcessContextId, bool promptEnabled) |
7482 { | 7527 { |
7483 ASSERT(pageID == m_pageID); | 7528 CompletionHandler<void(bool)> completionHandler = [this, protectedThis = mak
eRef(*this), webProcessContextId] (bool access) { |
7484 m_websiteDataStore->requestStorageAccess(WTFMove(subFrameHost), WTFMove(topF
rameHost), frameID, pageID, [this, webProcessContextId] (bool wasGranted) { | 7529 m_process->send(Messages::WebPage::StorageAccessResponse(access, webProc
essContextId), m_pageID); |
7485 m_process->send(Messages::WebPage::StorageAccessResponse(wasGranted, web
ProcessContextId), m_pageID); | 7530 }; |
| 7531 |
| 7532 m_websiteDataStore->requestStorageAccess(String(subFrameHost), String(topFra
meHost), frameID, m_pageID, promptEnabled, [this, protectedThis = makeRef(*this)
, subFrameHost, topFrameHost, promptEnabled, frameID, completionHandler = WTFMov
e(completionHandler)] (StorageAccessStatus status) mutable { |
| 7533 switch (status) { |
| 7534 case StorageAccessStatus::CannotRequestAccess: |
| 7535 completionHandler(false); |
| 7536 return; |
| 7537 case StorageAccessStatus::RequiresUserPrompt: |
| 7538 ASSERT_UNUSED(promptEnabled, promptEnabled); |
| 7539 m_uiClient->requestStorageAccessConfirm(*this, m_process->webFrame(f
rameID), String(subFrameHost), String(topFrameHost), [this, protectedThis = make
Ref(*this), subFrameHost, topFrameHost, frameID, completionHandler = WTFMove(com
pletionHandler)] (bool userDidGrantAccess) mutable { |
| 7540 if (userDidGrantAccess) |
| 7541 m_websiteDataStore->grantStorageAccess(WTFMove(subFrameHost)
, WTFMove(topFrameHost), frameID, m_pageID, userDidGrantAccess, WTFMove(completi
onHandler)); |
| 7542 else |
| 7543 completionHandler(false); |
| 7544 }); |
| 7545 return; |
| 7546 case StorageAccessStatus::HasAccess: |
| 7547 completionHandler(true); |
| 7548 return; |
| 7549 } |
7486 }); | 7550 }); |
7487 } | 7551 } |
7488 #endif | 7552 #endif |
7489 | 7553 |
7490 #if PLATFORM(COCOA) | 7554 #if PLATFORM(COCOA) |
7491 void WebPageProxy::touchBarMenuDataChanged(const TouchBarMenuData& touchBarMenuD
ata) | 7555 void WebPageProxy::touchBarMenuDataChanged(const TouchBarMenuData& touchBarMenuD
ata) |
7492 { | 7556 { |
7493 m_touchBarMenuData = touchBarMenuData; | 7557 m_touchBarMenuData = touchBarMenuData; |
7494 } | 7558 } |
7495 | 7559 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7636 | 7700 |
7637 for (auto& messageItem : messages.get()) { | 7701 for (auto& messageItem : messages.get()) { |
7638 if (condition == messageItem.condition && pageLoadTime < messageItem.sec
onds) { | 7702 if (condition == messageItem.condition && pageLoadTime < messageItem.sec
onds) { |
7639 logDiagnosticMessage(DiagnosticLoggingKeys::telemetryPageLoadKey(),
messageItem.message, ShouldSample::No); | 7703 logDiagnosticMessage(DiagnosticLoggingKeys::telemetryPageLoadKey(),
messageItem.message, ShouldSample::No); |
7640 logDiagnosticMessage(DiagnosticLoggingKeys::telemetryPageLoadKey(),
DiagnosticLoggingKeys::occurredKey(), ShouldSample::No); | 7704 logDiagnosticMessage(DiagnosticLoggingKeys::telemetryPageLoadKey(),
DiagnosticLoggingKeys::occurredKey(), ShouldSample::No); |
7641 break; | 7705 break; |
7642 } | 7706 } |
7643 } | 7707 } |
7644 } | 7708 } |
7645 | 7709 |
| 7710 void WebPageProxy::setDefersLoadingForTesting(bool defersLoading) |
| 7711 { |
| 7712 m_process->send(Messages::WebPage::SetDefersLoading(defersLoading), m_pageID
); |
| 7713 } |
| 7714 |
7646 } // namespace WebKit | 7715 } // namespace WebKit |
LEFT | RIGHT |