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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 #include <WebCore/AttachmentTypes.h> | 120 #include <WebCore/AttachmentTypes.h> |
121 #include <WebCore/BitmapImage.h> | 121 #include <WebCore/BitmapImage.h> |
122 #include <WebCore/DiagnosticLoggingClient.h> | 122 #include <WebCore/DiagnosticLoggingClient.h> |
123 #include <WebCore/DiagnosticLoggingKeys.h> | 123 #include <WebCore/DiagnosticLoggingKeys.h> |
124 #include <WebCore/DragController.h> | 124 #include <WebCore/DragController.h> |
125 #include <WebCore/DragData.h> | 125 #include <WebCore/DragData.h> |
126 #include <WebCore/EventNames.h> | 126 #include <WebCore/EventNames.h> |
127 #include <WebCore/FloatRect.h> | 127 #include <WebCore/FloatRect.h> |
128 #include <WebCore/FocusDirection.h> | 128 #include <WebCore/FocusDirection.h> |
129 #include <WebCore/FrameLoader.h> | 129 #include <WebCore/FrameLoader.h> |
| 130 #include <WebCore/GlobalFrameIdentifier.h> |
| 131 #include <WebCore/GlobalWindowIdentifier.h> |
130 #include <WebCore/JSDOMBinding.h> | 132 #include <WebCore/JSDOMBinding.h> |
131 #include <WebCore/JSDOMExceptionHandling.h> | 133 #include <WebCore/JSDOMExceptionHandling.h> |
132 #include <WebCore/LengthBox.h> | 134 #include <WebCore/LengthBox.h> |
133 #include <WebCore/MIMETypeRegistry.h> | 135 #include <WebCore/MIMETypeRegistry.h> |
134 #include <WebCore/MediaStreamRequest.h> | 136 #include <WebCore/MediaStreamRequest.h> |
135 #include <WebCore/NavigationPolicyCheck.h> | 137 #include <WebCore/NavigationPolicyCheck.h> |
136 #include <WebCore/PerformanceLoggingClient.h> | 138 #include <WebCore/PerformanceLoggingClient.h> |
137 #include <WebCore/PublicSuffix.h> | 139 #include <WebCore/PublicSuffix.h> |
138 #include <WebCore/RenderEmbeddedObject.h> | 140 #include <WebCore/RenderEmbeddedObject.h> |
| 141 #include <WebCore/SSLKeyGenerator.h> |
139 #include <WebCore/SerializedCryptoKeyWrap.h> | 142 #include <WebCore/SerializedCryptoKeyWrap.h> |
140 #include <WebCore/SharedBuffer.h> | 143 #include <WebCore/SharedBuffer.h> |
141 #include <WebCore/TextCheckerClient.h> | 144 #include <WebCore/TextCheckerClient.h> |
142 #include <WebCore/TextIndicator.h> | 145 #include <WebCore/TextIndicator.h> |
143 #include <WebCore/URL.h> | 146 #include <WebCore/URL.h> |
144 #include <WebCore/URLParser.h> | 147 #include <WebCore/URLParser.h> |
145 #include <WebCore/ValidationBubble.h> | 148 #include <WebCore/ValidationBubble.h> |
146 #include <WebCore/WindowFeatures.h> | 149 #include <WebCore/WindowFeatures.h> |
147 #include <stdio.h> | 150 #include <stdio.h> |
148 #include <wtf/NeverDestroyed.h> | 151 #include <wtf/NeverDestroyed.h> |
149 #include <wtf/SystemTracing.h> | 152 #include <wtf/SystemTracing.h> |
150 #include <wtf/text/StringView.h> | 153 #include <wtf/text/StringView.h> |
151 | 154 |
152 #if ENABLE(APPLICATION_MANIFEST) | 155 #if ENABLE(APPLICATION_MANIFEST) |
153 #include "APIApplicationManifest.h" | 156 #include "APIApplicationManifest.h" |
154 #endif | 157 #endif |
155 | 158 |
156 #if ENABLE(ASYNC_SCROLLING) | 159 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) |
157 #include "RemoteScrollingCoordinatorProxy.h" | 160 #include "RemoteScrollingCoordinatorProxy.h" |
158 #endif | 161 #endif |
159 | 162 |
160 #ifndef NDEBUG | 163 #ifndef NDEBUG |
161 #include <wtf/RefCountedLeakCounter.h> | 164 #include <wtf/RefCountedLeakCounter.h> |
162 #endif | 165 #endif |
163 | 166 |
164 #if PLATFORM(COCOA) | 167 #if PLATFORM(COCOA) |
165 #include "RemoteLayerTreeDrawingAreaProxy.h" | 168 #include "RemoteLayerTreeDrawingAreaProxy.h" |
166 #include "RemoteLayerTreeScrollingPerformanceData.h" | 169 #include "RemoteLayerTreeScrollingPerformanceData.h" |
(...skipping 25 matching lines...) Expand all Loading... |
192 #include "WebMediaSessionMetadata.h" | 195 #include "WebMediaSessionMetadata.h" |
193 #include <WebCore/MediaSessionMetadata.h> | 196 #include <WebCore/MediaSessionMetadata.h> |
194 #endif | 197 #endif |
195 | 198 |
196 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) | 199 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) |
197 #include "PlaybackSessionManagerProxy.h" | 200 #include "PlaybackSessionManagerProxy.h" |
198 #endif | 201 #endif |
199 | 202 |
200 #if ENABLE(WEB_AUTHN) | 203 #if ENABLE(WEB_AUTHN) |
201 #include "WebCredentialsMessengerProxy.h" | 204 #include "WebCredentialsMessengerProxy.h" |
| 205 #endif |
| 206 |
| 207 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) |
| 208 #include "WebResourceLoadStatisticsStore.h" |
202 #endif | 209 #endif |
203 | 210 |
204 // This controls what strategy we use for mouse wheel coalescing. | 211 // This controls what strategy we use for mouse wheel coalescing. |
205 #define MERGE_WHEEL_EVENTS 1 | 212 #define MERGE_WHEEL_EVENTS 1 |
206 | 213 |
207 #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()) |
208 #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()) |
209 | 216 |
210 #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__) |
211 | 218 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 291 |
285 ExceededDatabaseQuotaRecords::Record* ExceededDatabaseQuotaRecords::next() | 292 ExceededDatabaseQuotaRecords::Record* ExceededDatabaseQuotaRecords::next() |
286 { | 293 { |
287 m_currentRecord = nullptr; | 294 m_currentRecord = nullptr; |
288 if (!m_records.isEmpty()) | 295 if (!m_records.isEmpty()) |
289 m_currentRecord = m_records.takeFirst(); | 296 m_currentRecord = m_records.takeFirst(); |
290 return m_currentRecord.get(); | 297 return m_currentRecord.get(); |
291 } | 298 } |
292 | 299 |
293 #if !LOG_DISABLED | 300 #if !LOG_DISABLED |
| 301 static const char* webMouseEventTypeString(WebEvent::Type type) |
| 302 { |
| 303 switch (type) { |
| 304 case WebEvent::MouseDown: |
| 305 return "MouseDown"; |
| 306 case WebEvent::MouseUp: |
| 307 return "MouseUp"; |
| 308 case WebEvent::MouseMove: |
| 309 return "MouseMove"; |
| 310 case WebEvent::MouseForceChanged: |
| 311 return "MouseForceChanged"; |
| 312 case WebEvent::MouseForceDown: |
| 313 return "MouseForceDown"; |
| 314 case WebEvent::MouseForceUp: |
| 315 return "MouseForceUp"; |
| 316 default: |
| 317 ASSERT_NOT_REACHED(); |
| 318 return "<unknown>"; |
| 319 } |
| 320 } |
| 321 |
294 static const char* webKeyboardEventTypeString(WebEvent::Type type) | 322 static const char* webKeyboardEventTypeString(WebEvent::Type type) |
295 { | 323 { |
296 switch (type) { | 324 switch (type) { |
297 case WebEvent::KeyDown: | 325 case WebEvent::KeyDown: |
298 return "KeyDown"; | 326 return "KeyDown"; |
299 ···· | |
300 case WebEvent::KeyUp: | 327 case WebEvent::KeyUp: |
301 return "KeyUp"; | 328 return "KeyUp"; |
302 ···· | |
303 case WebEvent::RawKeyDown: | 329 case WebEvent::RawKeyDown: |
304 return "RawKeyDown"; | 330 return "RawKeyDown"; |
305 ···· | |
306 case WebEvent::Char: | 331 case WebEvent::Char: |
307 return "Char"; | 332 return "Char"; |
308 ···· | |
309 default: | 333 default: |
310 ASSERT_NOT_REACHED(); | 334 ASSERT_NOT_REACHED(); |
311 return "<unknown>"; | 335 return "<unknown>"; |
312 } | 336 } |
313 } | 337 } |
314 #endif // !LOG_DISABLED | 338 #endif // !LOG_DISABLED |
315 | 339 |
316 class PageClientProtector { | 340 class PageClientProtector { |
317 WTF_MAKE_NONCOPYABLE(PageClientProtector); | 341 WTF_MAKE_NONCOPYABLE(PageClientProtector); |
318 public: | 342 public: |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 #endif | 431 #endif |
408 #if PLATFORM(IOS) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_
MODE)) | 432 #if PLATFORM(IOS) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_
MODE)) |
409 m_playbackSessionManager = PlaybackSessionManagerProxy::create(*this); | 433 m_playbackSessionManager = PlaybackSessionManagerProxy::create(*this); |
410 m_videoFullscreenManager = VideoFullscreenManagerProxy::create(*this, *m_pla
ybackSessionManager); | 434 m_videoFullscreenManager = VideoFullscreenManagerProxy::create(*this, *m_pla
ybackSessionManager); |
411 #endif | 435 #endif |
412 | 436 |
413 #if ENABLE(APPLE_PAY) | 437 #if ENABLE(APPLE_PAY) |
414 m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this); | 438 m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this); |
415 #endif | 439 #endif |
416 | 440 |
| 441 #if USE(SYSTEM_PREVIEW) |
417 m_systemPreviewController = std::make_unique<SystemPreviewController>(*this)
; | 442 m_systemPreviewController = std::make_unique<SystemPreviewController>(*this)
; |
| 443 #endif |
418 | 444 |
419 #if ENABLE(WEB_AUTHN) | 445 #if ENABLE(WEB_AUTHN) |
420 m_credentialsMessenger = std::make_unique<WebCredentialsMessengerProxy>(*thi
s); | 446 m_credentialsMessenger = std::make_unique<WebCredentialsMessengerProxy>(*thi
s); |
421 #endif | 447 #endif |
422 | 448 |
423 m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(),
m_pageID, *this); | 449 m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(),
m_pageID, *this); |
424 | 450 |
425 #if PLATFORM(COCOA) | 451 #if PLATFORM(COCOA) |
426 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] { |
427 this->dispatchActivityStateChange(); | 453 this->dispatchActivityStateChange(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 return m_process->processIdentifier(); | 504 return m_process->processIdentifier(); |
479 } | 505 } |
480 | 506 |
481 bool WebPageProxy::isValid() const | 507 bool WebPageProxy::isValid() const |
482 { | 508 { |
483 // A page that has been explicitly closed is never valid. | 509 // A page that has been explicitly closed is never valid. |
484 if (m_isClosed) | 510 if (m_isClosed) |
485 return false; | 511 return false; |
486 | 512 |
487 return m_isValid; | 513 return m_isValid; |
| 514 } |
| 515 |
| 516 void WebPageProxy::notifyProcessPoolToPrewarm() |
| 517 { |
| 518 m_process->processPool().didReachGoodTimeToPrewarm(); |
488 } | 519 } |
489 | 520 |
490 void WebPageProxy::setPreferences(WebPreferences& preferences) | 521 void WebPageProxy::setPreferences(WebPreferences& preferences) |
491 { | 522 { |
492 if (&preferences == m_preferences.ptr()) | 523 if (&preferences == m_preferences.ptr()) |
493 return; | 524 return; |
494 | 525 |
495 m_preferences->removePage(*this); | 526 m_preferences->removePage(*this); |
496 m_preferences = preferences; | 527 m_preferences = preferences; |
497 m_preferences->addPage(*this); | 528 m_preferences->addPage(*this); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 return; | 666 return; |
636 | 667 |
637 RefPtr<API::Object> returnData; | 668 RefPtr<API::Object> returnData; |
638 m_injectedBundleClient->didReceiveSynchronousMessageFromInjectedBundle(this,
messageName, m_process->transformHandlesToObjects(messageBody.object()).get(),
returnData); | 669 m_injectedBundleClient->didReceiveSynchronousMessageFromInjectedBundle(this,
messageName, m_process->transformHandlesToObjects(messageBody.object()).get(),
returnData); |
639 returnUserData = UserData(m_process->transformObjectsToHandles(returnData.ge
t())); | 670 returnUserData = UserData(m_process->transformObjectsToHandles(returnData.ge
t())); |
640 } | 671 } |
641 | 672 |
642 void WebPageProxy::reattachToWebProcess() | 673 void WebPageProxy::reattachToWebProcess() |
643 { | 674 { |
644 auto process = makeRef(m_process->processPool().createNewWebProcessRespectin
gProcessCountLimit(m_websiteDataStore.get())); | 675 auto process = makeRef(m_process->processPool().createNewWebProcessRespectin
gProcessCountLimit(m_websiteDataStore.get())); |
645 reattachToWebProcess(WTFMove(process), false); | 676 reattachToWebProcess(WTFMove(process), nullptr, ReattachForBackForward::No); |
646 } | 677 } |
647 | 678 |
648 void WebPageProxy::attachToProcessForNavigation(Ref<WebProcessProxy>&& process) | 679 SuspendedPageProxy* WebPageProxy::maybeCreateSuspendedPage(WebProcessProxy& proc
ess, API::Navigation& navigation) |
649 { | |
650 // FIXME: If this WebPageProxy is the only one hosted in its WebProcess, doe
s this make it go away? | |
651 // We need to be prepared to reuse it later. | |
652 processDidTerminate(ProcessTerminationReason::NavigationSwap); | |
653 | |
654 // FIXME: this is to fix the ASSERT(isValid()) inside reattachToWebProcess,
some other way to fix this is needed. | |
655 m_isValid = false; | |
656 reattachToWebProcess(WTFMove(process), true); | |
657 } | |
658 | |
659 SuspendedPageProxy* WebPageProxy::maybeCreateSuspendedPage(WebProcessProxy& proc
ess) | |
660 { | 680 { |
661 ASSERT(!m_suspendedPage || m_suspendedPage->process() != &process); | 681 ASSERT(!m_suspendedPage || m_suspendedPage->process() != &process); |
662 | 682 |
663 auto* currentItem = m_backForwardList->currentItem(); | 683 auto* currentItem = navigation.fromItem(); |
664 if (!currentItem) { | 684 if (!currentItem) { |
665 LOG(ProcessSwapping, "WebPageProxy %" PRIu64 " unable to create suspende
d page for process pid %i - No current back/forward item", pageID(), process.pro
cessIdentifier()); | 685 LOG(ProcessSwapping, "WebPageProxy %" PRIu64 " unable to create suspende
d page for process pid %i - No current back/forward item", pageID(), process.pro
cessIdentifier()); |
666 return nullptr; | 686 return nullptr; |
667 } | 687 } |
668 | 688 |
669 m_suspendedPage = SuspendedPageProxy::create(*this, process, *currentItem); | 689 m_suspendedPage = SuspendedPageProxy::create(*this, process, *currentItem); |
670 | 690 |
671 LOG(ProcessSwapping, "WebPageProxy %" PRIu64 " created suspended page %s for
process pid %i, back/forward item %" PRIu64, pageID(), m_suspendedPage->logging
String(), process.processIdentifier(), currentItem->itemID()); | 691 LOG(ProcessSwapping, "WebPageProxy %" PRIu64 " created suspended page %s for
process pid %i, back/forward item %s" PRIu64, pageID(), m_suspendedPage->loggin
gString(), process.processIdentifier(), currentItem->itemID().logString()); |
672 | 692 |
673 return m_suspendedPage.get(); | 693 return m_suspendedPage.get(); |
674 } | 694 } |
675 | 695 |
676 void WebPageProxy::suspendedPageProcessClosed(SuspendedPageProxy& page) | 696 void WebPageProxy::suspendedPageClosed(SuspendedPageProxy& page) |
677 { | 697 { |
678 ASSERT_UNUSED(page, &page == m_suspendedPage.get()); | 698 ASSERT_UNUSED(page, &page == m_suspendedPage.get()); |
679 m_suspendedPage = nullptr; | 699 m_suspendedPage = nullptr; |
680 } | 700 } |
681 | 701 |
682 void WebPageProxy::reattachToWebProcess(Ref<WebProcessProxy>&& process, bool sus
pendInOldProcess) | 702 void WebPageProxy::reattachToWebProcess(Ref<WebProcessProxy>&& process, API::Nav
igation* navigation, ReattachForBackForward reattachForBackForward) |
683 { | 703 { |
684 ASSERT(!m_isClosed); | 704 ASSERT(!m_isClosed); |
685 ASSERT(!isValid()); | 705 ASSERT(!isValid()); |
686 | 706 |
687 m_isValid = true; | 707 m_isValid = true; |
688 | 708 |
689 if (!suspendInOldProcess) { | 709 // If the process we're attaching to is kept alive solely by our current sus
pended page, |
| 710 // we need to maintain that by temporarily keeping the suspended page alive. |
| 711 RefPtr<SuspendedPageProxy> currentSuspendedPage; |
| 712 if (!navigation) { |
690 m_process->removeWebPage(*this, m_pageID); | 713 m_process->removeWebPage(*this, m_pageID); |
691 m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiver
Name(), m_pageID); | 714 m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiver
Name(), m_pageID); |
692 } else | 715 } else { |
693 m_process->suspendWebPageProxy(*this); | 716 currentSuspendedPage = m_suspendedPage; |
| 717 m_process->suspendWebPageProxy(*this, *navigation); |
| 718 } |
694 | 719 |
695 m_process = WTFMove(process); | 720 m_process = WTFMove(process); |
| 721 if (m_process->state() == WebProcessProxy::State::Running) |
| 722 m_webProcessLifetimeTracker.webPageEnteringWebProcess(); |
| 723 |
| 724 if (reattachForBackForward == ReattachForBackForward::Yes) { |
| 725 ASSERT(!m_mainFrame); |
| 726 ASSERT(m_mainFrameID); |
| 727 m_mainFrame = WebFrameProxy::create(this, *m_mainFrameID); |
| 728 m_process->frameCreated(*m_mainFrameID, *m_mainFrame); |
| 729 } |
| 730 |
| 731 LOG(ProcessSwapping, "(ProcessSwapping) Reattaching WebPageProxy %p to WebPr
ocessProxy %p with pid %i\n", this, m_process.ptr(), m_process->processIdentifie
r()); |
696 | 732 |
697 ASSERT(m_process->state() != ChildProcessProxy::State::Terminated); | 733 ASSERT(m_process->state() != ChildProcessProxy::State::Terminated); |
698 if (m_process->state() == ChildProcessProxy::State::Running) | 734 if (m_process->state() == ChildProcessProxy::State::Running) |
699 processDidFinishLaunching(); | 735 processDidFinishLaunching(); |
700 m_process->addExistingWebPage(*this, m_pageID); | 736 m_process->addExistingWebPage(*this, m_pageID); |
701 m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(),
m_pageID, *this); | 737 m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(),
m_pageID, *this); |
702 | 738 |
703 updateActivityState(); | 739 updateActivityState(); |
704 updateThrottleState(); | 740 updateThrottleState(); |
705 | 741 |
706 m_inspector = WebInspectorProxy::create(this); | 742 m_inspector = WebInspectorProxy::create(this); |
707 #if ENABLE(FULLSCREEN_API) | 743 #if ENABLE(FULLSCREEN_API) |
708 m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.
fullScreenManagerProxyClient()); | 744 m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.
fullScreenManagerProxyClient()); |
709 #endif | 745 #endif |
710 #if PLATFORM(IOS) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_
MODE)) | 746 #if PLATFORM(IOS) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_
MODE)) |
711 m_playbackSessionManager = PlaybackSessionManagerProxy::create(*this); | 747 m_playbackSessionManager = PlaybackSessionManagerProxy::create(*this); |
712 m_videoFullscreenManager = VideoFullscreenManagerProxy::create(*this, *m_pla
ybackSessionManager); | 748 m_videoFullscreenManager = VideoFullscreenManagerProxy::create(*this, *m_pla
ybackSessionManager); |
713 #endif | 749 #endif |
714 | 750 |
715 #if ENABLE(APPLE_PAY) | 751 #if ENABLE(APPLE_PAY) |
716 m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this); | 752 m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this); |
717 #endif | 753 #endif |
718 | 754 |
| 755 #if USE(SYSTEM_PREVIEW) |
719 m_systemPreviewController = std::make_unique<SystemPreviewController>(*this)
; | 756 m_systemPreviewController = std::make_unique<SystemPreviewController>(*this)
; |
| 757 #endif |
720 | 758 |
721 #if ENABLE(WEB_AUTHN) | 759 #if ENABLE(WEB_AUTHN) |
722 m_credentialsMessenger = std::make_unique<WebCredentialsMessengerProxy>(*thi
s); | 760 m_credentialsMessenger = std::make_unique<WebCredentialsMessengerProxy>(*thi
s); |
723 #endif | 761 #endif |
724 | 762 |
725 initializeWebPage(); | 763 initializeWebPage(); |
726 | 764 |
727 m_pageClient.didRelaunchProcess(); | 765 m_pageClient.didRelaunchProcess(); |
728 m_drawingArea->waitForBackingStoreUpdateOnNextPaint(); | 766 m_drawingArea->waitForBackingStoreUpdateOnNextPaint(); |
729 } | 767 } |
(...skipping 22 matching lines...) Expand all Loading... |
752 { | 790 { |
753 if (m_isClosed) | 791 if (m_isClosed) |
754 return nullptr; | 792 return nullptr; |
755 | 793 |
756 ASSERT(!isValid()); | 794 ASSERT(!isValid()); |
757 reattachToWebProcess(); | 795 reattachToWebProcess(); |
758 | 796 |
759 if (&item != m_backForwardList->currentItem()) | 797 if (&item != m_backForwardList->currentItem()) |
760 m_backForwardList->goToItem(item); | 798 m_backForwardList->goToItem(item); |
761 | 799 |
762 auto navigation = m_navigationState->createBackForwardNavigation(item, Frame
LoadType::IndexedBackForward); | 800 auto navigation = m_navigationState->createBackForwardNavigation(item, m_bac
kForwardList->currentItem(), FrameLoadType::IndexedBackForward); |
763 | 801 |
764 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigatio
nID(), item.itemID(), FrameLoadType::IndexedBackForward, NavigationPolicyCheck::
Require), m_pageID); | 802 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigatio
nID(), item.itemID(), FrameLoadType::IndexedBackForward, NavigationPolicyCheck::
Require), m_pageID); |
765 m_process->responsivenessTimer().start(); | 803 m_process->responsivenessTimer().start(); |
766 | 804 |
767 return WTFMove(navigation); | 805 return WTFMove(navigation); |
768 } | 806 } |
769 | 807 |
770 void WebPageProxy::initializeWebPage() | 808 void WebPageProxy::initializeWebPage() |
771 { | 809 { |
772 ASSERT(isValid()); | 810 ASSERT(isValid()); |
773 | 811 |
774 const BackForwardListItemVector& items = m_backForwardList->entries(); | |
775 for (size_t i = 0; i < items.size(); ++i) | |
776 m_process->registerNewWebBackForwardListItem(items[i].get()); | |
777 | |
778 m_drawingArea = m_pageClient.createDrawingAreaProxy(); | 812 m_drawingArea = m_pageClient.createDrawingAreaProxy(); |
779 ASSERT(m_drawingArea); | 813 ASSERT(m_drawingArea); |
780 | 814 |
781 #if ENABLE(ASYNC_SCROLLING) | 815 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) |
782 if (m_drawingArea->type() == DrawingAreaTypeRemoteLayerTree) { | 816 if (m_drawingArea->type() == DrawingAreaTypeRemoteLayerTree) { |
783 m_scrollingCoordinatorProxy = std::make_unique<RemoteScrollingCoordinato
rProxy>(*this); | 817 m_scrollingCoordinatorProxy = std::make_unique<RemoteScrollingCoordinato
rProxy>(*this); |
784 #if PLATFORM(IOS) | 818 #if PLATFORM(IOS) |
785 // On iOS, main frame scrolls are sent in terms of visible rect updates. | 819 // On iOS, main frame scrolls are sent in terms of visible rect updates. |
786 m_scrollingCoordinatorProxy->setPropagatesMainFrameScrolls(false); | 820 m_scrollingCoordinatorProxy->setPropagatesMainFrameScrolls(false); |
787 #endif | 821 #endif |
788 } | 822 } |
789 #endif | 823 #endif |
790 | 824 |
791 auto parameters = creationParameters(); | 825 auto parameters = creationParameters(); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 void WebPageProxy::addPlatformLoadParameters(LoadParameters&) | 942 void WebPageProxy::addPlatformLoadParameters(LoadParameters&) |
909 { | 943 { |
910 } | 944 } |
911 #endif | 945 #endif |
912 | 946 |
913 RefPtr<API::Navigation> WebPageProxy::loadRequest(ResourceRequest&& request, Sho
uldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData) | 947 RefPtr<API::Navigation> WebPageProxy::loadRequest(ResourceRequest&& request, Sho
uldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData) |
914 { | 948 { |
915 if (m_isClosed) | 949 if (m_isClosed) |
916 return nullptr; | 950 return nullptr; |
917 | 951 |
918 auto navigation = m_navigationState->createLoadRequestNavigation(ResourceReq
uest(request)); | 952 auto navigation = m_navigationState->createLoadRequestNavigation(ResourceReq
uest(request), m_backForwardList->currentItem()); |
919 loadRequestWithNavigation(navigation.get(), WTFMove(request), shouldOpenExte
rnalURLsPolicy, userData, NavigationPolicyCheck::Require); | 953 loadRequestWithNavigation(navigation.get(), WTFMove(request), shouldOpenExte
rnalURLsPolicy, userData, NavigationPolicyCheck::Require); |
920 return WTFMove(navigation); | 954 return WTFMove(navigation); |
921 } | 955 } |
922 | 956 |
923 void WebPageProxy::loadRequestWithNavigation(API::Navigation& navigation, Resour
ceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy,
API::Object* userData, NavigationPolicyCheck navigationPolicyCheck) | 957 void WebPageProxy::loadRequestWithNavigation(API::Navigation& navigation, Resour
ceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy,
API::Object* userData, NavigationPolicyCheck navigationPolicyCheck) |
924 { | 958 { |
925 ASSERT(!m_isClosed); | 959 ASSERT(!m_isClosed); |
926 | 960 |
927 auto transaction = m_pageLoadState.transaction(); | 961 auto transaction = m_pageLoadState.transaction(); |
928 | 962 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 | 995 |
962 URL resourceDirectoryURL; | 996 URL resourceDirectoryURL; |
963 if (resourceDirectoryURLString.isNull()) | 997 if (resourceDirectoryURLString.isNull()) |
964 resourceDirectoryURL = URL(ParsedURLString, ASCIILiteral("file:///")); | 998 resourceDirectoryURL = URL(ParsedURLString, ASCIILiteral("file:///")); |
965 else { | 999 else { |
966 resourceDirectoryURL = URL(URL(), resourceDirectoryURLString); | 1000 resourceDirectoryURL = URL(URL(), resourceDirectoryURLString); |
967 if (!resourceDirectoryURL.isLocalFile()) | 1001 if (!resourceDirectoryURL.isLocalFile()) |
968 return nullptr; | 1002 return nullptr; |
969 } | 1003 } |
970 | 1004 |
971 auto navigation = m_navigationState->createLoadRequestNavigation(ResourceReq
uest(fileURL)); | 1005 auto navigation = m_navigationState->createLoadRequestNavigation(ResourceReq
uest(fileURL), m_backForwardList->currentItem()); |
972 | 1006 |
973 auto transaction = m_pageLoadState.transaction(); | 1007 auto transaction = m_pageLoadState.transaction(); |
974 | 1008 |
975 m_pageLoadState.setPendingAPIRequestURL(transaction, fileURLString); | 1009 m_pageLoadState.setPendingAPIRequestURL(transaction, fileURLString); |
976 | 1010 |
977 String resourceDirectoryPath = resourceDirectoryURL.fileSystemPath(); | 1011 String resourceDirectoryPath = resourceDirectoryURL.fileSystemPath(); |
978 | 1012 |
979 LoadParameters loadParameters; | 1013 LoadParameters loadParameters; |
980 loadParameters.navigationID = navigation->navigationID(); | 1014 loadParameters.navigationID = navigation->navigationID(); |
981 loadParameters.request = fileURL; | 1015 loadParameters.request = fileURL; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 loadParameters.userData = UserData(process().transformObjectsToHandles(userD
ata).get()); | 1078 loadParameters.userData = UserData(process().transformObjectsToHandles(userD
ata).get()); |
1045 addPlatformLoadParameters(loadParameters); | 1079 addPlatformLoadParameters(loadParameters); |
1046 | 1080 |
1047 m_process->assumeReadAccessToBaseURL(baseURL); | 1081 m_process->assumeReadAccessToBaseURL(baseURL); |
1048 m_process->send(Messages::WebPage::LoadString(loadParameters), m_pageID); | 1082 m_process->send(Messages::WebPage::LoadString(loadParameters), m_pageID); |
1049 m_process->responsivenessTimer().start(); | 1083 m_process->responsivenessTimer().start(); |
1050 | 1084 |
1051 return WTFMove(navigation); | 1085 return WTFMove(navigation); |
1052 } | 1086 } |
1053 | 1087 |
1054 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) |
1055 { | 1089 { |
1056 // 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 |
1057 // 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 |
1058 // handled properly. | 1092 // handled properly. |
1059 if (m_isClosed || m_isLoadingAlternateHTMLStringForFailingProvisionalLoad) | 1093 if (m_isClosed || m_isLoadingAlternateHTMLStringForFailingProvisionalLoad) |
1060 return; | 1094 return; |
1061 | 1095 |
1062 if (!m_failingProvisionalLoadURL.isEmpty()) | 1096 if (!m_failingProvisionalLoadURL.isEmpty()) |
1063 m_isLoadingAlternateHTMLStringForFailingProvisionalLoad = true; | 1097 m_isLoadingAlternateHTMLStringForFailingProvisionalLoad = true; |
1064 | 1098 |
1065 if (!isValid()) | 1099 if (!isValid()) |
1066 reattachToWebProcess(); | 1100 reattachToWebProcess(); |
1067 | 1101 |
1068 auto transaction = m_pageLoadState.transaction(); | 1102 auto transaction = m_pageLoadState.transaction(); |
1069 | 1103 |
1070 m_pageLoadState.setPendingAPIRequestURL(transaction, unreachableURL); | 1104 m_pageLoadState.setPendingAPIRequestURL(transaction, unreachableURL); |
1071 m_pageLoadState.setUnreachableURL(transaction, unreachableURL); | 1105 m_pageLoadState.setUnreachableURL(transaction, unreachableURL); |
1072 | 1106 |
1073 if (m_mainFrame) | 1107 if (m_mainFrame) |
1074 m_mainFrame->setUnreachableURL(unreachableURL); | 1108 m_mainFrame->setUnreachableURL(unreachableURL); |
1075 | 1109 |
1076 auto navigation = m_navigationState->createLoadDataNavigation(); | 1110 auto navigation = m_navigationState->createLoadDataNavigation(); |
1077 | 1111 |
1078 LoadParameters loadParameters; | 1112 LoadParameters loadParameters; |
1079 loadParameters.navigationID = navigation->navigationID(); | 1113 loadParameters.navigationID = navigation->navigationID(); |
1080 loadParameters.string = htmlString; | 1114 loadParameters.string = htmlString; |
1081 loadParameters.baseURLString = baseURL; | 1115 loadParameters.baseURLString = baseURL; |
1082 loadParameters.unreachableURLString = unreachableURL; | 1116 loadParameters.unreachableURLString = unreachableURL; |
1083 loadParameters.provisionalLoadErrorURLString = m_failingProvisionalLoadURL; | 1117 loadParameters.provisionalLoadErrorURLString = m_failingProvisionalLoadURL; |
| 1118 loadParameters.lockBackForwardList = lockBackForwardList; |
1084 loadParameters.userData = UserData(process().transformObjectsToHandles(userD
ata).get()); | 1119 loadParameters.userData = UserData(process().transformObjectsToHandles(userD
ata).get()); |
1085 addPlatformLoadParameters(loadParameters); | 1120 addPlatformLoadParameters(loadParameters); |
1086 | 1121 |
1087 m_process->assumeReadAccessToBaseURL(baseURL); | 1122 m_process->assumeReadAccessToBaseURL(baseURL); |
1088 m_process->assumeReadAccessToBaseURL(unreachableURL); | 1123 m_process->assumeReadAccessToBaseURL(unreachableURL); |
1089 m_process->send(Messages::WebPage::LoadAlternateHTMLString(loadParameters),
m_pageID); | 1124 m_process->send(Messages::WebPage::LoadAlternateHTMLString(loadParameters),
m_pageID); |
1090 m_process->responsivenessTimer().start(); | 1125 m_process->responsivenessTimer().start(); |
1091 } | 1126 } |
1092 | 1127 |
1093 void WebPageProxy::loadPlainTextString(const String& string, API::Object* userDa
ta) | 1128 void WebPageProxy::loadPlainTextString(const String& string, API::Object* userDa
ta) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 return goToBackForwardItem(*backItem, FrameLoadType::Back); | 1259 return goToBackForwardItem(*backItem, FrameLoadType::Back); |
1225 } | 1260 } |
1226 | 1261 |
1227 RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem
& item) | 1262 RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem
& item) |
1228 { | 1263 { |
1229 return goToBackForwardItem(item, FrameLoadType::IndexedBackForward); | 1264 return goToBackForwardItem(item, FrameLoadType::IndexedBackForward); |
1230 } | 1265 } |
1231 | 1266 |
1232 RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem
& item, FrameLoadType frameLoadType) | 1267 RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem
& item, FrameLoadType frameLoadType) |
1233 { | 1268 { |
1234 LOG(Loading, "WebPageProxy %p goToBackForwardItem to back item URL %s", this
, item.url().utf8().data()); | 1269 LOG(Loading, "WebPageProxy %p goToBackForwardItem to item URL %s", this, ite
m.url().utf8().data()); |
1235 | 1270 |
1236 if (!isValid()) | 1271 if (!isValid()) |
1237 return reattachToWebProcessWithItem(item); | 1272 return reattachToWebProcessWithItem(item); |
1238 | 1273 |
1239 auto transaction = m_pageLoadState.transaction(); | 1274 auto transaction = m_pageLoadState.transaction(); |
1240 | 1275 |
1241 m_pageLoadState.setPendingAPIRequestURL(transaction, item.url()); | 1276 m_pageLoadState.setPendingAPIRequestURL(transaction, item.url()); |
1242 | 1277 |
1243 RefPtr<API::Navigation> navigation; | 1278 RefPtr<API::Navigation> navigation; |
1244 if (!m_backForwardList->currentItem()->itemIsInSameDocument(item)) | 1279 if (!m_backForwardList->currentItem()->itemIsInSameDocument(item)) |
1245 navigation = m_navigationState->createBackForwardNavigation(item, frameL
oadType); | 1280 navigation = m_navigationState->createBackForwardNavigation(item, m_back
ForwardList->currentItem(), frameLoadType); |
1246 | 1281 |
1247 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigati
on->navigationID() : 0, item.itemID(), frameLoadType, NavigationPolicyCheck::Req
uire), m_pageID); | 1282 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigati
on->navigationID() : 0, item.itemID(), frameLoadType, NavigationPolicyCheck::Req
uire), m_pageID); |
1248 m_process->responsivenessTimer().start(); | 1283 m_process->responsivenessTimer().start(); |
1249 | 1284 |
1250 return navigation; | 1285 return navigation; |
1251 } | 1286 } |
1252 | 1287 |
1253 void WebPageProxy::tryRestoreScrollPosition() | 1288 void WebPageProxy::tryRestoreScrollPosition() |
1254 { | 1289 { |
1255 if (!isValid()) | 1290 if (!isValid()) |
1256 return; | 1291 return; |
1257 | 1292 |
1258 m_process->send(Messages::WebPage::TryRestoreScrollPosition(), m_pageID); | 1293 m_process->send(Messages::WebPage::TryRestoreScrollPosition(), m_pageID); |
1259 } | 1294 } |
1260 | 1295 |
1261 void WebPageProxy::didChangeBackForwardList(WebBackForwardListItem* added, Vecto
r<Ref<WebBackForwardListItem>>&& removed) | 1296 void WebPageProxy::didChangeBackForwardList(WebBackForwardListItem* added, Vecto
r<Ref<WebBackForwardListItem>>&& removed) |
1262 { | 1297 { |
1263 PageClientProtector protector(m_pageClient); | 1298 PageClientProtector protector(m_pageClient); |
1264 | 1299 |
1265 if (!m_navigationClient || !m_navigationClient->didChangeBackForwardList(*th
is, added, removed)) | 1300 if (!m_navigationClient || !m_navigationClient->didChangeBackForwardList(*th
is, added, removed)) |
1266 m_loaderClient->didChangeBackForwardList(*this, added, WTFMove(removed))
; | 1301 m_loaderClient->didChangeBackForwardList(*this, added, WTFMove(removed))
; |
1267 | 1302 |
1268 auto transaction = m_pageLoadState.transaction(); | 1303 auto transaction = m_pageLoadState.transaction(); |
1269 | 1304 |
1270 m_pageLoadState.setCanGoBack(transaction, m_backForwardList->backItem()); | 1305 m_pageLoadState.setCanGoBack(transaction, m_backForwardList->backItem()); |
1271 m_pageLoadState.setCanGoForward(transaction, m_backForwardList->forwardItem(
)); | 1306 m_pageLoadState.setCanGoForward(transaction, m_backForwardList->forwardItem(
)); |
1272 } | 1307 } |
1273 | 1308 |
1274 void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, bool inPageCache
, const UserData& userData) | 1309 void WebPageProxy::willGoToBackForwardListItem(const BackForwardItemIdentifier&
itemID, bool inPageCache, const UserData& userData) |
1275 { | 1310 { |
1276 PageClientProtector protector(m_pageClient); | 1311 PageClientProtector protector(m_pageClient); |
1277 | 1312 |
1278 if (auto* item = m_process->webBackForwardItem(itemID)) { | 1313 if (auto* item = m_backForwardList->itemForID(itemID)) { |
1279 if (m_navigationClient && m_navigationClient->willGoToBackForwardListIte
m(*this, *item, inPageCache, m_process->transformHandlesToObjects(userData.objec
t()).get())) | 1314 if (m_navigationClient && m_navigationClient->willGoToBackForwardListIte
m(*this, *item, inPageCache, m_process->transformHandlesToObjects(userData.objec
t()).get())) |
1280 return; | 1315 return; |
1281 m_loaderClient->willGoToBackForwardListItem(*this, *item, m_process->tra
nsformHandlesToObjects(userData.object()).get()); | 1316 m_loaderClient->willGoToBackForwardListItem(*this, *item, m_process->tra
nsformHandlesToObjects(userData.object()).get()); |
1282 } | 1317 } |
1283 } | 1318 } |
1284 | 1319 |
1285 bool WebPageProxy::shouldKeepCurrentBackForwardListItemInList(WebBackForwardList
Item& item) | 1320 bool WebPageProxy::shouldKeepCurrentBackForwardListItemInList(WebBackForwardList
Item& item) |
1286 { | 1321 { |
1287 PageClientProtector protector(m_pageClient); | 1322 PageClientProtector protector(m_pageClient); |
1288 | 1323 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 // 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. |
1548 updateThrottleState(); | 1583 updateThrottleState(); |
1549 | 1584 |
1550 #if ENABLE(POINTER_LOCK) | 1585 #if ENABLE(POINTER_LOCK) |
1551 if (((changed & ActivityState::IsVisible) && !isViewVisible()) || ((changed
& ActivityState::WindowIsActive) && !m_pageClient.isViewWindowActive()) | 1586 if (((changed & ActivityState::IsVisible) && !isViewVisible()) || ((changed
& ActivityState::WindowIsActive) && !m_pageClient.isViewWindowActive()) |
1552 || ((changed & ActivityState::IsFocused) && !(m_activityState & Activity
State::IsFocused))) | 1587 || ((changed & ActivityState::IsFocused) && !(m_activityState & Activity
State::IsFocused))) |
1553 requestPointerUnlock(); | 1588 requestPointerUnlock(); |
1554 #endif | 1589 #endif |
1555 | 1590 |
1556 if (changed & ActivityState::IsVisible) { | 1591 if (changed & ActivityState::IsVisible) { |
1557 if (isViewVisible()) | 1592 if (isViewVisible()) { |
1558 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 } |
1559 else { | 1599 else { |
1560 m_visiblePageToken = nullptr; | 1600 m_visiblePageToken = nullptr; |
1561 | 1601 |
1562 // 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 |
1563 // 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 |
1564 // stop the unresponsiveness timer here. | 1604 // stop the unresponsiveness timer here. |
1565 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 |
1566 } | 1610 } |
1567 } | 1611 } |
1568 | 1612 |
1569 if (changed & ActivityState::IsInWindow) { | 1613 if (changed & ActivityState::IsInWindow) { |
1570 if (isInWindow()) | 1614 if (isInWindow()) |
1571 viewDidEnterWindow(); | 1615 viewDidEnterWindow(); |
1572 else | 1616 else |
1573 viewDidLeaveWindow(); | 1617 viewDidLeaveWindow(); |
1574 } | 1618 } |
1575 | 1619 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 | 1937 |
1894 #endif | 1938 #endif |
1895 | 1939 |
1896 #endif // ENABLE(DRAG_SUPPORT) | 1940 #endif // ENABLE(DRAG_SUPPORT) |
1897 | 1941 |
1898 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event) | 1942 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event) |
1899 { | 1943 { |
1900 if (!isValid()) | 1944 if (!isValid()) |
1901 return; | 1945 return; |
1902 | 1946 |
| 1947 // If we receive multiple mousemove events and the most recent mousemove eve
nt has not been |
| 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 } |
| 1957 if (m_mouseEventQueue.size() == 1) // Otherwise, called from DidReceiveEvent
message handler. |
| 1958 processNextQueuedMouseEvent(); |
| 1959 } |
| 1960 ···· |
| 1961 void WebPageProxy::processNextQueuedMouseEvent() |
| 1962 { |
| 1963 if (!isValid()) |
| 1964 return; |
| 1965 |
| 1966 ASSERT(!m_mouseEventQueue.isEmpty()); |
| 1967 |
| 1968 const NativeWebMouseEvent& event = m_mouseEventQueue.first(); |
| 1969 ···· |
1903 if (m_pageClient.windowIsFrontWindowUnderMouse(event)) | 1970 if (m_pageClient.windowIsFrontWindowUnderMouse(event)) |
1904 setToolTip(String()); | 1971 setToolTip(String()); |
1905 | 1972 |
1906 // NOTE: This does not start the responsiveness timer because mouse move sho
uld not indicate interaction. | 1973 // NOTE: This does not start the responsiveness timer because mouse move sho
uld not indicate interaction. |
1907 if (event.type() != WebEvent::MouseMove) | 1974 if (event.type() != WebEvent::MouseMove) |
1908 m_process->responsivenessTimer().start(); | 1975 m_process->responsivenessTimer().start(); |
1909 else { | 1976 |
1910 if (m_processingMouseMoveEvent) { | 1977 LOG(MouseHandling, "UIProcess: sent mouse event %s (queue size %zu)", webMou
seEventTypeString(event.type()), m_mouseEventQueue.size()); |
1911 m_nextMouseMoveEvent = std::make_unique<NativeWebMouseEvent>(event); | |
1912 return; | |
1913 } | |
1914 | |
1915 m_processingMouseMoveEvent = true; | |
1916 } | |
1917 | |
1918 // <https://bugs.webkit.org/show_bug.cgi?id=57904> We need to keep track of
the mouse down event in the case where we | |
1919 // display a popup menu for select elements. When the user changes the selec
ted item, | |
1920 // we fake a mouse up event by using this stored down event. This event gets
cleared | |
1921 // when the mouse up message is received from WebProcess. | |
1922 if (event.type() == WebEvent::MouseDown) | |
1923 m_currentlyProcessedMouseDownEvent = std::make_unique<NativeWebMouseEven
t>(event); | |
1924 | |
1925 m_process->send(Messages::WebPage::MouseEvent(event), m_pageID); | 1978 m_process->send(Messages::WebPage::MouseEvent(event), m_pageID); |
1926 } | 1979 } |
1927 | 1980 |
1928 #if MERGE_WHEEL_EVENTS | 1981 #if MERGE_WHEEL_EVENTS |
1929 static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b) | 1982 static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b) |
1930 { | 1983 { |
1931 if (a.position() != b.position()) | 1984 if (a.position() != b.position()) |
1932 return false; | 1985 return false; |
1933 if (a.globalPosition() != b.globalPosition()) | 1986 if (a.globalPosition() != b.globalPosition()) |
1934 return false; | 1987 return false; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1984 return event; | 2037 return event; |
1985 #else | 2038 #else |
1986 while (!queue.isEmpty()) | 2039 while (!queue.isEmpty()) |
1987 coalescedEvents.append(queue.takeFirst()); | 2040 coalescedEvents.append(queue.takeFirst()); |
1988 return coalescedEvents.last(); | 2041 return coalescedEvents.last(); |
1989 #endif | 2042 #endif |
1990 } | 2043 } |
1991 | 2044 |
1992 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event) | 2045 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event) |
1993 { | 2046 { |
1994 #if ENABLE(ASYNC_SCROLLING) | 2047 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) |
1995 if (m_scrollingCoordinatorProxy && m_scrollingCoordinatorProxy->handleWheelE
vent(platform(event))) | 2048 if (m_scrollingCoordinatorProxy && m_scrollingCoordinatorProxy->handleWheelE
vent(platform(event))) |
1996 return; | 2049 return; |
1997 #endif | 2050 #endif |
1998 | 2051 |
1999 if (!isValid()) | 2052 if (!isValid()) |
2000 return; | 2053 return; |
2001 | 2054 |
2002 hideValidationMessage(); | 2055 hideValidationMessage(); |
2003 | 2056 |
2004 if (!m_currentlyProcessedWheelEvents.isEmpty()) { | 2057 if (!m_currentlyProcessedWheelEvents.isEmpty()) { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 | 2211 |
2159 static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) | 2212 static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) |
2160 { | 2213 { |
2161 if (static_cast<uintptr_t>(b) > static_cast<uintptr_t>(a)) | 2214 if (static_cast<uintptr_t>(b) > static_cast<uintptr_t>(a)) |
2162 return b; | 2215 return b; |
2163 return a; | 2216 return a; |
2164 } | 2217 } |
2165 | 2218 |
2166 void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent
) | 2219 void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent
) |
2167 { | 2220 { |
2168 #if ENABLE(ASYNC_SCROLLING) | 2221 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) |
2169 const EventNames& names = eventNames(); | 2222 const EventNames& names = eventNames(); |
2170 for (auto& touchPoint : touchStartEvent.touchPoints()) { | 2223 for (auto& touchPoint : touchStartEvent.touchPoints()) { |
2171 IntPoint location = touchPoint.location(); | 2224 IntPoint location = touchPoint.location(); |
2172 auto updateTrackingType = [this, location](TrackingType& trackingType, c
onst AtomicString& eventName) { | 2225 auto updateTrackingType = [this, location](TrackingType& trackingType, c
onst AtomicString& eventName) { |
2173 if (trackingType == TrackingType::Synchronous) | 2226 if (trackingType == TrackingType::Synchronous) |
2174 return; | 2227 return; |
2175 | 2228 |
2176 TrackingType trackingTypeForLocation = m_scrollingCoordinatorProxy->
eventTrackingTypeForPoint(eventName, location); | 2229 TrackingType trackingTypeForLocation = m_scrollingCoordinatorProxy->
eventTrackingTypeForPoint(eventName, location); |
2177 | 2230 |
2178 trackingType = mergeTrackingTypes(trackingType, trackingTypeForLocat
ion); | 2231 trackingType = mergeTrackingTypes(trackingType, trackingTypeForLocat
ion); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2243 #endif | 2296 #endif |
2244 | 2297 |
2245 #if ENABLE(IOS_TOUCH_EVENTS) | 2298 #if ENABLE(IOS_TOUCH_EVENTS) |
2246 void WebPageProxy::handleTouchEventSynchronously(NativeWebTouchEvent& event) | 2299 void WebPageProxy::handleTouchEventSynchronously(NativeWebTouchEvent& event) |
2247 { | 2300 { |
2248 if (!isValid()) | 2301 if (!isValid()) |
2249 return; | 2302 return; |
2250 | 2303 |
2251 TraceScope scope(SyncTouchEventStart, SyncTouchEventEnd); | 2304 TraceScope scope(SyncTouchEventStart, SyncTouchEventEnd); |
2252 | 2305 |
2253 if (event.type() == WebEvent::TouchStart) | 2306 updateTouchEventTracking(event); |
2254 updateTouchEventTracking(event); | |
2255 | 2307 |
2256 TrackingType touchEventsTrackingType = touchEventTrackingType(event); | 2308 TrackingType touchEventsTrackingType = touchEventTrackingType(event); |
2257 if (touchEventsTrackingType == TrackingType::NotTracking) | 2309 if (touchEventsTrackingType == TrackingType::NotTracking) |
2258 return; | 2310 return; |
2259 | 2311 |
2260 if (touchEventsTrackingType == TrackingType::Asynchronous) { | 2312 if (touchEventsTrackingType == TrackingType::Asynchronous) { |
2261 // 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. |
2262 // | 2314 // |
2263 // 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 |
2264 // can prevent a native gesture. | 2316 // can prevent a native gesture. |
2265 // 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. |
2266 // 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. |
2267 event.setCanPreventNativeGestures(false); | 2319 event.setCanPreventNativeGestures(false); |
2268 handleTouchEventAsynchronously(event); | 2320 handleTouchEventAsynchronously(event); |
2269 didReceiveEvent(event.type(), false); | 2321 didReceiveEvent(event.type(), false); |
2270 return; | 2322 return; |
2271 } | 2323 } |
2272 | 2324 |
2273 m_process->responsivenessTimer().start(); | 2325 m_process->responsivenessTimer().start(); |
2274 bool handled = false; | 2326 bool handled = false; |
2275 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; |
2276 didReceiveEvent(event.type(), handled); | 2331 didReceiveEvent(event.type(), handled); |
2277 m_pageClient.doneWithTouchEvent(event, handled); | 2332 m_pageClient.doneWithTouchEvent(event, handled); |
2278 m_process->responsivenessTimer().stop(); | 2333 m_process->responsivenessTimer().stop(); |
2279 | 2334 |
2280 if (event.allTouchPointsAreReleased()) | 2335 if (event.allTouchPointsAreReleased()) |
2281 m_touchEventTracking.reset(); | 2336 m_touchEventTracking.reset(); |
2282 } | 2337 } |
2283 | 2338 |
2284 void WebPageProxy::handleTouchEventAsynchronously(const NativeWebTouchEvent& eve
nt) | 2339 void WebPageProxy::handleTouchEventAsynchronously(const NativeWebTouchEvent& eve
nt) |
2285 { | 2340 { |
2286 if (!isValid()) | 2341 if (!isValid()) |
2287 return; | 2342 return; |
2288 | 2343 |
2289 TrackingType touchEventsTrackingType = touchEventTrackingType(event); | 2344 TrackingType touchEventsTrackingType = touchEventTrackingType(event); |
2290 if (touchEventsTrackingType == TrackingType::NotTracking) | 2345 if (touchEventsTrackingType == TrackingType::NotTracking) |
2291 return; | 2346 return; |
2292 | 2347 |
2293 m_process->send(Messages::EventDispatcher::TouchEvent(m_pageID, event), 0); | 2348 m_process->send(Messages::EventDispatcher::TouchEvent(m_pageID, event), 0); |
2294 | 2349 |
2295 if (event.allTouchPointsAreReleased()) | 2350 if (event.allTouchPointsAreReleased()) |
2296 m_touchEventTracking.reset(); | 2351 m_touchEventTracking.reset(); |
2297 } | 2352 } |
2298 | 2353 |
2299 #elif ENABLE(TOUCH_EVENTS) | 2354 #elif ENABLE(TOUCH_EVENTS) |
2300 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event) | 2355 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event) |
2301 { | 2356 { |
2302 if (!isValid()) | 2357 if (!isValid()) |
2303 return; | 2358 return; |
2304 | 2359 |
2305 if (event.type() == WebEvent::TouchStart) | 2360 updateTouchEventTracking(event); |
2306 updateTouchEventTracking(event); | |
2307 | 2361 |
2308 if (touchEventTrackingType(event) == TrackingType::NotTracking) | 2362 if (touchEventTrackingType(event) == TrackingType::NotTracking) |
2309 return; | 2363 return; |
2310 | 2364 |
2311 // 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 |
2312 // 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 |
2313 // 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. |
2314 if (!m_isPageSuspended) { | 2368 if (!m_isPageSuspended) { |
2315 m_touchEventQueue.append(event); | 2369 m_touchEventQueue.append(event); |
2316 m_process->responsivenessTimer().start(); | 2370 m_process->responsivenessTimer().start(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2376 } | 2430 } |
2377 | 2431 |
2378 auto* activePolicyListener = frame.activePolicyListenerProxy(); | 2432 auto* activePolicyListener = frame.activePolicyListenerProxy(); |
2379 if (activePolicyListener && activePolicyListener->policyListenerType() == Po
licyListenerType::NavigationAction) { | 2433 if (activePolicyListener && activePolicyListener->policyListenerType() == Po
licyListenerType::NavigationAction) { |
2380 ASSERT(activePolicyListener->listenerID() == listenerID); | 2434 ASSERT(activePolicyListener->listenerID() == listenerID); |
2381 | 2435 |
2382 if (action == PolicyAction::Use && navigation && frame.isMainFrame()) { | 2436 if (action == PolicyAction::Use && navigation && frame.isMainFrame()) { |
2383 auto proposedProcess = process().processPool().processForNavigation(
*this, *navigation, action); | 2437 auto proposedProcess = process().processPool().processForNavigation(
*this, *navigation, action); |
2384 | 2438 |
2385 if (proposedProcess.ptr() != &process()) { | 2439 if (proposedProcess.ptr() != &process()) { |
2386 LOG(ProcessSwapping, "Switching from process %i to new process f
or navigation %" PRIu64 " '%s'", processIdentifier(), navigation->navigationID()
, navigation->loggingString().utf8().data()); | 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()); |
2387 | 2441 |
2388 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 { |
2389 continueNavigationInNewProcess(navigation.get(), WTFMove(pro
posedProcess)); | 2443 continueNavigationInNewProcess(navigation.get(), WTFMove(pro
posedProcess)); |
2390 }); | 2444 }); |
2391 } | 2445 } |
2392 } | 2446 } |
2393 } | 2447 } |
2394 | 2448 |
| 2449 if (auto syncNavigationActionPolicyReply = WTFMove(m_syncNavigationActionPol
icyReply)) { |
| 2450 syncNavigationActionPolicyReply->send(navigation ? navigation->navigatio
nID() : 0, action, downloadID, WTFMove(websitePolicies)); |
| 2451 return; |
| 2452 } |
| 2453 |
2395 m_process->send(Messages::WebPage::DidReceivePolicyDecision(frame.frameID(),
listenerID, action, navigation ? navigation->navigationID() : 0, downloadID, we
bsitePolicies), m_pageID); | 2454 m_process->send(Messages::WebPage::DidReceivePolicyDecision(frame.frameID(),
listenerID, action, navigation ? navigation->navigationID() : 0, downloadID, we
bsitePolicies), m_pageID); |
2396 } | 2455 } |
2397 | 2456 |
2398 void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, R
ef<WebProcessProxy>&& process) | 2457 void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, R
ef<WebProcessProxy>&& process) |
2399 { | 2458 { |
2400 LOG(Loading, "Continuing navigation %" PRIu64 " '%s' in a new web process",
navigation.navigationID(), navigation.loggingString().utf8().data()); | 2459 LOG(Loading, "Continuing navigation %" PRIu64 " '%s' in a new web process",
navigation.navigationID(), navigation.loggingString()); |
| 2460 |
| 2461 Ref<WebProcessProxy> previousProcess = m_process.copyRef(); |
| 2462 std::optional<uint64_t> navigatedFrameIdentifierInPreviousProcess; |
| 2463 if (m_mainFrame) |
| 2464 navigatedFrameIdentifierInPreviousProcess = m_mainFrame->frameID(); |
2401 | 2465 |
2402 ASSERT(m_process.ptr() != process.ptr()); | 2466 ASSERT(m_process.ptr() != process.ptr()); |
2403 attachToProcessForNavigation(WTFMove(process)); | 2467 |
2404 | 2468 processDidTerminate(ProcessTerminationReason::NavigationSwap); |
2405 if (auto* item = navigation.backForwardListItem()) { | 2469 |
2406 if (item != m_backForwardList->currentItem()) | 2470 // FIXME: this is to fix the ASSERT(isValid()) inside reattachToWebProcess,
some other way to fix this is needed. |
2407 m_backForwardList->goToItem(*item); | 2471 m_isValid = false; |
2408 | 2472 reattachToWebProcess(WTFMove(process), &navigation, navigation.targetItem()
? ReattachForBackForward::Yes : ReattachForBackForward::No); |
2409 ASSERT(navigation.backForwardFrameLoadType()); | 2473 |
2410 ASSERT(isBackForwardLoadType(*navigation.backForwardFrameLoadType())); | 2474 if (auto* item = navigation.targetItem()) { |
2411 | 2475 LOG(Loading, "WebPageProxy %p continueNavigationInNewProcess to back ite
m URL %s", this, item->url().utf8().data()); |
| 2476 |
| 2477 auto transaction = m_pageLoadState.transaction(); |
| 2478 m_pageLoadState.setPendingAPIRequestURL(transaction, item->url()); |
| 2479 |
| 2480 auto itemStates = m_backForwardList-> filteredItemStates([this, targetIt
em = item](WebBackForwardListItem& item) { |
| 2481 if (auto* page = item.suspendedPage()) { |
| 2482 if (page->process() == m_process.ptr()) |
| 2483 return false; |
| 2484 } |
| 2485 return &item != targetItem; |
| 2486 }); |
| 2487 m_process->send(Messages::WebPage::UpdateBackForwardListForReattach(WTFM
ove(itemStates)), m_pageID); |
2412 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation.naviga
tionID(), item->itemID(), *navigation.backForwardFrameLoadType(), NavigationPoli
cyCheck::Bypass), m_pageID); | 2488 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation.naviga
tionID(), item->itemID(), *navigation.backForwardFrameLoadType(), NavigationPoli
cyCheck::Bypass), m_pageID); |
| 2489 m_process->responsivenessTimer().start(); |
2413 | 2490 |
2414 return; | 2491 return; |
2415 } | 2492 } |
2416 | 2493 |
2417 // FIXME: Work out timing of responding with the last policy delegate, etc | 2494 // FIXME: Work out timing of responding with the last policy delegate, etc |
2418 ASSERT(!navigation.currentRequest().isEmpty()); | 2495 ASSERT(!navigation.currentRequest().isEmpty()); |
2419 loadRequestWithNavigation(navigation, ResourceRequest { navigation.currentRe
quest() }, WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, nu
llptr, NavigationPolicyCheck::Bypass); | 2496 loadRequestWithNavigation(navigation, ResourceRequest { navigation.currentRe
quest() }, WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, nu
llptr, NavigationPolicyCheck::Bypass); |
2420 | 2497 |
2421 // Normally, notification of a server redirect comes from the WebContent pro
cess. | 2498 // Normally, notification of a server redirect comes from the WebContent pro
cess. |
2422 // If we are process swapping in response to a server redirect then that not
ification will not come from the new WebContent process. | 2499 // If we are process swapping in response to a server redirect then that not
ification will not come from the new WebContent process. |
2423 // In this case we have the UIProcess synthesize the redirect notification a
t the appropriate time. | 2500 // In this case we have the UIProcess synthesize the redirect notification a
t the appropriate time. |
2424 if (navigation.currentRequestIsRedirect()) { | 2501 if (navigation.currentRequestIsRedirect()) { |
2425 ASSERT(!m_mainFrame); | 2502 ASSERT(!m_mainFrame); |
2426 m_mainFrameCreationHandler = [this, protectedThis = makeRef(*this), navi
gation = makeRef(navigation), request = navigation.currentRequest()]() mutable
{ | 2503 m_mainFrameCreationHandler = [this, protectedThis = makeRef(*this), navi
gation = makeRef(navigation), request = navigation.currentRequest()]() mutable
{ |
2427 ASSERT(m_mainFrame); | 2504 ASSERT(m_mainFrame); |
2428 m_mainFrame->frameLoadState().didStartProvisionalLoad(request.url())
; | 2505 m_mainFrame->frameLoadState().didStartProvisionalLoad(request.url())
; |
2429 didReceiveServerRedirectForProvisionalLoadForFrame(m_mainFrame->fram
eID(), navigation->navigationID(), WTFMove(request), { }); | 2506 didReceiveServerRedirectForProvisionalLoadForFrame(m_mainFrame->fram
eID(), navigation->navigationID(), WTFMove(request), { }); |
2430 }; | 2507 }; |
2431 } | 2508 } |
| 2509 |
| 2510 if (!navigation.isCrossOriginWindowOpenNavigation() || !navigatedFrameIdenti
fierInPreviousProcess) |
| 2511 return; |
| 2512 |
| 2513 m_mainFrameWindowCreationHandler = [this, previousProcess = WTFMove(previous
Process), navigatedFrameIdentifierInPreviousProcess = *navigatedFrameIdentifierI
nPreviousProcess](const GlobalWindowIdentifier& windowIdentifier) { |
| 2514 ASSERT(m_mainFrame); |
| 2515 GlobalFrameIdentifier navigatedFrameIdentifierInNewProcess { pageID(), m
_mainFrame->frameID() }; |
| 2516 previousProcess->send(Messages::WebPage::FrameBecameRemote(navigatedFram
eIdentifierInPreviousProcess, navigatedFrameIdentifierInNewProcess, windowIdenti
fier), pageID()); |
| 2517 }; |
2432 } | 2518 } |
2433 | 2519 |
2434 void WebPageProxy::setUserAgent(String&& userAgent) | 2520 void WebPageProxy::setUserAgent(String&& userAgent) |
2435 { | 2521 { |
2436 if (m_userAgent == userAgent) | 2522 if (m_userAgent == userAgent) |
2437 return; | 2523 return; |
2438 m_userAgent = WTFMove(userAgent); | 2524 m_userAgent = WTFMove(userAgent); |
2439 | 2525 |
2440 #if ENABLE(SERVICE_WORKER) | 2526 #if ENABLE(SERVICE_WORKER) |
2441 // We update the service worker there at the moment to be sure we use values
used by actual web pages. | 2527 // We update the service worker there at the moment to be sure we use values
used by actual web pages. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2531 | 2617 |
2532 RefPtr<API::Navigation> WebPageProxy::restoreFromSessionState(SessionState sessi
onState, bool navigate) | 2618 RefPtr<API::Navigation> WebPageProxy::restoreFromSessionState(SessionState sessi
onState, bool navigate) |
2533 { | 2619 { |
2534 m_sessionRestorationRenderTreeSize = 0; | 2620 m_sessionRestorationRenderTreeSize = 0; |
2535 m_hitRenderTreeSizeThreshold = false; | 2621 m_hitRenderTreeSizeThreshold = false; |
2536 | 2622 |
2537 bool hasBackForwardList = !!sessionState.backForwardListState.currentIndex; | 2623 bool hasBackForwardList = !!sessionState.backForwardListState.currentIndex; |
2538 | 2624 |
2539 if (hasBackForwardList) { | 2625 if (hasBackForwardList) { |
2540 m_backForwardList->restoreFromState(WTFMove(sessionState.backForwardList
State)); | 2626 m_backForwardList->restoreFromState(WTFMove(sessionState.backForwardList
State)); |
2541 | |
2542 for (const auto& entry : m_backForwardList->entries()) | |
2543 process().registerNewWebBackForwardListItem(entry.get()); | |
2544 | |
2545 process().send(Messages::WebPage::RestoreSession(m_backForwardList->item
States()), m_pageID); | 2627 process().send(Messages::WebPage::RestoreSession(m_backForwardList->item
States()), m_pageID); |
2546 | 2628 |
2547 auto transaction = m_pageLoadState.transaction(); | 2629 auto transaction = m_pageLoadState.transaction(); |
2548 m_pageLoadState.setCanGoBack(transaction, m_backForwardList->backItem())
; | 2630 m_pageLoadState.setCanGoBack(transaction, m_backForwardList->backItem())
; |
2549 m_pageLoadState.setCanGoForward(transaction, m_backForwardList->forwardI
tem()); | 2631 m_pageLoadState.setCanGoForward(transaction, m_backForwardList->forwardI
tem()); |
2550 | 2632 |
2551 // The back / forward list was restored from a sessionState so we don't
want to snapshot the current | 2633 // The back / forward list was restored from a sessionState so we don't
want to snapshot the current |
2552 // page when navigating away. Suppress navigation snapshotting until the
next load has committed | 2634 // page when navigating away. Suppress navigation snapshotting until the
next load has committed |
2553 m_suppressAutomaticNavigationSnapshotting = true; | 2635 m_suppressAutomaticNavigationSnapshotting = true; |
2554 } | 2636 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2727 m_drawingArea->deviceScaleFactorDidChange(); | 2809 m_drawingArea->deviceScaleFactorDidChange(); |
2728 } | 2810 } |
2729 | 2811 |
2730 void WebPageProxy::accessibilitySettingsDidChange() | 2812 void WebPageProxy::accessibilitySettingsDidChange() |
2731 { | 2813 { |
2732 if (!isValid()) | 2814 if (!isValid()) |
2733 return; | 2815 return; |
2734 | 2816 |
2735 m_process->send(Messages::WebPage::AccessibilitySettingsDidChange(), m_pageI
D); | 2817 m_process->send(Messages::WebPage::AccessibilitySettingsDidChange(), m_pageI
D); |
2736 } | 2818 } |
| 2819 |
| 2820 #if ENABLE(ACCESSIBILITY_EVENTS) |
| 2821 void WebPageProxy::updateAccessibilityEventsEnabled(bool enabled) |
| 2822 { |
| 2823 if (!isValid()) |
| 2824 return; |
| 2825 |
| 2826 m_process->send(Messages::WebPage::UpdateAccessibilityEventsEnabled(enabled)
, m_pageID); |
| 2827 } |
| 2828 #endif |
2737 | 2829 |
2738 void WebPageProxy::setUseFixedLayout(bool fixed) | 2830 void WebPageProxy::setUseFixedLayout(bool fixed) |
2739 { | 2831 { |
2740 if (!isValid()) | 2832 if (!isValid()) |
2741 return; | 2833 return; |
2742 | 2834 |
2743 // This check is fine as the value is initialized in the web | 2835 // This check is fine as the value is initialized in the web |
2744 // process as part of the creation parameters. | 2836 // process as part of the creation parameters. |
2745 if (fixed == m_useFixedLayout) | 2837 if (fixed == m_useFixedLayout) |
2746 return; | 2838 return; |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3227 } | 3319 } |
3228 | 3320 |
3229 void WebPageProxy::didCreateMainFrame(uint64_t frameID) | 3321 void WebPageProxy::didCreateMainFrame(uint64_t frameID) |
3230 { | 3322 { |
3231 PageClientProtector protector(m_pageClient); | 3323 PageClientProtector protector(m_pageClient); |
3232 | 3324 |
3233 MESSAGE_CHECK(!m_mainFrame); | 3325 MESSAGE_CHECK(!m_mainFrame); |
3234 MESSAGE_CHECK(m_process->canCreateFrame(frameID)); | 3326 MESSAGE_CHECK(m_process->canCreateFrame(frameID)); |
3235 | 3327 |
3236 m_mainFrame = WebFrameProxy::create(this, frameID); | 3328 m_mainFrame = WebFrameProxy::create(this, frameID); |
| 3329 m_mainFrameID = frameID; |
3237 | 3330 |
3238 // Add the frame to the process wide map. | 3331 // Add the frame to the process wide map. |
3239 m_process->frameCreated(frameID, m_mainFrame.get()); | 3332 m_process->frameCreated(frameID, *m_mainFrame); |
3240 | 3333 |
3241 if (m_mainFrameCreationHandler) { | 3334 if (m_mainFrameCreationHandler) { |
3242 m_mainFrameCreationHandler(); | 3335 m_mainFrameCreationHandler(); |
3243 m_mainFrameCreationHandler = nullptr; | 3336 m_mainFrameCreationHandler = nullptr; |
3244 } | 3337 } |
3245 } | 3338 } |
3246 | 3339 |
3247 void WebPageProxy::didCreateSubframe(uint64_t frameID) | 3340 void WebPageProxy::didCreateSubframe(uint64_t frameID) |
3248 { | 3341 { |
3249 PageClientProtector protector(m_pageClient); | 3342 PageClientProtector protector(m_pageClient); |
3250 | 3343 |
3251 MESSAGE_CHECK(m_mainFrame); | 3344 MESSAGE_CHECK(m_mainFrame); |
3252 MESSAGE_CHECK(m_process->canCreateFrame(frameID)); | 3345 MESSAGE_CHECK(m_process->canCreateFrame(frameID)); |
3253 ···· | 3346 ···· |
3254 RefPtr<WebFrameProxy> subFrame = WebFrameProxy::create(this, frameID); | 3347 RefPtr<WebFrameProxy> subFrame = WebFrameProxy::create(this, frameID); |
3255 | 3348 |
3256 // Add the frame to the process wide map. | 3349 // Add the frame to the process wide map. |
3257 m_process->frameCreated(frameID, subFrame.get()); | 3350 m_process->frameCreated(frameID, *subFrame); |
| 3351 } |
| 3352 |
| 3353 void WebPageProxy::didCreateWindow(uint64_t frameID, GlobalWindowIdentifier&& wi
ndowIdentifier) |
| 3354 { |
| 3355 if (m_mainFrame && m_mainFrame->frameID() == frameID) { |
| 3356 if (auto mainFrameWindowCreationHandler = WTFMove(m_mainFrameWindowCreat
ionHandler)) |
| 3357 mainFrameWindowCreationHandler(windowIdentifier); |
| 3358 } |
3258 } | 3359 } |
3259 | 3360 |
3260 double WebPageProxy::estimatedProgress() const | 3361 double WebPageProxy::estimatedProgress() const |
3261 { | 3362 { |
3262 return m_pageLoadState.estimatedProgress(); | 3363 return m_pageLoadState.estimatedProgress(); |
3263 } | 3364 } |
3264 | 3365 |
3265 void WebPageProxy::didStartProgress() | 3366 void WebPageProxy::didStartProgress() |
3266 { | 3367 { |
3267 PageClientProtector protector(m_pageClient); | 3368 PageClientProtector protector(m_pageClient); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3328 navigation = &navigationState().navigation(navigationID); | 3429 navigation = &navigationState().navigation(navigationID); |
3329 | 3430 |
3330 // If this seemingly new load is actually continuing a server redirect for a
previous navigation in a new process, | 3431 // If this seemingly new load is actually continuing a server redirect for a
previous navigation in a new process, |
3331 // then we ignore this notification. | 3432 // then we ignore this notification. |
3332 if (navigation && navigation->currentRequestIsRedirect()) { | 3433 if (navigation && navigation->currentRequestIsRedirect()) { |
3333 auto navigationProcessIdentifier = navigation->currentRequestProcessIden
tifier(); | 3434 auto navigationProcessIdentifier = navigation->currentRequestProcessIden
tifier(); |
3334 if (navigationProcessIdentifier && *navigationProcessIdentifier != m_pro
cess->coreProcessIdentifier()) | 3435 if (navigationProcessIdentifier && *navigationProcessIdentifier != m_pro
cess->coreProcessIdentifier()) |
3335 return; | 3436 return; |
3336 } | 3437 } |
3337 | 3438 |
3338 LOG(Loading, "WebPageProxy::didStartProvisionalLoadForFrame to frameID %" PR
Iu64 ", navigationID %" PRIu64 ", url %s", frameID, navigationID, url.string().u
tf8().data()); | 3439 LOG(Loading, "WebPageProxy %" PRIu64 " in process pid %i didStartProvisional
LoadForFrame to frameID %" PRIu64 ", navigationID %" PRIu64 ", url %s", m_pageID
, m_process->processIdentifier(), frameID, navigationID, url.string().utf8().dat
a()); |
3339 | 3440 |
3340 auto transaction = m_pageLoadState.transaction(); | 3441 auto transaction = m_pageLoadState.transaction(); |
3341 | 3442 |
3342 m_pageLoadState.clearPendingAPIRequestURL(transaction); | 3443 m_pageLoadState.clearPendingAPIRequestURL(transaction); |
3343 | 3444 |
3344 if (frame->isMainFrame()) { | 3445 if (frame->isMainFrame()) { |
3345 if (m_pageLoadStart) | 3446 if (m_pageLoadStart) |
3346 reportPageLoadResult(ResourceError { ResourceError::Type::Cancellati
on }); | 3447 reportPageLoadResult(ResourceError { ResourceError::Type::Cancellati
on }); |
3347 m_pageLoadStart = MonotonicTime::now(); | 3448 m_pageLoadStart = MonotonicTime::now(); |
3348 m_pageLoadState.didStartProvisionalLoad(transaction, url, unreachableURL
); | 3449 m_pageLoadState.didStartProvisionalLoad(transaction, url, unreachableURL
); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3433 // Internally, we handle this the same way we handle a server redirect. Ther
e are no client callbacks | 3534 // Internally, we handle this the same way we handle a server redirect. Ther
e are no client callbacks |
3434 // for this, but if this is the main frame, clients may observe a change to
the page's URL. | 3535 // for this, but if this is the main frame, clients may observe a change to
the page's URL. |
3435 if (frame->isMainFrame()) | 3536 if (frame->isMainFrame()) |
3436 m_pageLoadState.didReceiveServerRedirectForProvisionalLoad(transaction,
url); | 3537 m_pageLoadState.didReceiveServerRedirectForProvisionalLoad(transaction,
url); |
3437 | 3538 |
3438 frame->didReceiveServerRedirectForProvisionalLoad(url); | 3539 frame->didReceiveServerRedirectForProvisionalLoad(url); |
3439 } | 3540 } |
3440 | 3541 |
3441 void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const Securi
tyOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisio
nalURL, const ResourceError& error, const UserData& userData) | 3542 void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const Securi
tyOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisio
nalURL, const ResourceError& error, const UserData& userData) |
3442 { | 3543 { |
| 3544 LOG(Loading, "(Loading) WebPageProxy %" PRIu64 " in web process pid %i didFa
ilProvisionalLoadForFrame to provisionalURL %s", m_pageID, m_process->processIde
ntifier(), provisionalURL.utf8().data()); |
| 3545 |
3443 PageClientProtector protector(m_pageClient); | 3546 PageClientProtector protector(m_pageClient); |
3444 | 3547 |
3445 WebFrameProxy* frame = m_process->webFrame(frameID); | 3548 WebFrameProxy* frame = m_process->webFrame(frameID); |
3446 MESSAGE_CHECK(frame); | 3549 MESSAGE_CHECK(frame); |
3447 | 3550 |
3448 if (m_controlledByAutomation) { | 3551 if (m_controlledByAutomation) { |
3449 if (auto* automationSession = process().processPool().automationSession(
)) | 3552 if (auto* automationSession = process().processPool().automationSession(
)) |
3450 automationSession->navigationOccurredForFrame(*frame); | 3553 automationSession->navigationOccurredForFrame(*frame); |
3451 } | 3554 } |
3452 | 3555 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3487 { | 3590 { |
3488 HashSet<CallbackID> loadDependentStringCallbackIDs = WTFMove(m_loadDependent
StringCallbackIDs); | 3591 HashSet<CallbackID> loadDependentStringCallbackIDs = WTFMove(m_loadDependent
StringCallbackIDs); |
3489 for (auto& callbackID : loadDependentStringCallbackIDs) { | 3592 for (auto& callbackID : loadDependentStringCallbackIDs) { |
3490 if (auto callback = m_callbacks.take<StringCallback>(callbackID)) | 3593 if (auto callback = m_callbacks.take<StringCallback>(callbackID)) |
3491 callback->invalidate(); | 3594 callback->invalidate(); |
3492 } | 3595 } |
3493 } | 3596 } |
3494 | 3597 |
3495 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID
, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFra
meLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPlugin
Document, std::optional<HasInsecureContent> hasInsecureContent, const UserData&
userData) | 3598 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID
, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFra
meLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPlugin
Document, std::optional<HasInsecureContent> hasInsecureContent, const UserData&
userData) |
3496 { | 3599 { |
| 3600 LOG(Loading, "(Loading) WebPageProxy %" PRIu64 " didCommitLoadForFrame in na
vigation %" PRIu64, m_pageID, m_navigationID); |
| 3601 LOG(BackForward, "(Back/Forward) After load commit, back/forward list is now
:%s", m_backForwardList->loggingString()); |
| 3602 |
3497 PageClientProtector protector(m_pageClient); | 3603 PageClientProtector protector(m_pageClient); |
3498 | 3604 |
3499 WebFrameProxy* frame = m_process->webFrame(frameID); | 3605 WebFrameProxy* frame = m_process->webFrame(frameID); |
3500 MESSAGE_CHECK(frame); | 3606 MESSAGE_CHECK(frame); |
3501 | 3607 |
3502 // FIXME: We should message check that navigationID is not zero here, but it
's currently zero for some navigations through the page cache. | 3608 // FIXME: We should message check that navigationID is not zero here, but it
's currently zero for some navigations through the page cache. |
3503 RefPtr<API::Navigation> navigation; | 3609 RefPtr<API::Navigation> navigation; |
3504 if (frame->isMainFrame() && navigationID) | 3610 if (frame->isMainFrame() && navigationID) |
3505 navigation = &navigationState().navigation(navigationID); | 3611 navigation = &navigationState().navigation(navigationID); |
3506 | 3612 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3593 | 3699 |
3594 if (m_navigationClient) { | 3700 if (m_navigationClient) { |
3595 if (frame->isMainFrame()) | 3701 if (frame->isMainFrame()) |
3596 m_navigationClient->didFinishDocumentLoad(*this, navigation.get(), m
_process->transformHandlesToObjects(userData.object()).get()); | 3702 m_navigationClient->didFinishDocumentLoad(*this, navigation.get(), m
_process->transformHandlesToObjects(userData.object()).get()); |
3597 } else | 3703 } else |
3598 m_loaderClient->didFinishDocumentLoadForFrame(*this, *frame, navigation.
get(), m_process->transformHandlesToObjects(userData.object()).get()); | 3704 m_loaderClient->didFinishDocumentLoadForFrame(*this, *frame, navigation.
get(), m_process->transformHandlesToObjects(userData.object()).get()); |
3599 } | 3705 } |
3600 | 3706 |
3601 void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID
, const UserData& userData) | 3707 void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID
, const UserData& userData) |
3602 { | 3708 { |
3603 LOG(Loading, "WebPageProxy::didFinishLoadForFrame - WebPageProxy %p with nav
igationID %llu didFinishLoad", this, navigationID); | 3709 LOG(Loading, "WebPageProxy::didFinishLoadForFrame - WebPageProxy %p with nav
igationID %" PRIu64 " didFinishLoad", this, navigationID); |
3604 | 3710 |
3605 PageClientProtector protector(m_pageClient); | 3711 PageClientProtector protector(m_pageClient); |
3606 | 3712 |
3607 WebFrameProxy* frame = m_process->webFrame(frameID); | 3713 WebFrameProxy* frame = m_process->webFrame(frameID); |
3608 MESSAGE_CHECK(frame); | 3714 MESSAGE_CHECK(frame); |
3609 | 3715 |
3610 // FIXME: We should message check that navigationID is not zero here, but it
's currently zero for some navigations through the page cache. | 3716 // FIXME: We should message check that navigationID is not zero here, but it
's currently zero for some navigations through the page cache. |
3611 RefPtr<API::Navigation> navigation; | 3717 RefPtr<API::Navigation> navigation; |
3612 if (frame->isMainFrame() && navigationID) | 3718 if (frame->isMainFrame() && navigationID) |
3613 navigation = &navigationState().navigation(navigationID); | 3719 navigation = &navigationState().navigation(navigationID); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3767 | 3873 |
3768 void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, cons
t UserData& userData) | 3874 void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, cons
t UserData& userData) |
3769 { | 3875 { |
3770 PageClientProtector protector(m_pageClient); | 3876 PageClientProtector protector(m_pageClient); |
3771 | 3877 |
3772 WebFrameProxy* frame = m_process->webFrame(frameID); | 3878 WebFrameProxy* frame = m_process->webFrame(frameID); |
3773 MESSAGE_CHECK(frame); | 3879 MESSAGE_CHECK(frame); |
3774 | 3880 |
3775 m_loaderClient->didFirstVisuallyNonEmptyLayoutForFrame(*this, *frame, m_proc
ess->transformHandlesToObjects(userData.object()).get()); | 3881 m_loaderClient->didFirstVisuallyNonEmptyLayoutForFrame(*this, *frame, m_proc
ess->transformHandlesToObjects(userData.object()).get()); |
3776 | 3882 |
3777 if (frame->isMainFrame()) | 3883 if (frame->isMainFrame()) { |
3778 m_pageClient.didFirstVisuallyNonEmptyLayoutForMainFrame(); | 3884 m_pageClient.didFirstVisuallyNonEmptyLayoutForMainFrame(); |
| 3885 notifyProcessPoolToPrewarm(); |
| 3886 } |
3779 } | 3887 } |
3780 | 3888 |
3781 void WebPageProxy::didLayoutForCustomContentProvider() | 3889 void WebPageProxy::didLayoutForCustomContentProvider() |
3782 { | 3890 { |
3783 didReachLayoutMilestone(DidFirstLayout | DidFirstVisuallyNonEmptyLayout | Di
dHitRelevantRepaintedObjectsAreaThreshold); | 3891 didReachLayoutMilestone(DidFirstLayout | DidFirstVisuallyNonEmptyLayout | Di
dHitRelevantRepaintedObjectsAreaThreshold); |
3784 } | 3892 } |
3785 | 3893 |
3786 void WebPageProxy::didReachLayoutMilestone(uint32_t layoutMilestones) | 3894 void WebPageProxy::didReachLayoutMilestone(uint32_t layoutMilestones) |
3787 { | 3895 { |
3788 PageClientProtector protector(m_pageClient); | 3896 PageClientProtector protector(m_pageClient); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3863 auto transaction = m_pageLoadState.transaction(); | 3971 auto transaction = m_pageLoadState.transaction(); |
3864 | 3972 |
3865 bool fromAPI = request.url() == m_pageLoadState.pendingAPIRequestURL(); | 3973 bool fromAPI = request.url() == m_pageLoadState.pendingAPIRequestURL(); |
3866 if (!fromAPI) | 3974 if (!fromAPI) |
3867 m_pageLoadState.clearPendingAPIRequestURL(transaction); | 3975 m_pageLoadState.clearPendingAPIRequestURL(transaction); |
3868 | 3976 |
3869 WebFrameProxy* frame = m_process->webFrame(frameID); | 3977 WebFrameProxy* frame = m_process->webFrame(frameID); |
3870 MESSAGE_CHECK(frame); | 3978 MESSAGE_CHECK(frame); |
3871 MESSAGE_CHECK_URL(request.url()); | 3979 MESSAGE_CHECK_URL(request.url()); |
3872 MESSAGE_CHECK_URL(originalRequest.url()); | 3980 MESSAGE_CHECK_URL(originalRequest.url()); |
3873 ···· | 3981 |
3874 Ref<API::Navigation> navigation = navigationID ? makeRef(m_navigationState->
navigation(navigationID)) : m_navigationState->createLoadRequestNavigation(Resou
rceRequest(request)); | 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()); |
3875 | 3997 |
3876 uint64_t newNavigationID = navigation->navigationID(); | 3998 uint64_t newNavigationID = navigation->navigationID(); |
3877 navigation->setWasUserInitiated(!!navigationActionData.userGestureTokenIdent
ifier); | 3999 navigation->setWasUserInitiated(!!navigationActionData.userGestureTokenIdent
ifier); |
3878 navigation->setShouldForceDownload(!navigationActionData.downloadAttribute.i
sNull()); | 4000 navigation->setShouldForceDownload(!navigationActionData.downloadAttribute.i
sNull() || request.isSystemPreview()); |
3879 navigation->setCurrentRequest(ResourceRequest(request), m_process->coreProce
ssIdentifier()); | 4001 navigation->setCurrentRequest(ResourceRequest(request), m_process->coreProce
ssIdentifier()); |
3880 navigation->setCurrentRequestIsRedirect(navigationActionData.isRedirect); | 4002 navigation->setCurrentRequestIsRedirect(navigationActionData.isRedirect); |
| 4003 navigation->setTreatAsSameOriginNavigation(navigationActionData.treatAsSameO
riginNavigation); |
3881 navigation->setIsCrossOriginWindowOpenNavigation(navigationActionData.isCros
sOriginWindowOpenNavigation); | 4004 navigation->setIsCrossOriginWindowOpenNavigation(navigationActionData.isCros
sOriginWindowOpenNavigation); |
3882 navigation->setOpener(navigationActionData.opener); | 4005 navigation->setOpener(navigationActionData.opener); |
3883 | 4006 |
3884 auto listener = makeRef(frame->setUpPolicyListenerProxy(listenerID, PolicyLi
stenerType::NavigationAction)); | 4007 auto listener = makeRef(frame->setUpPolicyListenerProxy(listenerID, PolicyLi
stenerType::NavigationAction)); |
3885 listener->setNavigation(WTFMove(navigation)); | 4008 listener->setNavigation(navigation.releaseNonNull()); |
3886 | 4009 |
3887 #if ENABLE(CONTENT_FILTERING) | 4010 #if ENABLE(CONTENT_FILTERING) |
3888 if (frame->didHandleContentFilterUnblockNavigation(request)) | 4011 if (frame->didHandleContentFilterUnblockNavigation(request)) |
3889 return receivedPolicyDecision(PolicyAction::Ignore, *frame, listenerID,
&m_navigationState->navigation(newNavigationID), { }); | 4012 return receivedPolicyDecision(PolicyAction::Ignore, *frame, listenerID,
&m_navigationState->navigation(newNavigationID), { }); |
3890 #else | 4013 #else |
3891 UNUSED_PARAM(newNavigationID); | 4014 UNUSED_PARAM(newNavigationID); |
3892 #endif | 4015 #endif |
3893 | 4016 |
3894 WebFrameProxy* originatingFrame = m_process->webFrame(originatingFrameInfoDa
ta.frameID); | 4017 WebFrameProxy* originatingFrame = m_process->webFrame(originatingFrameInfoDa
ta.frameID); |
3895 | 4018 |
(...skipping 10 matching lines...) Expand all Loading... |
3906 | 4029 |
3907 auto navigationAction = API::NavigationAction::create(WTFMove(navigation
ActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), std::nullopt, WT
FMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiated
Activity)); | 4030 auto navigationAction = API::NavigationAction::create(WTFMove(navigation
ActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), std::nullopt, WT
FMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiated
Activity)); |
3908 | 4031 |
3909 m_navigationClient->decidePolicyForNavigationAction(*this, WTFMove(navig
ationAction), WTFMove(listener), m_process->transformHandlesToObjects(userData.o
bject()).get()); | 4032 m_navigationClient->decidePolicyForNavigationAction(*this, WTFMove(navig
ationAction), WTFMove(listener), m_process->transformHandlesToObjects(userData.o
bject()).get()); |
3910 } else | 4033 } else |
3911 m_policyClient->decidePolicyForNavigationAction(*this, frame, WTFMove(na
vigationActionData), originatingFrame, originalRequest, WTFMove(request), WTFMov
e(listener), m_process->transformHandlesToObjects(userData.object()).get()); | 4034 m_policyClient->decidePolicyForNavigationAction(*this, frame, WTFMove(na
vigationActionData), originatingFrame, originalRequest, WTFMove(request), WTFMov
e(listener), m_process->transformHandlesToObjects(userData.object()).get()); |
3912 | 4035 |
3913 m_shouldSuppressAppLinksInNextNavigationPolicyDecision = false; | 4036 m_shouldSuppressAppLinksInNextNavigationPolicyDecision = false; |
3914 } | 4037 } |
3915 | 4038 |
| 4039 void WebPageProxy::decidePolicyForNavigationActionSync(uint64_t frameID, const W
ebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, Navigati
onActionData&& navigationActionData, const FrameInfoData& originatingFrameInfoDa
ta, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest,
WebCore::ResourceRequest&& request, uint64_t listenerID, const UserData& userDa
ta, Ref<Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedRepl
y>&& reply) |
| 4040 { |
| 4041 ASSERT(!m_syncNavigationActionPolicyReply); |
| 4042 m_syncNavigationActionPolicyReply = WTFMove(reply); |
| 4043 |
| 4044 decidePolicyForNavigationAction(frameID, frameSecurityOrigin, navigationID,
WTFMove(navigationActionData), originatingFrameInfoData, originatingPageID, orig
inalRequest, WTFMove(request), listenerID, userData); |
| 4045 |
| 4046 // If the client did not respond synchronously, proceed with the load. |
| 4047 if (auto syncNavigationActionPolicyReply = WTFMove(m_syncNavigationActionPol
icyReply)) |
| 4048 syncNavigationActionPolicyReply->send(navigationID, PolicyAction::Use, {
}, { }); |
| 4049 } |
| 4050 |
3916 void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const Securi
tyOriginData& frameSecurityOrigin, NavigationActionData&& navigationActionData,
ResourceRequest&& request, const String& frameName, uint64_t listenerID, const U
serData& userData) | 4051 void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const Securi
tyOriginData& frameSecurityOrigin, NavigationActionData&& navigationActionData,
ResourceRequest&& request, const String& frameName, uint64_t listenerID, const U
serData& userData) |
3917 { | 4052 { |
3918 PageClientProtector protector(m_pageClient); | 4053 PageClientProtector protector(m_pageClient); |
3919 | 4054 |
3920 WebFrameProxy* frame = m_process->webFrame(frameID); | 4055 WebFrameProxy* frame = m_process->webFrame(frameID); |
3921 MESSAGE_CHECK(frame); | 4056 MESSAGE_CHECK(frame); |
3922 MESSAGE_CHECK_URL(request.url()); | 4057 MESSAGE_CHECK_URL(request.url()); |
3923 | 4058 |
3924 Ref<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(
listenerID, PolicyListenerType::NewWindowAction); | 4059 Ref<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(
listenerID, PolicyListenerType::NewWindowAction); |
3925 | 4060 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4184 { | 4319 { |
4185 m_lastMouseMoveHitTestResult = API::HitTestResult::create(hitTestResultData)
; | 4320 m_lastMouseMoveHitTestResult = API::HitTestResult::create(hitTestResultData)
; |
4186 | 4321 |
4187 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModif
iers); | 4322 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModif
iers); |
4188 | 4323 |
4189 m_uiClient->mouseDidMoveOverElement(*this, hitTestResultData, modifiers, m_p
rocess->transformHandlesToObjects(userData.object()).get()); | 4324 m_uiClient->mouseDidMoveOverElement(*this, hitTestResultData, modifiers, m_p
rocess->transformHandlesToObjects(userData.object()).get()); |
4190 } | 4325 } |
4191 | 4326 |
4192 void WebPageProxy::connectionWillOpen(IPC::Connection& connection) | 4327 void WebPageProxy::connectionWillOpen(IPC::Connection& connection) |
4193 { | 4328 { |
4194 ASSERT(&connection == m_process->connection()); | 4329 ASSERT_UNUSED(connection, &connection == m_process->connection()); |
4195 | 4330 |
4196 m_webProcessLifetimeTracker.connectionWillOpen(connection); | 4331 m_webProcessLifetimeTracker.webPageEnteringWebProcess(); |
4197 } | 4332 } |
4198 | 4333 |
4199 void WebPageProxy::webProcessWillShutDown() | 4334 void WebPageProxy::webProcessWillShutDown() |
4200 { | 4335 { |
4201 m_webProcessLifetimeTracker.webPageLeavingWebProcess(); | 4336 m_webProcessLifetimeTracker.webPageLeavingWebProcess(); |
4202 } | 4337 } |
4203 | 4338 |
4204 void WebPageProxy::processDidFinishLaunching() | 4339 void WebPageProxy::processDidFinishLaunching() |
4205 { | 4340 { |
4206 ASSERT(m_process->state() == WebProcessProxy::State::Running); | 4341 ASSERT(m_process->state() == WebProcessProxy::State::Running); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4309 | 4444 |
4310 void WebPageProxy::getWindowFrame(Ref<Messages::WebPageProxy::GetWindowFrame::De
layedReply>&& reply) | 4445 void WebPageProxy::getWindowFrame(Ref<Messages::WebPageProxy::GetWindowFrame::De
layedReply>&& reply) |
4311 { | 4446 { |
4312 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) { |
4313 reply->send(m_pageClient.convertToUserSpace(frame)); | 4448 reply->send(m_pageClient.convertToUserSpace(frame)); |
4314 }); | 4449 }); |
4315 } | 4450 } |
4316 | 4451 |
4317 void WebPageProxy::getWindowFrameWithCallback(Function<void(FloatRect)>&& comple
tionHandler) | 4452 void WebPageProxy::getWindowFrameWithCallback(Function<void(FloatRect)>&& comple
tionHandler) |
4318 { | 4453 { |
4319 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 }); |
4320 } | 4457 } |
4321 | 4458 |
4322 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) |
4323 { | 4460 { |
4324 reply->send(m_pageClient.screenToRootView(screenPoint)); | 4461 reply->send(m_pageClient.screenToRootView(screenPoint)); |
4325 } | 4462 } |
4326 ···· | 4463 ···· |
4327 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) |
4328 { | 4465 { |
4329 reply->send(m_pageClient.rootViewToScreen(viewRect)); | 4466 reply->send(m_pageClient.rootViewToScreen(viewRect)); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4629 m_needsHiddenContentEditableQuirk = needsHiddenContentEditableQuirk; | 4766 m_needsHiddenContentEditableQuirk = needsHiddenContentEditableQuirk; |
4630 } | 4767 } |
4631 | 4768 |
4632 void WebPageProxy::setNeedsPlainTextQuirk(bool needsPlainTextQuirk) | 4769 void WebPageProxy::setNeedsPlainTextQuirk(bool needsPlainTextQuirk) |
4633 { | 4770 { |
4634 m_needsPlainTextQuirk = needsPlainTextQuirk; | 4771 m_needsPlainTextQuirk = needsPlainTextQuirk; |
4635 } | 4772 } |
4636 | 4773 |
4637 // BackForwardList | 4774 // BackForwardList |
4638 | 4775 |
4639 void WebPageProxy::backForwardAddItem(uint64_t itemID) | 4776 void WebPageProxy::backForwardAddItem(BackForwardListItemState&& itemState) |
4640 { | 4777 { |
4641 m_backForwardList->addItem(m_process->webBackForwardItem(itemID)); | 4778 m_backForwardList->addItem(WebBackForwardListItem::create(WTFMove(itemState)
, pageID())); |
4642 } | 4779 } |
4643 | 4780 |
4644 void WebPageProxy::backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle
& sandboxExtensionHandle) | 4781 void WebPageProxy::backForwardGoToItem(const BackForwardItemIdentifier& itemID,
SandboxExtension::Handle& sandboxExtensionHandle) |
4645 { | 4782 { |
4646 WebBackForwardListItem* item = m_process->webBackForwardItem(itemID); | 4783 WebBackForwardListItem* item = m_backForwardList->itemForID(itemID); |
4647 if (!item) | 4784 if (!item) |
4648 return; | 4785 return; |
4649 | 4786 |
4650 bool createdExtension = maybeInitializeSandboxExtensionHandle(URL(URL(), ite
m->url()), sandboxExtensionHandle); | 4787 bool createdExtension = maybeInitializeSandboxExtensionHandle(URL(URL(), ite
m->url()), sandboxExtensionHandle); |
4651 if (createdExtension) | 4788 if (createdExtension) |
4652 m_process->willAcquireUniversalFileReadSandboxExtension(); | 4789 m_process->willAcquireUniversalFileReadSandboxExtension(); |
4653 m_backForwardList->goToItem(*item); | 4790 m_backForwardList->goToItem(*item); |
4654 } | 4791 } |
4655 | 4792 |
4656 void WebPageProxy::backForwardItemAtIndex(int32_t index, uint64_t& itemID) | 4793 void WebPageProxy::backForwardItemAtIndex(int32_t index, std::optional<BackForwa
rdItemIdentifier>& itemID) |
4657 { | 4794 { |
4658 WebBackForwardListItem* item = m_backForwardList->itemAtIndex(index); | 4795 WebBackForwardListItem* item = m_backForwardList->itemAtIndex(index); |
4659 itemID = item ? item->itemID() : 0; | 4796 if (item) |
| 4797 itemID = item->itemID(); |
| 4798 else |
| 4799 itemID = std::nullopt; |
4660 } | 4800 } |
4661 | 4801 |
4662 void WebPageProxy::backForwardBackListCount(int32_t& count) | 4802 void WebPageProxy::backForwardBackListCount(int32_t& count) |
4663 { | 4803 { |
4664 count = m_backForwardList->backListCount(); | 4804 count = m_backForwardList->backListCount(); |
4665 } | 4805 } |
4666 | 4806 |
4667 void WebPageProxy::backForwardForwardListCount(int32_t& count) | 4807 void WebPageProxy::backForwardForwardListCount(int32_t& count) |
4668 { | 4808 { |
4669 count = m_backForwardList->forwardListCount(); | 4809 count = m_backForwardList->forwardListCount(); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4782 void WebPageProxy::valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelec
tedIndex) | 4922 void WebPageProxy::valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelec
tedIndex) |
4783 { | 4923 { |
4784 m_process->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenu(
newSelectedIndex), m_pageID); | 4924 m_process->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenu(
newSelectedIndex), m_pageID); |
4785 } | 4925 } |
4786 | 4926 |
4787 void WebPageProxy::setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index
) | 4927 void WebPageProxy::setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index
) |
4788 { | 4928 { |
4789 m_process->send(Messages::WebPage::SetTextForActivePopupMenu(index), m_pageI
D); | 4929 m_process->send(Messages::WebPage::SetTextForActivePopupMenu(index), m_pageI
D); |
4790 } | 4930 } |
4791 | 4931 |
| 4932 bool WebPageProxy::isProcessingMouseEvents() const |
| 4933 { |
| 4934 return !m_mouseEventQueue.isEmpty(); |
| 4935 } |
| 4936 |
4792 NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent() | 4937 NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent() |
4793 { | 4938 { |
4794 return m_currentlyProcessedMouseDownEvent.get(); | 4939 // <https://bugs.webkit.org/show_bug.cgi?id=57904> We need to keep track of
the mouse down event in the case where we |
| 4940 // display a popup menu for select elements. When the user changes the selec
ted item, we fake a mouseup event by |
| 4941 // using this stored mousedown event and changing the event type. This trick
ery happens when WebProcess handles |
| 4942 // a mousedown event that runs the default handler for HTMLSelectElement, so
the triggering mousedown must be the first event. |
| 4943 |
| 4944 if (m_mouseEventQueue.isEmpty()) |
| 4945 return nullptr; |
| 4946 ···· |
| 4947 auto& event = m_mouseEventQueue.first(); |
| 4948 if (event.type() != WebEvent::Type::MouseDown) |
| 4949 return nullptr; |
| 4950 |
| 4951 return &event; |
4795 } | 4952 } |
4796 | 4953 |
4797 void WebPageProxy::postMessageToInjectedBundle(const String& messageName, API::O
bject* messageBody) | 4954 void WebPageProxy::postMessageToInjectedBundle(const String& messageName, API::O
bject* messageBody) |
4798 { | 4955 { |
4799 process().send(Messages::WebPage::PostInjectedBundleMessage(messageName, Use
rData(process().transformObjectsToHandles(messageBody).get())), m_pageID); | 4956 process().send(Messages::WebPage::PostInjectedBundleMessage(messageName, Use
rData(process().transformObjectsToHandles(messageBody).get())), m_pageID); |
4800 } | 4957 } |
4801 | 4958 |
4802 #if PLATFORM(GTK) | 4959 #if PLATFORM(GTK) |
4803 void WebPageProxy::failedToShowPopupMenu() | 4960 void WebPageProxy::failedToShowPopupMenu() |
4804 { | 4961 { |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5192 case WebEvent::GestureChange: | 5349 case WebEvent::GestureChange: |
5193 case WebEvent::GestureEnd: | 5350 case WebEvent::GestureEnd: |
5194 #endif | 5351 #endif |
5195 m_process->responsivenessTimer().stop(); | 5352 m_process->responsivenessTimer().stop(); |
5196 break; | 5353 break; |
5197 } | 5354 } |
5198 | 5355 |
5199 switch (type) { | 5356 switch (type) { |
5200 case WebEvent::NoType: | 5357 case WebEvent::NoType: |
5201 break; | 5358 break; |
5202 case WebEvent::MouseMove: | |
5203 m_processingMouseMoveEvent = false; | |
5204 if (m_nextMouseMoveEvent) | |
5205 handleMouseEvent(*std::exchange(m_nextMouseMoveEvent, nullptr)); | |
5206 break; | |
5207 case WebEvent::MouseDown: | |
5208 break; | |
5209 case WebEvent::MouseUp: | |
5210 m_currentlyProcessedMouseDownEvent = nullptr; | |
5211 break; | |
5212 case WebEvent::MouseForceChanged: | 5359 case WebEvent::MouseForceChanged: |
5213 case WebEvent::MouseForceDown: | 5360 case WebEvent::MouseForceDown: |
5214 case WebEvent::MouseForceUp: | 5361 case WebEvent::MouseForceUp: |
| 5362 case WebEvent::MouseMove: |
| 5363 case WebEvent::MouseDown: |
| 5364 case WebEvent::MouseUp: { |
| 5365 LOG(MouseHandling, "WebPageProxy::didReceiveEvent: %s (queue size %zu)",
webMouseEventTypeString(type), m_mouseEventQueue.size()); |
| 5366 |
| 5367 // Retire the last sent event now that WebProcess is done handling it. |
| 5368 MESSAGE_CHECK(!m_mouseEventQueue.isEmpty()); |
| 5369 NativeWebMouseEvent event = m_mouseEventQueue.takeFirst(); |
| 5370 MESSAGE_CHECK(type == event.type()); |
| 5371 |
| 5372 if (!m_mouseEventQueue.isEmpty()) { |
| 5373 LOG(MouseHandling, " UIProcess: handling a queued mouse event from d
idReceiveEvent"); |
| 5374 processNextQueuedMouseEvent(); |
| 5375 } else if (auto* automationSession = process().processPool().automationS
ession()) |
| 5376 automationSession->mouseEventsFlushedForPage(*this); |
| 5377 |
5215 break; | 5378 break; |
| 5379 } |
5216 | 5380 |
5217 case WebEvent::Wheel: { | 5381 case WebEvent::Wheel: { |
5218 MESSAGE_CHECK(!m_currentlyProcessedWheelEvents.isEmpty()); | 5382 MESSAGE_CHECK(!m_currentlyProcessedWheelEvents.isEmpty()); |
5219 | 5383 |
5220 std::unique_ptr<Vector<NativeWebWheelEvent>> oldestCoalescedEvent = m_cu
rrentlyProcessedWheelEvents.takeFirst(); | 5384 std::unique_ptr<Vector<NativeWebWheelEvent>> oldestCoalescedEvent = m_cu
rrentlyProcessedWheelEvents.takeFirst(); |
5221 | 5385 |
5222 // FIXME: Dispatch additional events to the didNotHandleWheelEvent clien
t function. | 5386 // FIXME: Dispatch additional events to the didNotHandleWheelEvent clien
t function. |
5223 if (!handled) { | 5387 if (!handled) { |
5224 m_uiClient->didNotHandleWheelEvent(this, oldestCoalescedEvent->last(
)); | 5388 m_uiClient->didNotHandleWheelEvent(this, oldestCoalescedEvent->last(
)); |
5225 m_pageClient.wheelEventWasNotHandledByWebCore(oldestCoalescedEvent->
last()); | 5389 m_pageClient.wheelEventWasNotHandledByWebCore(oldestCoalescedEvent->
last()); |
5226 } | 5390 } |
5227 | 5391 |
5228 if (!m_wheelEventQueue.isEmpty()) | 5392 if (!m_wheelEventQueue.isEmpty()) |
5229 processNextQueuedWheelEvent(); | 5393 processNextQueuedWheelEvent(); |
5230 break; | 5394 break; |
5231 } | 5395 } |
5232 | 5396 |
5233 case WebEvent::KeyDown: | 5397 case WebEvent::KeyDown: |
5234 case WebEvent::KeyUp: | 5398 case WebEvent::KeyUp: |
5235 case WebEvent::RawKeyDown: | 5399 case WebEvent::RawKeyDown: |
5236 case WebEvent::Char: { | 5400 case WebEvent::Char: { |
5237 LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s (queue empty %d)", w
ebKeyboardEventTypeString(type), m_keyEventQueue.isEmpty()); | 5401 LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s (queue empty %d)", w
ebKeyboardEventTypeString(type), m_keyEventQueue.isEmpty()); |
5238 | 5402 |
5239 MESSAGE_CHECK(!m_keyEventQueue.isEmpty()); | 5403 MESSAGE_CHECK(!m_keyEventQueue.isEmpty()); |
5240 NativeWebKeyboardEvent event = m_keyEventQueue.takeFirst(); | 5404 NativeWebKeyboardEvent event = m_keyEventQueue.takeFirst(); |
5241 | 5405 |
5242 MESSAGE_CHECK(type == event.type()); | 5406 MESSAGE_CHECK(type == event.type()); |
5243 | 5407 |
5244 if (!m_keyEventQueue.isEmpty()) { | 5408 bool canProcessMoreKeyEvents = !m_keyEventQueue.isEmpty(); |
| 5409 if (canProcessMoreKeyEvents) { |
5245 LOG(KeyHandling, " UI process: sent keyEvent from didReceiveEvent"); | 5410 LOG(KeyHandling, " UI process: sent keyEvent from didReceiveEvent"); |
5246 m_process->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first())
, m_pageID); | 5411 m_process->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first())
, m_pageID); |
5247 } | 5412 } |
5248 | 5413 |
5249 // The call to doneWithKeyEvent may close this WebPage. | 5414 // The call to doneWithKeyEvent may close this WebPage. |
5250 // Protect against this being destroyed. | 5415 // Protect against this being destroyed. |
5251 Ref<WebPageProxy> protect(*this); | 5416 Ref<WebPageProxy> protect(*this); |
5252 | 5417 |
5253 m_pageClient.doneWithKeyEvent(event, handled); | 5418 m_pageClient.doneWithKeyEvent(event, handled); |
5254 if (!handled) | 5419 if (!handled) |
5255 m_uiClient->didNotHandleKeyEvent(this, event); | 5420 m_uiClient->didNotHandleKeyEvent(this, event); |
5256 | 5421 |
5257 // Notify the session after -[NSApp sendEvent:] has a crack at turning t
he event into an action. | 5422 // Notify the session after -[NSApp sendEvent:] has a crack at turning t
he event into an action. |
5258 if (m_keyEventQueue.isEmpty()) { | 5423 if (!canProcessMoreKeyEvents) { |
5259 if (auto* automationSession = process().processPool().automationSess
ion()) | 5424 if (auto* automationSession = process().processPool().automationSess
ion()) |
5260 automationSession->keyboardEventsFlushedForPage(*this); | 5425 automationSession->keyboardEventsFlushedForPage(*this); |
5261 } | 5426 } |
5262 break; | 5427 break; |
5263 } | 5428 } |
5264 #if ENABLE(MAC_GESTURE_EVENTS) | 5429 #if ENABLE(MAC_GESTURE_EVENTS) |
5265 case WebEvent::GestureStart: | 5430 case WebEvent::GestureStart: |
5266 case WebEvent::GestureChange: | 5431 case WebEvent::GestureChange: |
5267 case WebEvent::GestureEnd: { | 5432 case WebEvent::GestureEnd: { |
5268 MESSAGE_CHECK(!m_gestureEventQueue.isEmpty()); | 5433 MESSAGE_CHECK(!m_gestureEventQueue.isEmpty()); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5784 #endif | 5949 #endif |
5785 | 5950 |
5786 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS) | 5951 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS) |
5787 m_pageClient.mediaSessionManager().removeAllPlaybackTargetPickerClients(*thi
s); | 5952 m_pageClient.mediaSessionManager().removeAllPlaybackTargetPickerClients(*thi
s); |
5788 #endif | 5953 #endif |
5789 | 5954 |
5790 #if ENABLE(APPLE_PAY) | 5955 #if ENABLE(APPLE_PAY) |
5791 m_paymentCoordinator = nullptr; | 5956 m_paymentCoordinator = nullptr; |
5792 #endif | 5957 #endif |
5793 | 5958 |
| 5959 #if USE(SYSTEM_PREVIEW) |
5794 m_systemPreviewController = nullptr; | 5960 m_systemPreviewController = nullptr; |
| 5961 #endif |
5795 | 5962 |
5796 #if ENABLE(WEB_AUTHN) | 5963 #if ENABLE(WEB_AUTHN) |
5797 m_credentialsMessenger = nullptr; | 5964 m_credentialsMessenger = nullptr; |
5798 #endif | 5965 #endif |
5799 | 5966 |
5800 CallbackBase::Error error; | 5967 CallbackBase::Error error; |
5801 switch (resetStateReason) { | 5968 switch (resetStateReason) { |
5802 case ResetStateReason::NavigationSwap: | 5969 case ResetStateReason::NavigationSwap: |
5803 FALLTHROUGH; | 5970 FALLTHROUGH; |
5804 case ResetStateReason::PageInvalidated: | 5971 case ResetStateReason::PageInvalidated: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5852 | 6019 |
5853 m_pageClient.processDidExit(); | 6020 m_pageClient.processDidExit(); |
5854 | 6021 |
5855 auto resetStateReason = terminationReason == ProcessTerminationReason::Navig
ationSwap ? ResetStateReason::NavigationSwap : ResetStateReason::WebProcessExite
d; | 6022 auto resetStateReason = terminationReason == ProcessTerminationReason::Navig
ationSwap ? ResetStateReason::NavigationSwap : ResetStateReason::WebProcessExite
d; |
5856 resetState(resetStateReason); | 6023 resetState(resetStateReason); |
5857 | 6024 |
5858 m_pageClient.clearAllEditCommands(); | 6025 m_pageClient.clearAllEditCommands(); |
5859 m_pendingLearnOrIgnoreWordMessageCount = 0; | 6026 m_pendingLearnOrIgnoreWordMessageCount = 0; |
5860 | 6027 |
5861 // Can't expect DidReceiveEvent notifications from a crashed web process. | 6028 // Can't expect DidReceiveEvent notifications from a crashed web process. |
| 6029 m_mouseEventQueue.clear(); |
5862 m_keyEventQueue.clear(); | 6030 m_keyEventQueue.clear(); |
5863 m_wheelEventQueue.clear(); | 6031 m_wheelEventQueue.clear(); |
5864 m_currentlyProcessedWheelEvents.clear(); | 6032 m_currentlyProcessedWheelEvents.clear(); |
5865 | |
5866 m_nextMouseMoveEvent = nullptr; | |
5867 m_currentlyProcessedMouseDownEvent = nullptr; | |
5868 | |
5869 m_processingMouseMoveEvent = false; | |
5870 | |
5871 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) | 6033 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) |
5872 m_touchEventQueue.clear(); | 6034 m_touchEventQueue.clear(); |
5873 #endif | 6035 #endif |
5874 | 6036 |
5875 if (terminationReason != ProcessTerminationReason::NavigationSwap) { | 6037 if (terminationReason != ProcessTerminationReason::NavigationSwap) { |
5876 PageLoadState::Transaction transaction = m_pageLoadState.transaction(); | 6038 PageLoadState::Transaction transaction = m_pageLoadState.transaction(); |
5877 m_pageLoadState.reset(transaction); | 6039 m_pageLoadState.reset(transaction); |
5878 } | 6040 } |
5879 | 6041 |
5880 // FIXME: <rdar://problem/38676604> In case of process swaps, the old proces
s should gracefully suspend instead of terminating. | 6042 // FIXME: <rdar://problem/38676604> In case of process swaps, the old proces
s should gracefully suspend instead of terminating. |
(...skipping 18 matching lines...) Expand all Loading... |
5899 parameters.alwaysShowsVerticalScroller = m_alwaysShowsVerticalScroller; | 6061 parameters.alwaysShowsVerticalScroller = m_alwaysShowsVerticalScroller; |
5900 parameters.suppressScrollbarAnimations = m_suppressScrollbarAnimations; | 6062 parameters.suppressScrollbarAnimations = m_suppressScrollbarAnimations; |
5901 parameters.paginationMode = m_paginationMode; | 6063 parameters.paginationMode = m_paginationMode; |
5902 parameters.paginationBehavesLikeColumns = m_paginationBehavesLikeColumns; | 6064 parameters.paginationBehavesLikeColumns = m_paginationBehavesLikeColumns; |
5903 parameters.pageLength = m_pageLength; | 6065 parameters.pageLength = m_pageLength; |
5904 parameters.gapBetweenPages = m_gapBetweenPages; | 6066 parameters.gapBetweenPages = m_gapBetweenPages; |
5905 parameters.paginationLineGridEnabled = m_paginationLineGridEnabled; | 6067 parameters.paginationLineGridEnabled = m_paginationLineGridEnabled; |
5906 parameters.userAgent = userAgent(); | 6068 parameters.userAgent = userAgent(); |
5907 parameters.itemStates = m_backForwardList->itemStates(); | 6069 parameters.itemStates = m_backForwardList->itemStates(); |
5908 parameters.sessionID = sessionID(); | 6070 parameters.sessionID = sessionID(); |
5909 parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highestUse
dItemID(); | |
5910 parameters.userContentControllerID = m_userContentController->identifier(); | 6071 parameters.userContentControllerID = m_userContentController->identifier(); |
5911 parameters.visitedLinkTableID = m_visitedLinkStore->identifier(); | 6072 parameters.visitedLinkTableID = m_visitedLinkStore->identifier(); |
5912 parameters.websiteDataStoreID = m_websiteDataStore->identifier(); | 6073 parameters.websiteDataStoreID = m_websiteDataStore->identifier(); |
5913 parameters.canRunBeforeUnloadConfirmPanel = m_uiClient->canRunBeforeUnloadCo
nfirmPanel(); | 6074 parameters.canRunBeforeUnloadConfirmPanel = m_uiClient->canRunBeforeUnloadCo
nfirmPanel(); |
5914 parameters.canRunModal = m_canRunModal; | 6075 parameters.canRunModal = m_canRunModal; |
5915 parameters.deviceScaleFactor = deviceScaleFactor(); | 6076 parameters.deviceScaleFactor = deviceScaleFactor(); |
5916 parameters.viewScaleFactor = m_viewScaleFactor; | 6077 parameters.viewScaleFactor = m_viewScaleFactor; |
5917 parameters.topContentInset = m_topContentInset; | 6078 parameters.topContentInset = m_topContentInset; |
5918 parameters.mediaVolume = m_mediaVolume; | 6079 parameters.mediaVolume = m_mediaVolume; |
5919 parameters.muted = m_mutedState; | 6080 parameters.muted = m_mutedState; |
5920 parameters.mayStartMediaWhenInWindow = m_mayStartMediaWhenInWindow; | 6081 parameters.mayStartMediaWhenInWindow = m_mayStartMediaWhenInWindow; |
5921 parameters.minimumLayoutSize = m_minimumLayoutSize; | 6082 parameters.viewLayoutSize = m_viewLayoutSize; |
5922 parameters.autoSizingShouldExpandToViewHeight = m_autoSizingShouldExpandToVi
ewHeight; | 6083 parameters.autoSizingShouldExpandToViewHeight = m_autoSizingShouldExpandToVi
ewHeight; |
5923 parameters.viewportSizeForCSSViewportUnits = m_viewportSizeForCSSViewportUni
ts; | 6084 parameters.viewportSizeForCSSViewportUnits = m_viewportSizeForCSSViewportUni
ts; |
5924 parameters.scrollPinningBehavior = m_scrollPinningBehavior; | 6085 parameters.scrollPinningBehavior = m_scrollPinningBehavior; |
5925 if (m_scrollbarOverlayStyle) | 6086 if (m_scrollbarOverlayStyle) |
5926 parameters.scrollbarOverlayStyle = m_scrollbarOverlayStyle.value(); | 6087 parameters.scrollbarOverlayStyle = m_scrollbarOverlayStyle.value(); |
5927 else | 6088 else |
5928 parameters.scrollbarOverlayStyle = std::nullopt; | 6089 parameters.scrollbarOverlayStyle = std::nullopt; |
5929 parameters.backgroundExtendsBeyondPage = m_backgroundExtendsBeyondPage; | 6090 parameters.backgroundExtendsBeyondPage = m_backgroundExtendsBeyondPage; |
5930 parameters.layerHostingMode = m_layerHostingMode; | 6091 parameters.layerHostingMode = m_layerHostingMode; |
5931 parameters.controlledByAutomation = m_controlledByAutomation; | 6092 parameters.controlledByAutomation = m_controlledByAutomation; |
5932 #if ENABLE(REMOTE_INSPECTOR) | 6093 #if ENABLE(REMOTE_INSPECTOR) |
5933 parameters.allowsRemoteInspection = m_allowsRemoteInspection; | 6094 parameters.allowsRemoteInspection = m_allowsRemoteInspection; |
5934 parameters.remoteInspectionNameOverride = m_remoteInspectionNameOverride; | 6095 parameters.remoteInspectionNameOverride = m_remoteInspectionNameOverride; |
5935 #endif | 6096 #endif |
5936 #if PLATFORM(MAC) | 6097 #if PLATFORM(MAC) |
5937 parameters.colorSpace = m_pageClient.colorSpace(); | 6098 parameters.colorSpace = m_pageClient.colorSpace(); |
5938 parameters.useSystemAppearance = m_useSystemAppearance; | 6099 parameters.useSystemAppearance = m_useSystemAppearance; |
5939 parameters.defaultAppearance = m_defaultAppearance; | 6100 parameters.defaultAppearance = m_defaultAppearance; |
5940 #endif | 6101 #endif |
5941 #if PLATFORM(IOS) | 6102 #if PLATFORM(IOS) |
5942 parameters.screenSize = screenSize(); | 6103 parameters.screenSize = screenSize(); |
5943 parameters.availableScreenSize = availableScreenSize(); | 6104 parameters.availableScreenSize = availableScreenSize(); |
5944 parameters.overrideScreenSize = overrideScreenSize(); | 6105 parameters.overrideScreenSize = overrideScreenSize(); |
5945 parameters.textAutosizingWidth = textAutosizingWidth(); | 6106 parameters.textAutosizingWidth = textAutosizingWidth(); |
5946 parameters.mimeTypesWithCustomContentProviders = m_pageClient.mimeTypesWithC
ustomContentProviders(); | 6107 parameters.mimeTypesWithCustomContentProviders = m_pageClient.mimeTypesWithC
ustomContentProviders(); |
5947 parameters.ignoresViewportScaleLimits = m_forceAlwaysUserScalable; | 6108 parameters.ignoresViewportScaleLimits = m_forceAlwaysUserScalable; |
5948 parameters.viewportConfigurationMinimumLayoutSize = m_viewportConfigurationM
inimumLayoutSize; | 6109 parameters.viewportConfigurationViewLayoutSize = m_viewportConfigurationView
LayoutSize; |
5949 parameters.viewportConfigurationViewSize = m_viewportConfigurationViewSize; | |
5950 parameters.maximumUnobscuredSize = m_maximumUnobscuredSize; | 6110 parameters.maximumUnobscuredSize = m_maximumUnobscuredSize; |
5951 #endif | 6111 #endif |
5952 | 6112 |
5953 #if PLATFORM(MAC) | 6113 #if PLATFORM(MAC) |
5954 parameters.appleMailPaginationQuirkEnabled = appleMailPaginationQuirkEnabled
(); | 6114 parameters.appleMailPaginationQuirkEnabled = appleMailPaginationQuirkEnabled
(); |
5955 #else | 6115 #else |
5956 parameters.appleMailPaginationQuirkEnabled = false; | 6116 parameters.appleMailPaginationQuirkEnabled = false; |
5957 #endif | 6117 #endif |
5958 ···· | 6118 ···· |
5959 #if PLATFORM(MAC) | 6119 #if PLATFORM(MAC) |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6306 void WebPageProxy::updateWebsitePolicies(WebsitePoliciesData&& websitePolicies) | 6466 void WebPageProxy::updateWebsitePolicies(WebsitePoliciesData&& websitePolicies) |
6307 { | 6467 { |
6308 m_process->send(Messages::WebPage::UpdateWebsitePolicies(websitePolicies), m
_pageID); | 6468 m_process->send(Messages::WebPage::UpdateWebsitePolicies(websitePolicies), m
_pageID); |
6309 } | 6469 } |
6310 | 6470 |
6311 void WebPageProxy::didFinishLoadingDataForCustomContentProvider(const String& su
ggestedFilename, const IPC::DataReference& dataReference) | 6471 void WebPageProxy::didFinishLoadingDataForCustomContentProvider(const String& su
ggestedFilename, const IPC::DataReference& dataReference) |
6312 { | 6472 { |
6313 m_pageClient.didFinishLoadingDataForCustomContentProvider(suggestedFilename,
dataReference); | 6473 m_pageClient.didFinishLoadingDataForCustomContentProvider(suggestedFilename,
dataReference); |
6314 } | 6474 } |
6315 | 6475 |
6316 void WebPageProxy::backForwardRemovedItem(uint64_t itemID) | 6476 void WebPageProxy::backForwardRemovedItem(const BackForwardItemIdentifier& itemI
D) |
6317 { | 6477 { |
6318 m_process->removeBackForwardItem(itemID); | |
6319 m_process->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageI
D); | 6478 m_process->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageI
D); |
6320 } | 6479 } |
6321 | 6480 |
6322 void WebPageProxy::setCanRunModal(bool canRunModal) | 6481 void WebPageProxy::setCanRunModal(bool canRunModal) |
6323 { | 6482 { |
6324 if (!isValid()) | 6483 if (!isValid()) |
6325 return; | 6484 return; |
6326 | 6485 |
6327 // It's only possible to change the state for a WebPage which | 6486 // It's only possible to change the state for a WebPage which |
6328 // already qualifies for running modal child web pages, otherwise | 6487 // already qualifies for running modal child web pages, otherwise |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6430 | 6589 |
6431 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) |
6432 { | 6591 { |
6433 if (!suggestedFilename.endsWithIgnoringASCIICase(".pdf")) | 6592 if (!suggestedFilename.endsWithIgnoringASCIICase(".pdf")) |
6434 return; | 6593 return; |
6435 | 6594 |
6436 saveDataToFileInDownloadsFolder(WTFMove(suggestedFilename), ASCIILiteral("ap
plication/pdf"), WTFMove(originatingURL), | 6595 saveDataToFileInDownloadsFolder(WTFMove(suggestedFilename), ASCIILiteral("ap
plication/pdf"), WTFMove(originatingURL), |
6437 API::Data::create(dataReference.data(), dataReference.size()).get()); | 6596 API::Data::create(dataReference.data(), dataReference.size()).get()); |
6438 } | 6597 } |
6439 | 6598 |
6440 void WebPageProxy::setMinimumLayoutSize(const IntSize& minimumLayoutSize) | 6599 void WebPageProxy::setViewLayoutSize(const IntSize& viewLayoutSize) |
6441 { | 6600 { |
6442 if (m_minimumLayoutSize == minimumLayoutSize) | 6601 if (m_viewLayoutSize == viewLayoutSize) |
6443 return; | 6602 return; |
6444 | 6603 |
6445 m_minimumLayoutSize = minimumLayoutSize; | 6604 m_viewLayoutSize = viewLayoutSize; |
6446 | 6605 |
6447 if (!isValid()) | 6606 if (!isValid()) |
6448 return; | 6607 return; |
6449 | 6608 |
6450 m_process->send(Messages::WebPage::SetMinimumLayoutSize(minimumLayoutSize),
m_pageID); | 6609 m_process->send(Messages::WebPage::SetViewLayoutSize(viewLayoutSize), m_page
ID); |
6451 m_drawingArea->minimumLayoutSizeDidChange(); | 6610 m_drawingArea->viewLayoutSizeDidChange(); |
6452 | 6611 |
6453 #if USE(APPKIT) | 6612 #if USE(APPKIT) |
6454 if (m_minimumLayoutSize.width() <= 0) | 6613 if (m_viewLayoutSize.width() <= 0) |
6455 intrinsicContentSizeDidChange(IntSize(-1, -1)); | 6614 intrinsicContentSizeDidChange(IntSize(-1, -1)); |
6456 #endif | 6615 #endif |
6457 } | 6616 } |
6458 | 6617 |
6459 void WebPageProxy::setAutoSizingShouldExpandToViewHeight(bool shouldExpand) | 6618 void WebPageProxy::setAutoSizingShouldExpandToViewHeight(bool shouldExpand) |
6460 { | 6619 { |
6461 if (m_autoSizingShouldExpandToViewHeight == shouldExpand) | 6620 if (m_autoSizingShouldExpandToViewHeight == shouldExpand) |
6462 return; | 6621 return; |
6463 | 6622 |
6464 m_autoSizingShouldExpandToViewHeight = shouldExpand; | 6623 m_autoSizingShouldExpandToViewHeight = shouldExpand; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6669 if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*
this)) | 6828 if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*
this)) |
6670 masterKey = keyData->dataReference().vector(); | 6829 masterKey = keyData->dataReference().vector(); |
6671 } else if (!getDefaultWebCryptoMasterKey(masterKey)) { | 6830 } else if (!getDefaultWebCryptoMasterKey(masterKey)) { |
6672 succeeded = false; | 6831 succeeded = false; |
6673 return; | 6832 return; |
6674 } | 6833 } |
6675 | 6834 |
6676 succeeded = unwrapSerializedCryptoKey(masterKey, wrappedKey, key); | 6835 succeeded = unwrapSerializedCryptoKey(masterKey, wrappedKey, key); |
6677 } | 6836 } |
6678 #endif | 6837 #endif |
| 6838 |
| 6839 void WebPageProxy::signedPublicKeyAndChallengeString(unsigned keySizeIndex, cons
t String& challengeString, const WebCore::URL& url, String& result) |
| 6840 { |
| 6841 PageClientProtector protector(m_pageClient); |
| 6842 |
| 6843 if (m_navigationClient) { |
| 6844 if (auto apiString = m_navigationClient->signedPublicKeyAndChallengeStri
ng(*this, keySizeIndex, API::String::create(challengeString), url)) |
| 6845 result = apiString->string(); |
| 6846 return; |
| 6847 } |
| 6848 result = WebCore::signedPublicKeyAndChallengeString(keySizeIndex, challengeS
tring, url); |
| 6849 } |
6679 | 6850 |
6680 void WebPageProxy::addMIMETypeWithCustomContentProvider(const String& mimeType) | 6851 void WebPageProxy::addMIMETypeWithCustomContentProvider(const String& mimeType) |
6681 { | 6852 { |
6682 m_process->send(Messages::WebPage::AddMIMETypeWithCustomContentProvider(mime
Type), m_pageID); | 6853 m_process->send(Messages::WebPage::AddMIMETypeWithCustomContentProvider(mime
Type), m_pageID); |
6683 } | 6854 } |
6684 | 6855 |
6685 #if PLATFORM(COCOA) | 6856 #if PLATFORM(COCOA) |
6686 | 6857 |
6687 void WebPageProxy::setTextAsync(const String& text) | 6858 void WebPageProxy::setTextAsync(const String& text) |
6688 { | 6859 { |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7078 void WebPageProxy::setShouldDispatchFakeMouseMoveEvents(bool shouldDispatchFakeM
ouseMoveEvents) | 7249 void WebPageProxy::setShouldDispatchFakeMouseMoveEvents(bool shouldDispatchFakeM
ouseMoveEvents) |
7079 { | 7250 { |
7080 m_process->send(Messages::WebPage::SetShouldDispatchFakeMouseMoveEvents(shou
ldDispatchFakeMouseMoveEvents), m_pageID); | 7251 m_process->send(Messages::WebPage::SetShouldDispatchFakeMouseMoveEvents(shou
ldDispatchFakeMouseMoveEvents), m_pageID); |
7081 } | 7252 } |
7082 | 7253 |
7083 void WebPageProxy::handleAutoFillButtonClick(const UserData& userData) | 7254 void WebPageProxy::handleAutoFillButtonClick(const UserData& userData) |
7084 { | 7255 { |
7085 m_uiClient->didClickAutoFillButton(*this, m_process->transformHandlesToObjec
ts(userData.object()).get()); | 7256 m_uiClient->didClickAutoFillButton(*this, m_process->transformHandlesToObjec
ts(userData.object()).get()); |
7086 } | 7257 } |
7087 | 7258 |
| 7259 void WebPageProxy::didResignInputElementStrongPasswordAppearance(const UserData&
userData) |
| 7260 { |
| 7261 m_uiClient->didResignInputElementStrongPasswordAppearance(*this, m_process->
transformHandlesToObjects(userData.object()).get()); |
| 7262 } |
| 7263 |
7088 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS) | 7264 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS) |
7089 void WebPageProxy::addPlaybackTargetPickerClient(uint64_t contextId) | 7265 void WebPageProxy::addPlaybackTargetPickerClient(uint64_t contextId) |
7090 { | 7266 { |
7091 m_pageClient.mediaSessionManager().addPlaybackTargetPickerClient(*this, cont
extId); | 7267 m_pageClient.mediaSessionManager().addPlaybackTargetPickerClient(*this, cont
extId); |
7092 } | 7268 } |
7093 | 7269 |
7094 void WebPageProxy::removePlaybackTargetPickerClient(uint64_t contextId) | 7270 void WebPageProxy::removePlaybackTargetPickerClient(uint64_t contextId) |
7095 { | 7271 { |
7096 m_pageClient.mediaSessionManager().removePlaybackTargetPickerClient(*this, c
ontextId); | 7272 m_pageClient.mediaSessionManager().removePlaybackTargetPickerClient(*this, c
ontextId); |
7097 } | 7273 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7333 | 7509 |
7334 void WebPageProxy::stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskId
entifier) | 7510 void WebPageProxy::stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskId
entifier) |
7335 { | 7511 { |
7336 auto iterator = m_urlSchemeHandlersByIdentifier.find(handlerIdentifier); | 7512 auto iterator = m_urlSchemeHandlersByIdentifier.find(handlerIdentifier); |
7337 MESSAGE_CHECK(iterator != m_urlSchemeHandlersByIdentifier.end()); | 7513 MESSAGE_CHECK(iterator != m_urlSchemeHandlersByIdentifier.end()); |
7338 | 7514 |
7339 iterator->value->stopTask(*this, taskIdentifier); | 7515 iterator->value->stopTask(*this, taskIdentifier); |
7340 } | 7516 } |
7341 | 7517 |
7342 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) | 7518 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) |
7343 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) |
7344 { | 7520 { |
7345 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) { |
7346 m_process->send(Messages::WebPage::StorageAccessResponse(hasAccess, webP
rocessContextId), m_pageID); | 7522 m_process->send(Messages::WebPage::StorageAccessResponse(hasAccess, webP
rocessContextId), m_pageID); |
7347 }); | 7523 }); |
7348 } | 7524 } |
7349 | 7525 |
7350 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) |
7351 { | 7527 { |
7352 ASSERT(pageID == m_pageID); | 7528 CompletionHandler<void(bool)> completionHandler = [this, protectedThis = mak
eRef(*this), webProcessContextId] (bool access) { |
7353 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); |
7354 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 } |
7355 }); | 7550 }); |
7356 } | 7551 } |
7357 #endif | 7552 #endif |
7358 | 7553 |
7359 #if PLATFORM(COCOA) | 7554 #if PLATFORM(COCOA) |
7360 void WebPageProxy::touchBarMenuDataChanged(const TouchBarMenuData& touchBarMenuD
ata) | 7555 void WebPageProxy::touchBarMenuDataChanged(const TouchBarMenuData& touchBarMenuD
ata) |
7361 { | 7556 { |
7362 m_touchBarMenuData = touchBarMenuData; | 7557 m_touchBarMenuData = touchBarMenuData; |
7363 } | 7558 } |
7364 | 7559 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7505 | 7700 |
7506 for (auto& messageItem : messages.get()) { | 7701 for (auto& messageItem : messages.get()) { |
7507 if (condition == messageItem.condition && pageLoadTime < messageItem.sec
onds) { | 7702 if (condition == messageItem.condition && pageLoadTime < messageItem.sec
onds) { |
7508 logDiagnosticMessage(DiagnosticLoggingKeys::telemetryPageLoadKey(),
messageItem.message, ShouldSample::No); | 7703 logDiagnosticMessage(DiagnosticLoggingKeys::telemetryPageLoadKey(),
messageItem.message, ShouldSample::No); |
7509 logDiagnosticMessage(DiagnosticLoggingKeys::telemetryPageLoadKey(),
DiagnosticLoggingKeys::occurredKey(), ShouldSample::No); | 7704 logDiagnosticMessage(DiagnosticLoggingKeys::telemetryPageLoadKey(),
DiagnosticLoggingKeys::occurredKey(), ShouldSample::No); |
7510 break; | 7705 break; |
7511 } | 7706 } |
7512 } | 7707 } |
7513 } | 7708 } |
7514 | 7709 |
| 7710 void WebPageProxy::setDefersLoadingForTesting(bool defersLoading) |
| 7711 { |
| 7712 m_process->send(Messages::WebPage::SetDefersLoading(defersLoading), m_pageID
); |
| 7713 } |
| 7714 |
7515 } // namespace WebKit | 7715 } // namespace WebKit |
LEFT | RIGHT |