⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 240262 in webkit


Ignore:
Timestamp:
Jan 22, 2019, 10:34:34 AM (8 years ago)
Author:
Alan Coon
Message:

Cherry-pick r240015. rdar://problem/47099573

Unreviewed, rolling out r239993, r239995, r239997, and
r239999.

Caused assertions under
ViewGestureController::disconnectFromProcess()

Reverted changesets:

"Regression(PSON) View becomes blank after click a cross-site
download link"
​https://bugs.webkit.org/show_bug.cgi?id=193361
​https://trac.webkit.org/changeset/239993

"Unreviewed iOS build fix after r239993."
​https://trac.webkit.org/changeset/239995

"Fix iOS build after r239993"
​https://bugs.webkit.org/show_bug.cgi?id=193361
​https://trac.webkit.org/changeset/239997

"Unreviewed, revert part of r239997 as it is not needed to fix
the build."
​https://trac.webkit.org/changeset/239999

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@240015 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-607-branch
Files:
2 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/LayoutTests/ChangeLog

    r240258 r240262  
     12019-01-22  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r240015. rdar://problem/47099573
     4
     5    Unreviewed, rolling out r239993, r239995, r239997, and
     6    r239999.
     7   
     8    Caused assertions under
     9    ViewGestureController::disconnectFromProcess()
     10   
     11    Reverted changesets:
     12   
     13    "Regression(PSON) View becomes blank after click a cross-site
     14    download link"
     15    https://bugs.webkit.org/show_bug.cgi?id=193361
     16    https://trac.webkit.org/changeset/239993
     17   
     18    "Unreviewed iOS build fix after r239993."
     19    https://trac.webkit.org/changeset/239995
     20   
     21    "Fix iOS build after r239993"
     22    https://bugs.webkit.org/show_bug.cgi?id=193361
     23    https://trac.webkit.org/changeset/239997
     24   
     25    "Unreviewed, revert part of r239997 as it is not needed to fix
     26    the build."
     27    https://trac.webkit.org/changeset/239999
     28   
     29    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     30
     31    2019-01-15  Chris Dumez  <cdumez@apple.com>
     32
     33            Unreviewed, rolling out r239993, r239995, r239997, and
     34            r239999.
     35
     36            Caused assertions under
     37            ViewGestureController::disconnectFromProcess()
     38
     39            Reverted changesets:
     40
     41            "Regression(PSON) View becomes blank after click a cross-site
     42            download link"
     43            https://bugs.webkit.org/show_bug.cgi?id=193361
     44            https://trac.webkit.org/changeset/239993
     45
     46            "Unreviewed iOS build fix after r239993."
     47            https://trac.webkit.org/changeset/239995
     48
     49            "Fix iOS build after r239993"
     50            https://bugs.webkit.org/show_bug.cgi?id=193361
     51            https://trac.webkit.org/changeset/239997
     52
     53            "Unreviewed, revert part of r239997 as it is not needed to fix
     54            the build."
     55            https://trac.webkit.org/changeset/239999
     56
    1572019-01-22  Alan Coon  <alancoon@apple.com>
    258
  • branches/safari-607-branch/LayoutTests/platform/wk2/TestExpectations

    r240258 r240262  
    734734http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource.html [ Skip ]
    735735
    736 # This feature is currently disabled by default and unfinished <rdar://problem/38925077>.
    737 http/tests/navigation/process-swap-window-open.html [ Skip ]
     736# Process swapping is only implemented on WebKit2.
     737http/tests/navigation/process-swap-window-open.html [ Pass ]
    738738
    739739# Cross-Origin-Resource-Policy response header is only implemented in WebKit2.
  • branches/safari-607-branch/Source/WebCore/ChangeLog

    r240258 r240262  
     12019-01-22  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r240015. rdar://problem/47099573
     4
     5    Unreviewed, rolling out r239993, r239995, r239997, and
     6    r239999.
     7   
     8    Caused assertions under
     9    ViewGestureController::disconnectFromProcess()
     10   
     11    Reverted changesets:
     12   
     13    "Regression(PSON) View becomes blank after click a cross-site
     14    download link"
     15    https://bugs.webkit.org/show_bug.cgi?id=193361
     16    https://trac.webkit.org/changeset/239993
     17   
     18    "Unreviewed iOS build fix after r239993."
     19    https://trac.webkit.org/changeset/239995
     20   
     21    "Fix iOS build after r239993"
     22    https://bugs.webkit.org/show_bug.cgi?id=193361
     23    https://trac.webkit.org/changeset/239997
     24   
     25    "Unreviewed, revert part of r239997 as it is not needed to fix
     26    the build."
     27    https://trac.webkit.org/changeset/239999
     28   
     29    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     30
     31    2019-01-15  Chris Dumez  <cdumez@apple.com>
     32
     33            Unreviewed, rolling out r239993, r239995, r239997, and
     34            r239999.
     35
     36            Caused assertions under
     37            ViewGestureController::disconnectFromProcess()
     38
     39            Reverted changesets:
     40
     41            "Regression(PSON) View becomes blank after click a cross-site
     42            download link"
     43            https://bugs.webkit.org/show_bug.cgi?id=193361
     44            https://trac.webkit.org/changeset/239993
     45
     46            "Unreviewed iOS build fix after r239993."
     47            https://trac.webkit.org/changeset/239995
     48
     49            "Fix iOS build after r239993"
     50            https://bugs.webkit.org/show_bug.cgi?id=193361
     51            https://trac.webkit.org/changeset/239997
     52
     53            "Unreviewed, revert part of r239997 as it is not needed to fix
     54            the build."
     55            https://trac.webkit.org/changeset/239999
     56
    1572019-01-22  Alan Coon  <alancoon@apple.com>
    258
  • branches/safari-607-branch/Source/WebCore/loader/FrameLoader.cpp

    r240258 r240262  
    20332033        Optional<HasInsecureContent> hasInsecureContent = cachedPage->cachedMainFrame()->hasInsecureContent();
    20342034
    2035         dispatchDidCommitLoad(hasInsecureContent);
    2036 
    20372035        // FIXME: This API should be turned around so that we ground CachedPage into the Page.
    20382036        cachedPage->restore(*m_frame.page());
     2037
     2038        dispatchDidCommitLoad(hasInsecureContent);
    20392039
    20402040#if PLATFORM(IOS_FAMILY)
  • branches/safari-607-branch/Source/WebKit/ChangeLog

    r240260 r240262  
     12019-01-22  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r240015. rdar://problem/47099573
     4
     5    Unreviewed, rolling out r239993, r239995, r239997, and
     6    r239999.
     7   
     8    Caused assertions under
     9    ViewGestureController::disconnectFromProcess()
     10   
     11    Reverted changesets:
     12   
     13    "Regression(PSON) View becomes blank after click a cross-site
     14    download link"
     15    https://bugs.webkit.org/show_bug.cgi?id=193361
     16    https://trac.webkit.org/changeset/239993
     17   
     18    "Unreviewed iOS build fix after r239993."
     19    https://trac.webkit.org/changeset/239995
     20   
     21    "Fix iOS build after r239993"
     22    https://bugs.webkit.org/show_bug.cgi?id=193361
     23    https://trac.webkit.org/changeset/239997
     24   
     25    "Unreviewed, revert part of r239997 as it is not needed to fix
     26    the build."
     27    https://trac.webkit.org/changeset/239999
     28   
     29    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     30
     31    2019-01-15  Chris Dumez  <cdumez@apple.com>
     32
     33            Unreviewed, rolling out r239993, r239995, r239997, and
     34            r239999.
     35
     36            Caused assertions under
     37            ViewGestureController::disconnectFromProcess()
     38
     39            Reverted changesets:
     40
     41            "Regression(PSON) View becomes blank after click a cross-site
     42            download link"
     43            https://bugs.webkit.org/show_bug.cgi?id=193361
     44            https://trac.webkit.org/changeset/239993
     45
     46            "Unreviewed iOS build fix after r239993."
     47            https://trac.webkit.org/changeset/239995
     48
     49            "Fix iOS build after r239993"
     50            https://bugs.webkit.org/show_bug.cgi?id=193361
     51            https://trac.webkit.org/changeset/239997
     52
     53            "Unreviewed, revert part of r239997 as it is not needed to fix
     54            the build."
     55            https://trac.webkit.org/changeset/239999
     56
    1572019-01-22  Alan Coon  <alancoon@apple.com>
    258
  • branches/safari-607-branch/Source/WebKit/Shared/WebPageCreationParameters.cpp

    r240258 r240262  
    7474    encoder << mimeTypesWithCustomContentProviders;
    7575    encoder << controlledByAutomation;
    76     encoder << isProcessSwap;
     76    encoder << isSwapFromSuspended;
    7777
    7878#if PLATFORM(MAC)
    … …  
    228228    if (!decoder.decode(parameters.controlledByAutomation))
    229229        return WTF::nullopt;
    230     if (!decoder.decode(parameters.isProcessSwap))
     230    if (!decoder.decode(parameters.isSwapFromSuspended))
    231231        return WTF::nullopt;
    232232
  • branches/safari-607-branch/Source/WebKit/Shared/WebPageCreationParameters.h

    r240258 r240262  
    130130
    131131    bool controlledByAutomation;
    132     bool isProcessSwap { false };
     132    bool isSwapFromSuspended { false };
    133133
    134134#if PLATFORM(MAC)
  • branches/safari-607-branch/Source/WebKit/Shared/WebPolicyAction.h

    r240258 r240262  
    3030namespace WebKit {
    3131
    32 // FIXME: Remove this type and use WebCore::PolicyAction instead.
    3332enum class WebPolicyAction : uint8_t {
    3433    Use,
    3534    Download,
    36     Ignore
     35    Ignore,
     36    Suspend
    3737};
    3838
    … …  
    4646        WebKit::WebPolicyAction::Use,
    4747        WebKit::WebPolicyAction::Download,
    48         WebKit::WebPolicyAction::Ignore
     48        WebKit::WebPolicyAction::Ignore,
     49        WebKit::WebPolicyAction::Suspend
    4950    >;
    5051};
  • branches/safari-607-branch/Source/WebKit/Sources.txt

    r240258 r240262  
    229229UIProcess/ProcessAssertion.cpp
    230230UIProcess/ProcessThrottler.cpp
    231 UIProcess/ProvisionalPageProxy.cpp
    232231UIProcess/RemoteWebInspectorProxy.cpp
    233232UIProcess/ResourceLoadStatisticsMemoryStore.cpp
  • branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r240258 r240262  
    4545#import "ObjCObjectGraph.h"
    4646#import "PageClient.h"
    47 #import "ProvisionalPageProxy.h"
    4847#import "RemoteLayerTreeScrollingPerformanceData.h"
    4948#import "RemoteLayerTreeTransaction.h"
    … …  
    46844683    Ref<WebKit::WebProcessProxy> protectedProcessProxy(_page->process());
    46854684    protectedProcessProxy->requestTermination(WebKit::ProcessTerminationReason::RequestedByClient);
    4686 
    4687     if (auto* provisionalPageProxy = _page->provisionalPageProxy()) {
    4688         Ref<WebKit::WebProcessProxy> protectedProcessProxy(provisionalPageProxy->process());
    4689         protectedProcessProxy->requestTermination(WebKit::ProcessTerminationReason::RequestedByClient);
    4690     }
    46914685}
    46924686
  • branches/safari-607-branch/Source/WebKit/UIProcess/PageClient.h

    r240258 r240262  
    4949OBJC_CLASS CALayer;
    5050OBJC_CLASS NSFileWrapper;
    51 OBJC_CLASS NSMenu;
    5251OBJC_CLASS NSSet;
    5352OBJC_CLASS WKDrawingView;
  • branches/safari-607-branch/Source/WebKit/UIProcess/SuspendedPageProxy.cpp

    r240258 r240262  
    101101    // on the WebProcess side.
    102102    m_process->send(Messages::WebPage::Close(), m_page.pageID());
    103 
    104     if (m_suspensionState == SuspensionState::Suspending)
    105         m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_page.pageID());
     103    m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_page.pageID());
    106104
    107105    // We call maybeShutDown() asynchronously since the SuspendedPage is currently being removed from the WebProcessPool
    … …  
    137135
    138136    m_suspensionState = SuspensionState::Resumed;
     137    m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_page.pageID());
    139138    m_process->send(Messages::WebPage::SetIsSuspended(false), m_page.pageID());
    140139}
    … …  
    152151    m_suspensionToken = nullptr;
    153152#endif
    154 
    155     m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_page.pageID());
    156153
    157154    if (m_readyToUnsuspendHandler)
  • branches/safari-607-branch/Source/WebKit/UIProcess/WebFrameProxy.cpp

    r240258 r240262  
    2828
    2929#include "APINavigation.h"
    30 #include "ProvisionalPageProxy.h"
    3130#include "WebCertificateInfo.h"
    3231#include "WebFramePolicyListenerProxy.h"
    … …  
    7675        return false;
    7776
    78     return this == m_page->mainFrame() || (m_page->provisionalPageProxy() && this == m_page->provisionalPageProxy()->mainFrame());
     77    return this == m_page->mainFrame();
    7978}
    8079
  • branches/safari-607-branch/Source/WebKit/UIProcess/WebPageProxy.cpp

    r240258 r240262  
    7878#include "PluginProcessManager.h"
    7979#include "PrintInfo.h"
    80 #include "ProvisionalPageProxy.h"
    8180#include "SafeBrowsingWarning.h"
    8281#include "ShareSheetCallbackID.h"
    … …  
    551550}
    552551
    553 DrawingAreaProxy* WebPageProxy::drawingArea() const
    554 {
    555     if (m_provisionalPage && m_process.ptr() == &m_provisionalPage->process() && m_provisionalPage->drawingArea())
    556         return m_provisionalPage->drawingArea();
    557     return m_drawingArea.get();
    558 }
    559 
    560552void WebPageProxy::changeWebsiteDataStore(WebsiteDataStore& websiteDataStore)
    561553{
    … …  
    781773}
    782774
    783 void WebPageProxy::swapToWebProcess(Ref<WebProcessProxy>&& process, std::unique_ptr<DrawingAreaProxy>&& drawingArea, RefPtr<WebFrameProxy>&& mainFrame)
     775void WebPageProxy::swapToWebProcess(Ref<WebProcessProxy>&& process, std::unique_ptr<SuspendedPageProxy>&& destinationSuspendedPage, IsSwapFromSuspended isSwapFromSuspended)
    784776{
    785777    ASSERT(!m_isClosed);
    … …  
    787779
    788780    m_process = WTFMove(process);
    789     ASSERT(!m_drawingArea);
    790     setDrawingArea(WTFMove(drawingArea));
    791     ASSERT(!m_mainFrame);
    792     m_mainFrame = WTFMove(mainFrame);
    793781    m_isValid = true;
     782
     783    // If we are reattaching to a SuspendedPage, then the WebProcess' WebPage already exists and
     784    // WebPageProxy::didCreateMainFrame() will not be called to initialize m_mainFrame. In such
     785    // case, we need to initialize m_mainFrame to reflect the fact the the WebProcess' WebPage
     786    // already exists and already has a main frame.
     787    if (destinationSuspendedPage) {
     788        if (!destinationSuspendedPage->failedToSuspend()) {
     789            ASSERT(!m_mainFrame);
     790            ASSERT(&destinationSuspendedPage->process() == m_process.ptr());
     791            destinationSuspendedPage->unsuspend();
     792            m_mainFrame = WebFrameProxy::create(*this, destinationSuspendedPage->mainFrameID());
     793            m_process->frameCreated(destinationSuspendedPage->mainFrameID(), *m_mainFrame);
     794        } else {
     795            // We failed to suspend the page so destroy it now and merely reuse its WebContent process.
     796            destinationSuspendedPage = nullptr;
     797        }
     798    }
    794799
    795800    m_process->addExistingWebPage(*this, m_pageID, WebProcessProxy::BeginsUsingDataStore::No);
    796801    m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, *this);
    797802
    798     // No need to initialize the WebPage since it was created when we created the ProvisionalPageProxy.
    799     finishAttachingToWebProcess(ShouldInitializeWebPage::No);
    800 }
    801 
    802 void WebPageProxy::finishAttachingToWebProcess(ShouldInitializeWebPage shouldInitializePage)
     803    finishAttachingToWebProcess(isSwapFromSuspended);
     804}
     805
     806void WebPageProxy::finishAttachingToWebProcess(IsSwapFromSuspended isSwapFromSuspended)
    803807{
    804808    ASSERT(m_process->state() != ChildProcessProxy::State::Terminated);
    … …  
    836840#endif
    837841
    838     if (shouldInitializePage == ShouldInitializeWebPage::Yes)
    839         initializeWebPage();
     842    initializeWebPage(isSwapFromSuspended);
    840843
    841844    m_inspector->updateForNewPageProcess(this);
    … …  
    902905}
    903906
    904 void WebPageProxy::setDrawingArea(std::unique_ptr<DrawingAreaProxy>&& drawingArea)
    905 {
    906     m_drawingArea = WTFMove(drawingArea);
    907     if (!m_drawingArea)
    908         return;
     907void WebPageProxy::initializeWebPage(IsSwapFromSuspended isSwapFromSuspended)
     908{
     909    ASSERT(isValid());
     910
     911    m_drawingArea = pageClient().createDrawingAreaProxy();
     912    ASSERT(m_drawingArea);
    909913
    910914#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
    … …  
    917921    }
    918922#endif
    919 }
    920 
    921 void WebPageProxy::initializeWebPage()
    922 {
    923     ASSERT(isValid());
    924 
    925     setDrawingArea(pageClient().createDrawingAreaProxy());
    926     ASSERT(m_drawingArea);
    927 
    928     process().send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters()), 0);
     923
     924    auto parameters = creationParameters();
     925    parameters.isSwapFromSuspended = isSwapFromSuspended == IsSwapFromSuspended::Yes;
     926
     927#if ENABLE(SERVICE_WORKER)
     928    parameters.hasRegisteredServiceWorkers = process().processPool().mayHaveRegisteredServiceWorkers(m_websiteDataStore);
     929#endif
     930
     931    process().send(Messages::WebProcess::CreateWebPage(m_pageID, parameters), 0);
    929932
    930933    m_needsToFinishInitializingWebPageAfterProcessLaunch = true;
    … …  
    10781081
    10791082    auto url = request.url();
    1080     if (shouldTreatAsContinuingLoad != ShouldTreatAsContinuingLoad::Yes)
    1081         m_pageLoadState.setPendingAPIRequestURL(transaction, url);
     1083    m_pageLoadState.setPendingAPIRequestURL(transaction, url);
    10821084
    10831085    if (!isValid())
    … …  
    12971299
    12981300    m_process->send(Messages::WebPage::StopLoading(), m_pageID);
    1299     if (m_provisionalPage) {
    1300         m_provisionalPage->cancel();
    1301         m_provisionalPage = nullptr;
    1302     }
    13031301    m_process->responsivenessTimer().start();
    13041302}
    … …  
    26992697
    27002698        if (processForNavigation.ptr() != &process()) {
    2701             policyAction = WebPolicyAction::Ignore;
     2699            policyAction = isPageOpenedByDOMShowingInitialEmptyDocument() ? WebPolicyAction::Ignore : WebPolicyAction::Suspend;
    27022700            RELEASE_LOG_IF_ALLOWED(ProcessSwapping, "decidePolicyForNavigationAction, swapping process %i with process %i for navigation, reason: %{public}s", processIdentifier(), processForNavigation->processIdentifier(), reason.utf8().data());
    27032701            LOG(ProcessSwapping, "(ProcessSwapping) Switching from process %i to new process (%i) for navigation %" PRIu64 " '%s'", processIdentifier(), processForNavigation->processIdentifier(), navigation->navigationID(), navigation->loggingString());
    … …  
    27082706        receivedPolicyDecision(policyAction, navigation.ptr(), shouldProcessSwap ? WTF::nullopt : WTFMove(data), WTFMove(sender));
    27092707
    2710         if (!shouldProcessSwap)
    2711             return;
    2712 
    2713         auto suspendedPage = destinationSuspendedPage ? process().processPool().takeSuspendedPage(*destinationSuspendedPage) : nullptr;
    2714         if (suspendedPage && suspendedPage->failedToSuspend())
    2715             suspendedPage = nullptr;
    2716 
    2717         continueNavigationInNewProcess(navigation, WTFMove(suspendedPage), WTFMove(processForNavigation), processSwapRequestedByClient, WTFMove(data));
     2708        if (shouldProcessSwap)
     2709            continueNavigationInNewProcess(navigation, destinationSuspendedPage ? process().processPool().takeSuspendedPage(*destinationSuspendedPage) : nullptr, WTFMove(processForNavigation), processSwapRequestedByClient, WTFMove(data));
    27182710    });
    27192711}
    … …  
    27512743}
    27522744
    2753 void WebPageProxy::commitProvisionalPage(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData& userData)
    2754 {
    2755     ASSERT(m_provisionalPage);
    2756     RELEASE_LOG_IF_ALLOWED(Loading, "commitProvisionalPage: previousPID = %i, newPID = %i, pageID = %" PRIu64, m_process->processIdentifier(), m_provisionalPage->process().processIdentifier(), m_pageID);
    2757 
    2758     Optional<uint64_t> mainFrameIDInPreviousProcess = m_mainFrame ? makeOptional(m_mainFrame->frameID()) : WTF::nullopt;
    2759 
    2760     ASSERT(m_process.ptr() != &m_provisionalPage->process());
    2761 
    2762     processDidTerminate(ProcessTerminationReason::NavigationSwap);
    2763 
    2764     m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
    2765     auto* navigation = navigationState().navigation(m_provisionalPage->navigationID());
    2766     bool didSuspendPreviousPage = navigation ? suspendCurrentPageIfPossible(*navigation, mainFrameIDInPreviousProcess, m_provisionalPage->processSwapRequestedByClient()) : false;
    2767     m_process->removeWebPage(*this, m_pageID, WebProcessProxy::EndsUsingDataStore::No);
    2768 
    2769     // There is no way we'll be able to return to the page in the previous page so close it.
    2770     if (!didSuspendPreviousPage)
    2771         m_process->send(Messages::WebPage::Close(), pageID());
    2772 
    2773     swapToWebProcess(m_provisionalPage->process(), m_provisionalPage->takeDrawingArea(), m_provisionalPage->mainFrame());
    2774 
    2775     didCommitLoadForFrame(frameID, navigationID, mimeType, frameHasCustomContentProvider, frameLoadType, certificateInfo, containsPluginDocument, forcedHasInsecureContent, userData);
    2776 
    2777     m_provisionalPage = nullptr;
    2778 }
    2779 
    2780 void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, std::unique_ptr<SuspendedPageProxy>&& suspendedPageProxy, Ref<WebProcessProxy>&& newProcess, ProcessSwapRequestedByClient processSwapRequestedByClient, Optional<WebsitePoliciesData>&& websitePolicies)
     2745void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, std::unique_ptr<SuspendedPageProxy>&& suspendedPageProxy, Ref<WebProcessProxy>&& process, ProcessSwapRequestedByClient processSwapRequestedByClient, Optional<WebsitePoliciesData>&& websitePolicies)
    27812746{
    27822747    RELEASE_LOG_IF_ALLOWED(Loading, "continueNavigationInNewProcess: webPID = %i, pageID = %" PRIu64, m_process->processIdentifier(), m_pageID);
    27832748    LOG(Loading, "Continuing navigation %" PRIu64 " '%s' in a new web process", navigation.navigationID(), navigation.loggingString());
    27842749
    2785     if (m_provisionalPage) {
    2786         if (m_provisionalPage->navigationID() != navigation.navigationID())
    2787             m_provisionalPage->cancel();
    2788         m_provisionalPage = nullptr;
    2789     }
    2790 
    2791     m_provisionalPage = std::make_unique<ProvisionalPageProxy>(*this, newProcess.copyRef(), WTFMove(suspendedPageProxy), navigation.navigationID(), navigation.currentRequestIsRedirect(), navigation.currentRequest(), processSwapRequestedByClient);
     2750    Ref<WebProcessProxy> previousProcess = m_process.copyRef();
     2751    Optional<uint64_t> mainFrameIDInPreviousProcess = m_mainFrame ? makeOptional(m_mainFrame->frameID()) : WTF::nullopt;
     2752    auto mainFrameURL = m_mainFrame ? m_mainFrame->url() : URL();
     2753
     2754    ASSERT(m_process.ptr() != process.ptr());
     2755
     2756    processDidTerminate(ProcessTerminationReason::NavigationSwap);
     2757
     2758    m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
     2759    bool didSuspendPreviousPage = suspendCurrentPageIfPossible(navigation, mainFrameIDInPreviousProcess, processSwapRequestedByClient);
     2760    m_process->removeWebPage(*this, m_pageID, WebProcessProxy::EndsUsingDataStore::No);
     2761
     2762    swapToWebProcess(WTFMove(process), WTFMove(suspendedPageProxy), didSuspendPreviousPage ? IsSwapFromSuspended::Yes : IsSwapFromSuspended::No);
    27922763
    27932764    if (auto* item = navigation.targetItem()) {
    … …  
    27972768        m_pageLoadState.setPendingAPIRequestURL(transaction, item->url());
    27982769
    2799         m_provisionalPage->goToBackForwardItem(navigation, *item, WTFMove(websitePolicies));
     2770        auto itemStates = m_backForwardList->filteredItemStates([this, targetItem = item](WebBackForwardListItem& item) {
     2771            if (auto* page = item.suspendedPage()) {
     2772                if (&page->process() == m_process.ptr())
     2773                    return false;
     2774            }
     2775            return &item != targetItem;
     2776        });
     2777        m_process->send(Messages::WebPage::UpdateBackForwardListForReattach(WTFMove(itemStates)), m_pageID);
     2778        m_process->send(Messages::WebPage::GoToBackForwardItem(navigation.navigationID(), item->itemID(), *navigation.backForwardFrameLoadType(), ShouldTreatAsContinuingLoad::Yes, WTFMove(websitePolicies)), m_pageID);
     2779        m_process->responsivenessTimer().start();
     2780
    28002781        return;
    28012782    }
    … …  
    28042785        // If WebCore is supposed to lock the history for this load, then the new process needs to know about the current history item so it can update
    28052786        // it instead of creating a new one.
    2806         newProcess->send(Messages::WebPage::SetCurrentHistoryItemForReattach(m_backForwardList->currentItem()->itemState()), m_pageID);
     2787        m_process->send(Messages::WebPage::SetCurrentHistoryItemForReattach(m_backForwardList->currentItem()->itemState()), m_pageID);
    28072788    }
    28082789
    … …  
    28102791    ASSERT(!navigation.currentRequest().isEmpty());
    28112792    if (auto& substituteData = navigation.substituteData())
    2812         m_provisionalPage->loadDataWithNavigation(navigation, { substituteData->content.data(), substituteData->content.size() }, substituteData->MIMEType, substituteData->encoding, substituteData->baseURL, substituteData->userData.get(), WTFMove(websitePolicies));
     2793        loadDataWithNavigation(navigation, { substituteData->content.data(), substituteData->content.size() }, substituteData->MIMEType, substituteData->encoding, substituteData->baseURL, substituteData->userData.get(), ShouldTreatAsContinuingLoad::Yes, WTFMove(websitePolicies));
    28132794    else
    2814         m_provisionalPage->loadRequestWithNavigation(navigation, ResourceRequest { navigation.currentRequest() }, WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, nullptr, WTFMove(websitePolicies));
     2795        loadRequestWithNavigation(navigation, ResourceRequest { navigation.currentRequest() }, WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, nullptr, ShouldTreatAsContinuingLoad::Yes, WTFMove(websitePolicies));
     2796
     2797    ASSERT(!m_mainFrame);
     2798    m_mainFrameCreationHandler = [this, weakThis = makeWeakPtr(*this), navigationID = navigation.navigationID(), request =  navigation.currentRequest(), mainFrameURL, isServerRedirect = navigation.currentRequestIsRedirect()]() mutable {
     2799        if (!weakThis)
     2800            return;
     2801
     2802        ASSERT(m_mainFrame);
     2803        // This navigation was destroyed so no need to notify of redirect.
     2804        if (!navigationState().navigation(navigationID))
     2805            return;
     2806
     2807        // Restore the main frame's committed URL as some clients may rely on it until the next load is committed.
     2808        m_mainFrame->frameLoadState().setURL(mainFrameURL);
     2809
     2810        // Normally, notification of a server redirect comes from the WebContent process.
     2811        // If we are process swapping in response to a server redirect then that notification will not come from the new WebContent process.
     2812        // In this case we have the UIProcess synthesize the redirect notification at the appropriate time.
     2813        if (isServerRedirect) {
     2814            m_mainFrame->frameLoadState().didStartProvisionalLoad(request.url());
     2815            didReceiveServerRedirectForProvisionalLoadForFrame(m_mainFrame->frameID(), navigationID, WTFMove(request), { });
     2816        }
     2817    };
     2818
     2819    if (!m_process->processPool().configuration().processSwapsOnWindowOpenWithOpener() || !isPageOpenedByDOMShowingInitialEmptyDocument() || !mainFrameIDInPreviousProcess) {
     2820        // There is no way we'll be able to return to the page in the previous page so close it.
     2821        if (!didSuspendPreviousPage)
     2822            previousProcess->send(Messages::WebPage::Close(), m_pageID);
     2823        return;
     2824    }
     2825
     2826    m_mainFrameWindowCreationHandler = [this, previousProcess = WTFMove(previousProcess), mainFrameIDInPreviousProcess = *mainFrameIDInPreviousProcess](const GlobalWindowIdentifier& windowIdentifier) {
     2827        ASSERT(m_mainFrame);
     2828        GlobalFrameIdentifier navigatedFrameIdentifierInNewProcess { pageID(), m_mainFrame->frameID() };
     2829        previousProcess->send(Messages::WebPage::FrameBecameRemote(mainFrameIDInPreviousProcess, navigatedFrameIdentifierInNewProcess, windowIdentifier), pageID());
     2830    };
    28152831}
    28162832
    … …  
    36773693    // Add the frame to the process wide map.
    36783694    m_process->frameCreated(frameID, *m_mainFrame);
     3695
     3696    if (m_mainFrameCreationHandler) {
     3697        m_mainFrameCreationHandler();
     3698        m_mainFrameCreationHandler = nullptr;
     3699    }
    36793700}
    36803701
    … …  
    37013722void WebPageProxy::didCreateWindow(uint64_t frameID, GlobalWindowIdentifier&& windowIdentifier)
    37023723{
     3724    if (m_mainFrame && m_mainFrame->frameID() == frameID) {
     3725        if (auto mainFrameWindowCreationHandler = WTFMove(m_mainFrameWindowCreationHandler))
     3726            mainFrameWindowCreationHandler(windowIdentifier);
     3727    }
    37033728}
    37043729
    … …  
    37523777{
    37533778    PageClientProtector protector(pageClient());
    3754 
    3755     // On process-swap, the previous process tries to destroy the navigation but the provisional process is actually taking over the navigation.
    3756     if (m_provisionalPage && m_provisionalPage->navigationID() == navigationID)
    3757         return;
    37583779
    37593780    // FIXME: Message check the navigationID.
    … …  
    37733794    if (frame->isMainFrame() && navigationID)
    37743795        navigation = navigationState().navigation(navigationID);
     3796
     3797    // If this seemingly new load is actually continuing a server redirect for a previous navigation in a new process,
     3798    // then we ignore this notification.
     3799    if (navigation && navigation->currentRequestIsRedirect()) {
     3800        auto navigationProcessIdentifier = navigation->currentRequestProcessIdentifier();
     3801        if (navigationProcessIdentifier && *navigationProcessIdentifier != m_process->coreProcessIdentifier())
     3802            return;
     3803    }
    37753804
    37763805    LOG(Loading, "WebPageProxy %" PRIu64 " in process pid %i didStartProvisionalLoadForFrame to frameID %" PRIu64 ", navigationID %" PRIu64 ", url %s", m_pageID, m_process->processIdentifier(), frameID, navigationID, url.string().utf8().data());
    … …  
    38803909
    38813910    PageClientProtector protector(pageClient());
    3882 
    3883     if (m_provisionalPage && m_provisionalPage->navigationID() == navigationID && &m_provisionalPage->process() != m_process.ptr()) {
    3884         // The load did not fail, it is merely happening in a new provisional process.
    3885         return;
    3886     }
    38873911
    38883912    WebFrameProxy* frame = m_process->webFrame(frameID);
    … …  
    39243948
    39253949    m_failingProvisionalLoadURL = { };
    3926 
    3927     // If the provisional page's load fails then we destroy the provisional page.
    3928     if (m_provisionalPage && m_provisionalPage->mainFrame() == frame)
    3929         m_provisionalPage = nullptr;
    39303950}
    39313951
    … …  
    43194339    MESSAGE_CHECK(frame);
    43204340
    4321     decidePolicyForNavigationAction(*frame, WTFMove(frameSecurityOrigin), navigationID, WTFMove(navigationActionData), WTFMove(frameInfoData), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(redirectResponse), userData, PolicyDecisionSender::create([this, protectedThis = makeRef(*this), frameID, listenerID, process = m_process.copyRef()] (auto... args) {
    4322         process->send(Messages::WebPage::DidReceivePolicyDecision(frameID, listenerID, args...), m_pageID);
     4341    decidePolicyForNavigationAction(*frame, WTFMove(frameSecurityOrigin), navigationID, WTFMove(navigationActionData), WTFMove(frameInfoData), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(redirectResponse), userData, PolicyDecisionSender::create([this, protectedThis = makeRef(*this), frameID, listenerID] (auto... args) {
     4342        m_process->send(Messages::WebPage::DidReceivePolicyDecision(frameID, listenerID, args...), m_pageID);
    43234343    }));
    43244344}
    … …  
    45194539
    45204540    RefPtr<API::Navigation> navigation = navigationID ? m_navigationState->navigation(navigationID) : nullptr;
    4521     auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frameID, listenerID, navigation = WTFMove(navigation), process = m_process.copyRef()] (WebPolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable {
     4541    auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frameID, listenerID, navigation = WTFMove(navigation)] (WebPolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable {
    45224542        // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away.
    45234543        RELEASE_ASSERT(processSwapRequestedByClient == ProcessSwapRequestedByClient::No);
    45244544        ASSERT_UNUSED(safeBrowsingWarning, !safeBrowsingWarning);
    4525         receivedPolicyDecision(policyAction, navigation.get(), WTF::nullopt, PolicyDecisionSender::create([this, protectedThis = WTFMove(protectedThis), frameID, listenerID, process = WTFMove(process)] (auto... args) {
    4526             process->send(Messages::WebPage::DidReceivePolicyDecision(frameID, listenerID, args...), m_pageID);
     4545        receivedPolicyDecision(policyAction, navigation.get(), WTF::nullopt, PolicyDecisionSender::create([this, protectedThis = WTFMove(protectedThis), frameID, listenerID] (auto... args) {
     4546            m_process->send(Messages::WebPage::DidReceivePolicyDecision(frameID, listenerID, args...), m_pageID);
    45274547        }));
    45284548    }, ShouldExpectSafeBrowsingResult::No));
    … …  
    63446364}
    63456365
    6346 void WebPageProxy::provisionalProcessDidTerminate()
    6347 {
    6348     ASSERT(m_provisionalPage);
    6349     m_provisionalPage->cancel();
    6350     m_provisionalPage = nullptr;
    6351 }
    6352 
    63536366static bool shouldReloadAfterProcessTermination(ProcessTerminationReason reason)
    63546367{
    … …  
    64386451{
    64396452    m_mainFrame = nullptr;
     6453    m_mainFrameCreationHandler = nullptr;
     6454    m_mainFrameWindowCreationHandler = nullptr;
    64406455
    64416456#if PLATFORM(COCOA)
    … …  
    67286743#endif
    67296744
    6730 #if ENABLE(SERVICE_WORKER)
    6731     parameters.hasRegisteredServiceWorkers = process().processPool().mayHaveRegisteredServiceWorkers(m_websiteDataStore);
    6732 #endif
    6733 
    67346745    parameters.needsFontAttributes = m_needsFontAttributes;
    67356746
    … …  
    84938504}
    84948505
    8495 WebPageProxy::PageProcessOverride::PageProcessOverride(WebPageProxy& page, WebProcessProxy& newProcess)
    8496     : m_page(&page)
    8497     , m_previousProcess(page.process())
    8498 {
    8499     page.m_process = newProcess;
    8500 }
    8501 
    8502 WebPageProxy::PageProcessOverride::PageProcessOverride(PageProcessOverride&&) = default;
    8503 
    8504 WebPageProxy::PageProcessOverride::~PageProcessOverride()
    8505 {
    8506     if (m_page)
    8507         m_page->m_process = WTFMove(m_previousProcess);
    8508 }
    8509 
    85108506#if ENABLE(DATA_DETECTION)
    85118507
  • branches/safari-607-branch/Source/WebKit/UIProcess/WebPageProxy.h

    r240258 r240262  
    226226class NativeWebWheelEvent;
    227227class PageClient;
    228 class ProvisionalPageProxy;
    229228class RemoteLayerTreeHost;
    230229class RemoteLayerTreeScrollingPerformanceData;
    … …  
    358357    WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
    359358
    360     DrawingAreaProxy* drawingArea() const;
     359    DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
    361360
    362361    WebNavigationState& navigationState() { return *m_navigationState.get(); }
    … …  
    381380    bool addsVisitedLinks() const { return m_addsVisitedLinks; }
    382381    void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
    383     VisitedLinkStore& visitedLinkStore() { return m_visitedLinkStore; }
    384382
    385383    void exitFullscreenImmediately();
    … …  
    461459    void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&&);
    462460
    463     void initializeWebPage();
    464     void setDrawingArea(std::unique_ptr<DrawingAreaProxy>&&);
     461    enum class IsSwapFromSuspended { No, Yes };
     462    void initializeWebPage(IsSwapFromSuspended = IsSwapFromSuspended::No);
    465463
    466464    WeakPtr<SecKeyProxyStore> secKeyProxyStore(const WebCore::AuthenticationChallenge&);
    … …  
    1000998    void processDidBecomeResponsive();
    1001999    void processDidTerminate(ProcessTerminationReason);
    1002     void provisionalProcessDidTerminate();
    10031000    void dispatchProcessDidTerminate(ProcessTerminationReason);
    10041001    void willChangeProcessIsResponsive();
    … …  
    10281025    WebProcessProxy& process() { return m_process; }
    10291026    ProcessID processIdentifier() const;
    1030 
    1031     class PageProcessOverride {
    1032     public:
    1033         PageProcessOverride(WebPageProxy&, WebProcessProxy& newProcess);
    1034         PageProcessOverride(PageProcessOverride&&);
    1035         ~PageProcessOverride();
    1036 
    1037     private:
    1038         RefPtr<WebPageProxy> m_page;
    1039         Ref<WebProcessProxy> m_previousProcess;
    1040     };
    1041 
    1042     PageProcessOverride temporarilyOverrideProcess(WebProcessProxy& newProcess) { return PageProcessOverride(*this, newProcess); }
    10431027
    10441028    WebPreferences& preferences() { return m_preferences; }
    … …  
    14311415#endif
    14321416
    1433     ProvisionalPageProxy* provisionalPageProxy() const { return m_provisionalPage.get(); }
    1434     void commitProvisionalPage(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
    1435 
    1436     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
    1437     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
    1438     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
    1439 
    1440     void loadDataWithNavigation(API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt);
    1441     void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt);
    1442 
    1443     // IPC::MessageReceiver
    1444     // Implemented in generated WebPageProxyMessageReceiver.cpp
    1445     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
    1446     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
    1447 
    14481417private:
    14491418    WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
    … …  
    14701439    void setUserAgent(String&&);
    14711440
     1441    // IPC::MessageReceiver
     1442    // Implemented in generated WebPageProxyMessageReceiver.cpp
     1443    void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
     1444    void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
     1445
     1446
    14721447    // IPC::MessageSender
    14731448    bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
    … …  
    14911466    void didCreateWindow(uint64_t frameID, WebCore::GlobalWindowIdentifier&&);
    14921467
     1468    void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
     1469    void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
    14931470    void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay, WebCore::LockBackForwardList);
    14941471    void didCancelClientRedirectForFrame(uint64_t frameID);
    14951472    void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, URL&&);
     1473    void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
    14961474    void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
    14971475    void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
    … …  
    15971575
    15981576    void reattachToWebProcess();
    1599     void swapToWebProcess(Ref<WebProcessProxy>&&, std::unique_ptr<DrawingAreaProxy>&&, RefPtr<WebFrameProxy>&& mainFrame);
     1577    void swapToWebProcess(Ref<WebProcessProxy>&&, std::unique_ptr<SuspendedPageProxy>&&, IsSwapFromSuspended);
    16001578    void didFailToSuspendAfterProcessSwap();
    16011579    void didSuspendAfterProcessSwap();
    16021580
    1603     enum class ShouldInitializeWebPage { No, Yes };
    1604     void finishAttachingToWebProcess(ShouldInitializeWebPage = ShouldInitializeWebPage::Yes);
     1581    void finishAttachingToWebProcess(IsSwapFromSuspended = IsSwapFromSuspended::No);
    16051582
    16061583    RefPtr<API::Navigation> reattachToWebProcessForReload();
    16071584    RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem&);
     1585
     1586    void loadDataWithNavigation(API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt);
     1587    void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt);
    16081588
    16091589    void requestNotificationPermission(uint64_t notificationID, const String& originString);
    … …  
    19681948
    19691949    RefPtr<WebFrameProxy> m_mainFrame;
     1950    Function<void()> m_mainFrameCreationHandler;
     1951    Function<void(const WebCore::GlobalWindowIdentifier&)> m_mainFrameWindowCreationHandler;
    19701952
    19711953    RefPtr<WebFrameProxy> m_focusedFrame;
    … …  
    23372319    bool m_mayHaveUniversalFileReadSandboxExtension { false };
    23382320
    2339     std::unique_ptr<ProvisionalPageProxy> m_provisionalPage;
    2340 
    23412321#if HAVE(PENCILKIT)
    23422322    std::unique_ptr<EditableImageController> m_editableImageController;
  • branches/safari-607-branch/Source/WebKit/UIProcess/WebProcessProxy.cpp

    r240258 r240262  
    3535#include "PluginInfoStore.h"
    3636#include "PluginProcessManager.h"
    37 #include "ProvisionalPageProxy.h"
    3837#include "TextChecker.h"
    3938#include "TextCheckerState.h"
    … …  
    586585#endif
    587586
    588 bool WebProcessProxy::hasProvisionalPageWithID(uint64_t pageID) const
    589 {
    590     for (auto* provisionalPage : m_provisionalPages) {
    591         if (provisionalPage->page().pageID() == pageID)
    592             return true;
    593     }
    594     return false;
    595 }
    596 
    597587void WebProcessProxy::updateBackForwardItem(const BackForwardListItemState& itemState)
    598588{
    … …  
    602592        // e.g. The old web process is navigating to about:blank for suspension.
    603593        // We ignore these updates.
    604         if (m_pageMap.contains(item->pageID()) || hasProvisionalPageWithID(item->pageID()))
     594        if (m_pageMap.contains(item->pageID()))
    605595            item->setPageState(itemState.pageState);
    606596    }
    … …  
    705695
    706696    auto pages = copyToVectorOf<RefPtr<WebPageProxy>>(m_pageMap.values());
    707     auto provisionalPages = WTF::map(m_provisionalPages, [](auto* provisionalPage) { return makeWeakPtr(provisionalPage); });
    708697
    709698    shutDown();
    … …  
    720709    for (auto& page : pages)
    721710        page->processDidTerminate(ProcessTerminationReason::Crash);
    722 
    723     for (auto& provisionalPage : provisionalPages) {
    724         if (provisionalPage)
    725             provisionalPage->processDidTerminate();
    726     }
    727711}
    728712
    … …  
    796780        page->processDidFinishLaunching();
    797781    }
    798 
    799     for (auto* provisionalPage : m_provisionalPages) {
    800         ASSERT(this == &provisionalPage->process());
    801         provisionalPage->processDidFinishLaunching();
    802     }
    803 
    804782
    805783    RELEASE_ASSERT(!m_webConnection);
    … …  
    896874bool WebProcessProxy::canTerminateChildProcess()
    897875{
    898     if (!m_pageMap.isEmpty() || m_processPool->hasSuspendedPageFor(*this) || !m_provisionalPages.isEmpty())
     876    if (!m_pageMap.isEmpty() || m_processPool->hasSuspendedPageFor(*this))
    899877        return false;
    900878
  • branches/safari-607-branch/Source/WebKit/UIProcess/WebProcessProxy.h

    r240258 r240262  
    7171class ObjCObjectGraph;
    7272class PageClient;
    73 class ProvisionalPageProxy;
    7473class UserMediaCaptureManagerProxy;
    7574class VisitedLinkStore;
    … …  
    126125    void removeWebPage(WebPageProxy&, uint64_t pageID, EndsUsingDataStore);
    127126
    128     void addProvisionalPageProxy(ProvisionalPageProxy& provisionalPage) { ASSERT(!m_provisionalPages.contains(&provisionalPage)); m_provisionalPages.add(&provisionalPage); }
    129     void removeProvisionalPageProxy(ProvisionalPageProxy& provisionalPage) { ASSERT(m_provisionalPages.contains(&provisionalPage)); m_provisionalPages.remove(&provisionalPage); }
    130 
    131127    typename WebPageProxyMap::ValuesConstIteratorRange pages() const { return m_pageMap.values(); }
    132128    unsigned pageCount() const { return m_pageMap.size(); }
    … …  
    335331    void logDiagnosticMessageForResourceLimitTermination(const String& limitKey);
    336332
    337     bool hasProvisionalPageWithID(uint64_t pageID) const;
    338 
    339333    enum class IsWeak { No, Yes };
    340334    template<typename T> class WeakOrStrongPtr {
    … …  
    380374    WebPageProxyMap m_pageMap;
    381375    WebFrameProxyMap m_frameMap;
    382     HashSet<ProvisionalPageProxy*> m_provisionalPages;
    383376    UserInitiatedActionMap m_userInitiatedActionMap;
    384377
  • branches/safari-607-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r240258 r240262  
    30963096                466BC0391FA266C9002FA9C1 /* WebSWContextManagerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSWContextManagerConnection.h; sourceTree = "<group>"; };
    30973097                466BC03A1FA266C9002FA9C1 /* WebSWContextManagerConnection.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebSWContextManagerConnection.messages.in; sourceTree = "<group>"; };
    3098                 4683569A21E81CC7006E27A3 /* ProvisionalPageProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProvisionalPageProxy.h; sourceTree = "<group>"; };
    3099                 4683569B21E81CC7006E27A3 /* ProvisionalPageProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProvisionalPageProxy.cpp; sourceTree = "<group>"; };
    31003098                46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackgroundProcessResponsivenessTimer.cpp; sourceTree = "<group>"; };
    31013099                46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackgroundProcessResponsivenessTimer.h; sourceTree = "<group>"; };
    … …  
    73237321                                86E67A21190F411800004AB7 /* ProcessThrottler.h */,
    73247322                                83048AE51ACA45DC0082C832 /* ProcessThrottlerClient.h */,
    7325                                 4683569B21E81CC7006E27A3 /* ProvisionalPageProxy.cpp */,
    7326                                 4683569A21E81CC7006E27A3 /* ProvisionalPageProxy.h */,
    73277323                                A55BA81B1BA25B1E007CD33D /* RemoteWebInspectorProxy.cpp */,
    73287324                                A55BA8191BA25B1E007CD33D /* RemoteWebInspectorProxy.h */,
  • branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebFrame.cpp

    r240258 r240262  
    264264    case WebPolicyAction::Download:
    265265        return WebCore::PolicyAction::Download;
     266    case WebPolicyAction::Suspend:
     267        break;
    266268    }
    267269    ASSERT_NOT_REACHED();
    … …  
    271273void WebFrame::didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction action, uint64_t navigationID, DownloadID downloadID, Optional<WebsitePoliciesData>&& websitePolicies)
    272274{
    273     if (!m_coreFrame || !m_policyListenerID || listenerID != m_policyListenerID || !m_policyFunction)
     275    if (!m_coreFrame || !m_policyListenerID || listenerID != m_policyListenerID || !m_policyFunction) {
     276        if (action == WebPolicyAction::Suspend)
     277            page()->send(Messages::WebPageProxy::DidFailToSuspendAfterProcessSwap());
    274278        return;
     279    }
    275280
    276281    FramePolicyFunction function = WTFMove(m_policyFunction);
    … …  
    288293    }
    289294
     295    bool shouldSuspend = false;
     296    if (action == WebPolicyAction::Suspend) {
     297        shouldSuspend = true;
     298        action = WebPolicyAction::Ignore;
     299    }
     300
    290301    function(toPolicyAction(action));
     302
     303    if (shouldSuspend)
     304        page()->suspendForProcessSwap();
    291305}
    292306
  • branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r240258 r240262  
    403403    , m_cpuLimit(parameters.cpuLimit)
    404404#if PLATFORM(MAC)
    405     , m_shouldAttachDrawingAreaOnPageTransition(parameters.isProcessSwap)
     405    , m_shouldAttachDrawingAreaOnPageTransition(parameters.isSwapFromSuspended)
    406406#endif
    407407{
    … …  
    473473    m_drawingArea->setShouldScaleViewToFitDocument(parameters.shouldScaleViewToFitDocument);
    474474
    475     if (parameters.isProcessSwap)
    476         freezeLayerTree(LayerTreeFreezeReason::ProcessSwap);
     475    if (parameters.isSwapFromSuspended)
     476        freezeLayerTree(LayerTreeFreezeReason::SwapFromSuspended);
    477477
    478478#if ENABLE(ASYNC_SCROLLING)
    … …  
    698698        m_drawingArea->setPaintingEnabled(true);
    699699#if PLATFORM(MAC)
    700         m_shouldAttachDrawingAreaOnPageTransition = parameters.isProcessSwap;
     700        m_shouldAttachDrawingAreaOnPageTransition = parameters.isSwapFromSuspended;
    701701#endif
    702702        unfreezeLayerTree(LayerTreeFreezeReason::PageSuspended);
    … …  
    30573057    if (!frame)
    30583058        return;
     3059    if (policyAction == WebPolicyAction::Suspend) {
     3060        ASSERT(frame == m_mainFrame);
     3061        setIsSuspended(true);
     3062
     3063        WebProcess::singleton().sendPrewarmInformation(mainWebFrame()->url());
     3064    }
    30593065    frame->didReceivePolicyDecision(listenerID, policyAction, navigationID, downloadID, WTFMove(websitePolicies));
    30603066}
    … …  
    30983104    bool isInitialEmptyDocument = !m_mainFrame;
    30993105    if (!isInitialEmptyDocument)
    3100         unfreezeLayerTree(LayerTreeFreezeReason::ProcessSwap);
     3106        unfreezeLayerTree(LayerTreeFreezeReason::SwapFromSuspended);
    31013107
    31023108#if PLATFORM(MAC)
    … …  
    63106316        // Unfrozen on drawing area reset.
    63116317        freezeLayerTree(LayerTreeFreezeReason::PageSuspended);
    6312 
    6313         WebProcess::singleton().sendPrewarmInformation(mainWebFrame()->url());
    6314 
    6315         suspendForProcessSwap();
    63166318    } else
    63176319        m_shouldResetDrawingAreaAfterSuspend = true;
  • branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.h

    r240258 r240262  
    697697        PageSuspended           = 1 << 3,
    698698        Printing                = 1 << 4,
    699         ProcessSwap             = 1 << 5,
     699        SwapFromSuspended       = 1 << 5,
    700700    };
    701701    void freezeLayerTree(LayerTreeFreezeReason);
  • branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r240258 r240262  
    9898    setColorSpace(parameters.colorSpace);
    9999
    100     if (!parameters.isProcessSwap)
     100    if (!parameters.isSwapFromSuspended)
    101101        attach();
    102102}
  • branches/safari-607-branch/Tools/ChangeLog

    r240258 r240262  
     12019-01-22  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r240015. rdar://problem/47099573
     4
     5    Unreviewed, rolling out r239993, r239995, r239997, and
     6    r239999.
     7   
     8    Caused assertions under
     9    ViewGestureController::disconnectFromProcess()
     10   
     11    Reverted changesets:
     12   
     13    "Regression(PSON) View becomes blank after click a cross-site
     14    download link"
     15    https://bugs.webkit.org/show_bug.cgi?id=193361
     16    https://trac.webkit.org/changeset/239993
     17   
     18    "Unreviewed iOS build fix after r239993."
     19    https://trac.webkit.org/changeset/239995
     20   
     21    "Fix iOS build after r239993"
     22    https://bugs.webkit.org/show_bug.cgi?id=193361
     23    https://trac.webkit.org/changeset/239997
     24   
     25    "Unreviewed, revert part of r239997 as it is not needed to fix
     26    the build."
     27    https://trac.webkit.org/changeset/239999
     28   
     29    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     30
     31    2019-01-15  Chris Dumez  <cdumez@apple.com>
     32
     33            Unreviewed, rolling out r239993, r239995, r239997, and
     34            r239999.
     35
     36            Caused assertions under
     37            ViewGestureController::disconnectFromProcess()
     38
     39            Reverted changesets:
     40
     41            "Regression(PSON) View becomes blank after click a cross-site
     42            download link"
     43            https://bugs.webkit.org/show_bug.cgi?id=193361
     44            https://trac.webkit.org/changeset/239993
     45
     46            "Unreviewed iOS build fix after r239993."
     47            https://trac.webkit.org/changeset/239995
     48
     49            "Fix iOS build after r239993"
     50            https://bugs.webkit.org/show_bug.cgi?id=193361
     51            https://trac.webkit.org/changeset/239997
     52
     53            "Unreviewed, revert part of r239997 as it is not needed to fix
     54            the build."
     55            https://trac.webkit.org/changeset/239999
     56
    1572019-01-22  Alan Coon  <alancoon@apple.com>
    258
  • branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

    r240258 r240262  
    11/*
    2  * Copyright (C) 2017-2019 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
    … …  
    7373static bool willPerformClientRedirect;
    7474static bool didPerformClientRedirect;
    75 static bool shouldConvertToDownload;
    7675static RetainPtr<NSURL> clientRedirectSourceURL;
    7776static RetainPtr<NSURL> clientRedirectDestinationURL;
    … …  
    128127        decisionHandler(WKNavigationActionPolicyAllow);
    129128    didRepondToPolicyDecisionCall = true;
    130 }
    131 
    132 - (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler
    133 {
    134     decisionHandler(shouldConvertToDownload ? _WKNavigationResponsePolicyBecomeDownload : WKNavigationResponsePolicyAllow);
    135129}
    136130
    … …  
    14121406    EXPECT_FALSE(serverRedirected);
    14131407    EXPECT_EQ(3, numberOfDecidePolicyCalls);
    1414     EXPECT_EQ(3u, seenPIDs.size());
     1408    EXPECT_EQ(2u, seenPIDs.size());
    14151409}
    14161410
    … …  
    14721466
    14731467    EXPECT_WK_STREQ(@"pson://www.webkit.org/main1.html", [[webView URL] absoluteString]);
    1474 }
    1475 
    1476 static const char* linkToWebKitBytes = R"PSONRESOURCE(
    1477 <body>
    1478   <a id="testLink" href="pson://www.webkit.org/main.html">Link</a>
    1479 </body>
    1480 )PSONRESOURCE";
    1481 
    1482 TEST(ProcessSwap, PolicyCancelAfterServerRedirect)
    1483 {
    1484     auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
    1485     processPoolConfiguration.get().processSwapsOnNavigation = YES;
    1486     auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
    1487 
    1488     auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
    1489     [webViewConfiguration setProcessPool:processPool.get()];
    1490     auto handler = adoptNS([[PSONScheme alloc] init]);
    1491     [handler addMappingFromURLString:@"pson://www.google.com/main.html" toData:linkToWebKitBytes];
    1492     [handler addRedirectFromURLString:@"pson://www.webkit.org/main.html" toURLString:@"pson://www.apple.com/ignore.html"];
    1493     [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"pson"];
    1494 
    1495     auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
    1496     auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
    1497     [webView setNavigationDelegate:navigationDelegate.get()];
    1498 
    1499     navigationDelegate->decidePolicyForNavigationAction = ^(WKNavigationAction *action, void (^decisionHandler)(WKNavigationActionPolicy)) {
    1500         if ([action.request.URL.absoluteString hasSuffix:@"ignore.html"]) {
    1501             decisionHandler(WKNavigationActionPolicyCancel);
    1502             return;
    1503         }
    1504         decisionHandler(WKNavigationActionPolicyAllow);
    1505     };
    1506 
    1507     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.google.com/main.html"]];
    1508     [webView loadRequest:request];
    1509 
    1510     TestWebKitAPI::Util::run(&done);
    1511     done = false;
    1512     auto pidAfterFirstLoad = [webView _webProcessIdentifier];
    1513 
    1514     EXPECT_EQ(1, numberOfDecidePolicyCalls);
    1515 
    1516     [webView evaluateJavaScript:@"testLink.click()" completionHandler:nil];
    1517 
    1518     TestWebKitAPI::Util::run(&failed);
    1519     failed = false;
    1520     done = false;
    1521 
    1522     EXPECT_EQ(3, numberOfDecidePolicyCalls);
    1523 
    1524     // We should still be on google.com.
    1525     EXPECT_EQ(pidAfterFirstLoad, [webView _webProcessIdentifier]);
    1526     EXPECT_WK_STREQ(@"pson://www.google.com/main.html", [[webView URL] absoluteString]);
    1527 
    1528     [webView evaluateJavaScript:@"testLink.innerText" completionHandler: [&] (id innerText, NSError *error) {
    1529         EXPECT_WK_STREQ(@"Link", innerText);
    1530         done = true;
    1531     }];
    1532     TestWebKitAPI::Util::run(&done);
    1533     done = false;
    1534 }
    1535 
    1536 TEST(ProcessSwap, CrossSiteDownload)
    1537 {
    1538     auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
    1539     processPoolConfiguration.get().processSwapsOnNavigation = YES;
    1540     auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
    1541 
    1542     auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
    1543     [webViewConfiguration setProcessPool:processPool.get()];
    1544     auto handler = adoptNS([[PSONScheme alloc] init]);
    1545     [handler addMappingFromURLString:@"pson://www.google.com/main.html" toData:linkToWebKitBytes];
    1546     [handler addMappingFromURLString:@"pson://www.webkit.org/main.html" toData:"Hello"];
    1547     [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"pson"];
    1548 
    1549     auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
    1550     auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
    1551     [webView setNavigationDelegate:navigationDelegate.get()];
    1552 
    1553     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.google.com/main.html"]];
    1554     [webView loadRequest:request];
    1555 
    1556     TestWebKitAPI::Util::run(&done);
    1557     done = false;
    1558     auto pidAfterFirstLoad = [webView _webProcessIdentifier];
    1559 
    1560     shouldConvertToDownload = true;
    1561     [webView evaluateJavaScript:@"testLink.click()" completionHandler:nil];
    1562 
    1563     TestWebKitAPI::Util::run(&failed);
    1564     failed = false;
    1565     shouldConvertToDownload = false;
    1566 
    1567     // We should still be on google.com.
    1568     EXPECT_EQ(pidAfterFirstLoad, [webView _webProcessIdentifier]);
    1569     EXPECT_WK_STREQ(@"pson://www.google.com/main.html", [[webView URL] absoluteString]);
    1570 
    1571     [webView evaluateJavaScript:@"testLink.innerText" completionHandler: [&] (id innerText, NSError *error) {
    1572         EXPECT_WK_STREQ(@"Link", innerText);
    1573         done = true;
    1574     }];
    1575     TestWebKitAPI::Util::run(&done);
    1576     done = false;
    15771468}
    15781469
    … …  
    23422233    EXPECT_EQ(7u, [receivedMessages count]);
    23432234    EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pageshow NOT persisted", receivedMessages.get()[0]);
    2344     if ([receivedMessages.get()[1] hasPrefix:@"pson://www.webkit.org/main.html"]) {
    2345         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pagehide persisted", receivedMessages.get()[1]);
    2346         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - pageshow NOT persisted", receivedMessages.get()[2]);
    2347     } else {
    2348         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - pageshow NOT persisted", receivedMessages.get()[1]);
    2349         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pagehide persisted", receivedMessages.get()[2]);
    2350     }
    2351     if ([receivedMessages.get()[3] hasPrefix:@"pson://www.apple.com/main.html"]) {
    2352         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - pagehide persisted", receivedMessages.get()[3]);
    2353         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pageshow persisted", receivedMessages.get()[4]);
    2354     } else {
    2355         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pageshow persisted", receivedMessages.get()[3]);
    2356         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - pagehide persisted", receivedMessages.get()[4]);
    2357     }
    2358     if ([receivedMessages.get()[5] hasPrefix:@"pson://www.webkit.org/main.html"]) {
    2359         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pagehide persisted", receivedMessages.get()[5]);
    2360         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - pageshow persisted", receivedMessages.get()[6]);
    2361     } else {
    2362         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - pageshow persisted", receivedMessages.get()[5]);
    2363         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pagehide persisted", receivedMessages.get()[6]);
    2364     }
     2235    EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pagehide persisted", receivedMessages.get()[1]);
     2236    EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - pageshow NOT persisted", receivedMessages.get()[2]);
     2237    EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - pagehide persisted", receivedMessages.get()[3]);
     2238    EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pageshow persisted", receivedMessages.get()[4]);
     2239    EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - pagehide persisted", receivedMessages.get()[5]);
     2240    EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - pageshow persisted", receivedMessages.get()[6]);
    23652241}
    23662242
    … …  
    24322308    EXPECT_EQ(7u, [receivedMessages count]);
    24332309    EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - load", receivedMessages.get()[0]);
    2434     if ([receivedMessages.get()[1] hasPrefix:@"pson://www.webkit.org/main.html"]) {
    2435         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - unload", receivedMessages.get()[1]);
    2436         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - load", receivedMessages.get()[2]);
    2437     } else {
    2438         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - load", receivedMessages.get()[1]);
    2439         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - unload", receivedMessages.get()[2]);
    2440     }
    2441     if ([receivedMessages.get()[3] hasPrefix:@"pson://www.apple.com/main.html"]) {
    2442         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - unload", receivedMessages.get()[3]);
    2443         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - load", receivedMessages.get()[4]);
    2444     } else {
    2445         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - load", receivedMessages.get()[3]);
    2446         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - unload", receivedMessages.get()[4]);
    2447     }
    2448     if ([receivedMessages.get()[5] hasPrefix:@"pson://www.webkit.org/main.html"]) {
    2449         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - unload", receivedMessages.get()[5]);
    2450         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - load", receivedMessages.get()[6]);
    2451     } else {
    2452         EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - load", receivedMessages.get()[5]);
    2453         EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - unload", receivedMessages.get()[6]);
    2454     }
     2310    EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - unload", receivedMessages.get()[1]);
     2311    EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - load", receivedMessages.get()[2]);
     2312    EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - unload", receivedMessages.get()[3]);
     2313    EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - load", receivedMessages.get()[4]);
     2314    EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html - unload", receivedMessages.get()[5]);
     2315    EXPECT_WK_STREQ(@"pson://www.apple.com/main.html - load", receivedMessages.get()[6]);
    24552316}
    24562317
Note: See TracChangeset for help on using the changeset viewer.