Changeset 237264 in webkit
- Timestamp:
- Oct 18, 2018 2:16:52 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r237237 r237264 1 2018-10-18 Alex Christensen <achristensen@webkit.org> 2 3 Clean up FrameLoader two-state enums 4 https://bugs.webkit.org/show_bug.cgi?id=190731 5 6 Reviewed by Chris Dumez. 7 8 * wtf/EnumTraits.h: 9 (WTF::isValidEnum): 10 1 11 2018-10-17 Commit Queue <commit-queue@webkit.org> 2 12 -
trunk/Source/WTF/wtf/EnumTraits.h
r224505 r237264 52 52 }; 53 53 54 template<typename E, typename T >55 constexpr auto isValidEnum(T t) -> std::enable_if_t<std::is_enum<E>::value, bool>54 template<typename E, typename T, std::enable_if_t<std::is_enum<E>::value && !std::is_same<std::underlying_type_t<E>, bool>::value>* = nullptr> 55 constexpr bool isValidEnum(T t) 56 56 { 57 57 static_assert(sizeof(T) >= std::underlying_type_t<E>(), "Integral type must be at least the size of the underlying enum type"); 58 58 59 59 return EnumValueChecker<T, typename EnumTraits<E>::values>::isValidEnum(t); 60 } 61 62 template<typename E, typename T, std::enable_if_t<std::is_same<std::underlying_type_t<E>, bool>::value>* = nullptr> 63 constexpr bool isValidEnum(T t) 64 { 65 return !t || t == 1; 60 66 } 61 67 -
trunk/Source/WebCore/ChangeLog
r237262 r237264 1 2018-10-18 Alex Christensen <achristensen@webkit.org> 2 3 Clean up FrameLoader two-state enums 4 https://bugs.webkit.org/show_bug.cgi?id=190731 5 6 Reviewed by Chris Dumez. 7 8 This patch does three things: 9 1. Add an overload to EnumTraits so we do not need to list out the valid values of boolean enum classes. 10 The valid values are always 0 and 1. This is used when decoding from IPC. 11 2. Add a 2-state enum class for NewLoadInProgress instad of a bool so we can understand the code better. 12 3. Begin passing LockBackForwardList to the UIProcess. We will need it soon for PSON. 13 14 * history/CachedFrame.h: 15 * loader/EmptyFrameLoaderClient.h: 16 * loader/FrameLoader.cpp: 17 (WebCore::FrameLoader::provisionalLoadStarted): 18 (WebCore::FrameLoader::loadWithDocumentLoader): 19 (WebCore::FrameLoader::commitProvisionalLoad): 20 (WebCore::FrameLoader::clientRedirectCancelledOrFinished): 21 (WebCore::FrameLoader::clientRedirected): 22 (WebCore::FrameLoader::receivedMainResourceError): 23 (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): 24 * loader/FrameLoader.h: 25 * loader/FrameLoaderClient.h: 26 * loader/FrameLoaderTypes.h: 27 * loader/NavigationScheduler.cpp: 28 (WebCore::ScheduledNavigation::didStopTimer): 29 (WebCore::NavigationScheduler::cancel): 30 * loader/NavigationScheduler.h: 31 * platform/network/StoredCredentialsPolicy.h: 32 1 33 2018-10-18 Wenson Hsieh <wenson_hsieh@apple.com> 2 34 -
trunk/Source/WebCore/history/CachedFrame.h
r237074 r237264 39 39 class FrameView; 40 40 class Node; 41 enum class HasInsecureContent : uint8_t;41 enum class HasInsecureContent : bool; 42 42 43 43 class CachedFrameBase { -
trunk/Source/WebCore/loader/EmptyFrameLoaderClient.h
r237148 r237264 76 76 void dispatchDidReceiveServerRedirectForProvisionalLoad() final { } 77 77 void dispatchDidCancelClientRedirect() final { } 78 void dispatchWillPerformClientRedirect(const URL&, double, WallTime ) final { }78 void dispatchWillPerformClientRedirect(const URL&, double, WallTime, LockBackForwardList) final { } 79 79 void dispatchDidChangeLocationWithinPage() final { } 80 80 void dispatchDidPushStateWithinPage() final { } -
trunk/Source/WebCore/loader/FrameLoader.cpp
r237184 r237264 1069 1069 if (m_stateMachine.firstLayoutDone()) 1070 1070 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad); 1071 m_frame.navigationScheduler().cancel( true);1071 m_frame.navigationScheduler().cancel(NewLoadInProgress::Yes); 1072 1072 m_client.provisionalLoadStarted(); 1073 1073 … … 1593 1593 } 1594 1594 1595 m_frame.navigationScheduler().cancel( true);1595 m_frame.navigationScheduler().cancel(NewLoadInProgress::Yes); 1596 1596 1597 1597 if (m_currentLoadShouldBeTreatedAsContinuingLoad) { … … 1971 1971 // just about to commit a new page, there cannot possibly be a pending redirect at this point. 1972 1972 if (m_sentRedirectNotification) 1973 clientRedirectCancelledOrFinished( false);1973 clientRedirectCancelledOrFinished(NewLoadInProgress::No); 1974 1974 1975 1975 if (cachedPage && cachedPage->document()) { … … 2159 2159 } 2160 2160 2161 void FrameLoader::clientRedirectCancelledOrFinished( bool cancelWithLoadInProgress)2161 void FrameLoader::clientRedirectCancelledOrFinished(NewLoadInProgress newLoadInProgress) 2162 2162 { 2163 2163 // Note that -webView:didCancelClientRedirectForFrame: is called on the frame load delegate even if … … 2166 2166 m_client.dispatchDidCancelClientRedirect(); 2167 2167 2168 if ( !cancelWithLoadInProgress)2168 if (newLoadInProgress == NewLoadInProgress::No) 2169 2169 m_quickRedirectComing = false; 2170 2170 … … 2174 2174 void FrameLoader::clientRedirected(const URL& url, double seconds, WallTime fireDate, LockBackForwardList lockBackForwardList) 2175 2175 { 2176 m_client.dispatchWillPerformClientRedirect(url, seconds, fireDate );2176 m_client.dispatchWillPerformClientRedirect(url, seconds, fireDate, lockBackForwardList); 2177 2177 2178 2178 // Remember that we sent a redirect notification to the frame load delegate so that when we commit … … 3034 3034 // has ended. 3035 3035 if (m_sentRedirectNotification) 3036 clientRedirectCancelledOrFinished( false);3036 clientRedirectCancelledOrFinished(NewLoadInProgress::No); 3037 3037 } 3038 3038 … … 3290 3290 // FIXME: The client should be told about ignored non-quick redirects, too. 3291 3291 if (m_quickRedirectComing) 3292 clientRedirectCancelledOrFinished( false);3292 clientRedirectCancelledOrFinished(NewLoadInProgress::No); 3293 3293 3294 3294 setPolicyDocumentLoader(nullptr); -
trunk/Source/WebCore/loader/FrameLoader.h
r237110 r237264 84 84 class SubstituteData; 85 85 86 enum class NewLoadInProgress : bool; 86 87 enum class ShouldContinue; 87 88 enum class ShouldTreatAsContinuingLoad : bool; … … 281 282 bool allAncestorsAreComplete() const; // including this 282 283 void clientRedirected(const URL&, double delay, WallTime fireDate, LockBackForwardList); 283 void clientRedirectCancelledOrFinished( bool cancelWithLoadInProgress);284 void clientRedirectCancelledOrFinished(NewLoadInProgress); 284 285 285 286 WEBCORE_EXPORT void setOriginalURLForDownloadRequest(ResourceRequest&); -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r237148 r237264 104 104 class Widget; 105 105 106 enum class LockBackForwardList : bool; 106 107 enum class PolicyDecisionMode; 107 108 enum class ShouldSkipSafeBrowsingCheck : bool; … … 165 166 virtual void dispatchDidChangeProvisionalURL() { } 166 167 virtual void dispatchDidCancelClientRedirect() = 0; 167 virtual void dispatchWillPerformClientRedirect(const URL&, double interval, WallTime fireDate ) = 0;168 virtual void dispatchWillPerformClientRedirect(const URL&, double interval, WallTime fireDate, LockBackForwardList) = 0; 168 169 virtual void dispatchDidChangeMainDocument() { } 169 170 virtual void dispatchWillChangeDocument(const URL&, const URL&) { } -
trunk/Source/WebCore/loader/FrameLoaderTypes.h
r237074 r237264 130 130 }; 131 131 132 enum class LockHistory : uint8_t { 133 Yes, 134 No 135 }; 136 137 enum class LockBackForwardList : uint8_t { 138 Yes, 139 No 140 }; 141 142 enum class AllowNavigationToInvalidURL : uint8_t { 143 Yes, 144 No 145 }; 146 147 enum class HasInsecureContent : uint8_t { 148 Yes, 149 No, 150 }; 151 132 enum class LockHistory : bool { No, Yes }; 133 enum class LockBackForwardList : bool { No, Yes }; 134 enum class AllowNavigationToInvalidURL : bool { No, Yes }; 135 enum class HasInsecureContent : bool { No, Yes }; 152 136 153 137 struct SystemPreviewInfo { -
trunk/Source/WebCore/loader/NavigationScheduler.cpp
r237233 r237264 92 92 virtual bool shouldStartTimer(Frame&) { return true; } 93 93 virtual void didStartTimer(Frame&, Timer&) { } 94 virtual void didStopTimer(Frame&, bool /* newLoadInProgress */) { }94 virtual void didStopTimer(Frame&, NewLoadInProgress) { } 95 95 96 96 double delay() const { return m_delay; } … … 138 138 } 139 139 140 void didStopTimer(Frame& frame, boolnewLoadInProgress) override140 void didStopTimer(Frame& frame, NewLoadInProgress newLoadInProgress) override 141 141 { 142 142 if (!m_haveToldClient) … … 288 288 } 289 289 290 void didStopTimer(Frame& frame, boolnewLoadInProgress) override290 void didStopTimer(Frame& frame, NewLoadInProgress newLoadInProgress) override 291 291 { 292 292 if (!m_haveToldClient) … … 556 556 } 557 557 558 void NavigationScheduler::cancel( boolnewLoadInProgress)559 { 560 LOG(History, "NavigationScheduler %p cancel(newLoadInProgress=%d)", this, newLoadInProgress );558 void NavigationScheduler::cancel(NewLoadInProgress newLoadInProgress) 559 { 560 LOG(History, "NavigationScheduler %p cancel(newLoadInProgress=%d)", this, newLoadInProgress == NewLoadInProgress::Yes); 561 561 562 562 if (m_timer.isActive()) … … 564 564 m_timer.stop(); 565 565 566 if ( std::unique_ptr<ScheduledNavigation>redirect = WTFMove(m_redirect))566 if (auto redirect = WTFMove(m_redirect)) 567 567 redirect->didStopTimer(m_frame, newLoadInProgress); 568 568 } -
trunk/Source/WebCore/loader/NavigationScheduler.h
r219008 r237264 44 44 class URL; 45 45 46 enum class NewLoadInProgress : bool { No, Yes }; 47 46 48 class NavigationScheduler { 47 49 public: … … 61 63 void startTimer(); 62 64 63 void cancel( bool newLoadInProgress = false);65 void cancel(NewLoadInProgress = NewLoadInProgress::No); 64 66 void clear(); 65 67 -
trunk/Source/WebCore/platform/network/StoredCredentialsPolicy.h
r237110 r237264 28 28 namespace WebCore { 29 29 30 enum class StoredCredentialsPolicy : uint8_t{30 enum class StoredCredentialsPolicy : bool { 31 31 DoNotUse, 32 32 Use, -
trunk/Source/WebKit/ChangeLog
r237261 r237264 1 2018-10-18 Alex Christensen <achristensen@webkit.org> 2 3 Clean up FrameLoader two-state enums 4 https://bugs.webkit.org/show_bug.cgi?id=190731 5 6 Reviewed by Chris Dumez. 7 8 * NetworkProcess/NetworkProcess.h: 9 * NetworkProcess/NetworkProcess.messages.in: 10 * Shared/WebCoreArgumentCoders.h: 11 * UIProcess/WebPageProxy.cpp: 12 (WebKit::WebPageProxy::willPerformClientRedirectForFrame): 13 * UIProcess/WebPageProxy.h: 14 * UIProcess/WebPageProxy.messages.in: 15 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 16 (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect): 17 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 18 1 19 2018-10-18 Youenn Fablet <youenn@apple.com> 2 20 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r237110 r237264 67 67 class SecurityOrigin; 68 68 class URL; 69 enum class StoredCredentialsPolicy : uint8_t;69 enum class StoredCredentialsPolicy : bool; 70 70 struct MessageWithMessagePorts; 71 71 struct SecurityOriginData; -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r237110 r237264 80 80 WriteBlobToFilePath(WebCore::URL blobURL, String path, WebKit::SandboxExtension::Handle handle, uint64_t callbackID) 81 81 82 PreconnectTo(WebCore::URL url, enum: uint8_tWebCore::StoredCredentialsPolicy storedCredentialsPolicy);82 PreconnectTo(WebCore::URL url, enum:bool WebCore::StoredCredentialsPolicy storedCredentialsPolicy); 83 83 84 84 #if ENABLE(RESOURCE_LOAD_STATISTICS) -
trunk/Source/WebKit/Scripts/webkit/messages.py
r237110 r237264 389 389 'WebCore::KeyframeValueList': ['<WebCore/GraphicsLayer.h>'], 390 390 'WebCore::KeypressCommand': ['<WebCore/KeyboardEvent.h>'], 391 'WebCore::LockBackForwardList': ['<WebCore/FrameLoaderTypes.h>'], 391 392 'WebCore::NetworkTransactionInformation': ['<WebCore/NetworkLoadInformation.h>'], 392 393 'WebCore::PasteboardCustomData': ['<WebCore/Pasteboard.h>'], -
trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h
r236998 r237264 734 734 }; 735 735 736 template<> struct EnumTraits<WebCore::HasInsecureContent> {737 using values = EnumValues<738 WebCore::HasInsecureContent,739 WebCore::HasInsecureContent::No,740 WebCore::HasInsecureContent::Yes741 >;742 };743 744 736 template<> struct EnumTraits<WebCore::AutoplayEvent> { 745 737 using values = EnumValues< … … 752 744 }; 753 745 754 template<> struct EnumTraits<WebCore::ShouldSample> {755 using values = EnumValues<756 WebCore::ShouldSample,757 WebCore::ShouldSample::No,758 WebCore::ShouldSample::Yes759 >;760 };761 762 746 template<> struct EnumTraits<WebCore::NetworkLoadPriority> { 763 747 using values = EnumValues< … … 809 793 }; 810 794 811 template <> struct EnumTraits<WebCore::StoredCredentialsPolicy> {812 using values = EnumValues<813 WebCore::StoredCredentialsPolicy,814 WebCore::StoredCredentialsPolicy::DoNotUse,815 WebCore::StoredCredentialsPolicy::Use816 >;817 };818 819 795 template <> struct EnumTraits<WebCore::WorkerType> { 820 796 using values = EnumValues< -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r237257 r237264 3606 3606 } 3607 3607 3608 void WebPageProxy::willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay )3608 void WebPageProxy::willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay, WebCore::LockBackForwardList) 3609 3609 { 3610 3610 PageClientProtector protector(pageClient()); -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r237257 r237264 178 178 179 179 enum class AutoplayEvent : uint8_t; 180 enum class HasInsecureContent : uint8_t; 180 enum class LockBackForwardList : bool; 181 enum class HasInsecureContent : bool; 181 182 enum class NotificationDirection : uint8_t; 182 183 enum class ShouldSample : bool; … … 1417 1418 void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&, WebCore::URL&& unreachableURL, const UserData&); 1418 1419 void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&); 1419 void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay );1420 void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay, WebCore::LockBackForwardList); 1420 1421 void didCancelClientRedirectForFrame(uint64_t frameID); 1421 1422 void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&); -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r237233 r237264 131 131 DidStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL url, WebCore::URL unreachableURL, WebKit::UserData userData) 132 132 DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest request, WebKit::UserData userData) 133 WillPerformClientRedirectForFrame(uint64_t frameID, String url, double delay )133 WillPerformClientRedirectForFrame(uint64_t frameID, String url, double delay, enum:bool WebCore::LockBackForwardList lockBackForwardList) 134 134 DidCancelClientRedirectForFrame(uint64_t frameID) 135 135 DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL url) … … 150 150 DidDestroyNavigation(uint64_t navigationID) 151 151 152 HasInsecureContent() -> (enum: uint8_tWebCore::HasInsecureContent hasInsecureContent)152 HasInsecureContent() -> (enum:bool WebCore::HasInsecureContent hasInsecureContent) 153 153 154 154 MainFramePluginHandlesPageScaleGestureDidChange(bool mainFramePluginHandlesPageScaleGesture) -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r237205 r237264 345 345 } 346 346 347 void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const URL& url, double interval, WallTime fireDate )347 void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const URL& url, double interval, WallTime fireDate, LockBackForwardList lockBackForwardList) 348 348 { 349 349 WebPage* webPage = m_frame->page(); … … 355 355 356 356 // Notify the UIProcess. 357 webPage->send(Messages::WebPageProxy::WillPerformClientRedirectForFrame(m_frame->frameID(), url.string(), interval ));357 webPage->send(Messages::WebPageProxy::WillPerformClientRedirectForFrame(m_frame->frameID(), url.string(), interval, lockBackForwardList)); 358 358 } 359 359 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r237138 r237264 104 104 void dispatchDidChangeProvisionalURL() final; 105 105 void dispatchDidCancelClientRedirect() final; 106 void dispatchWillPerformClientRedirect(const WebCore::URL&, double interval, WallTime fireDate ) final;106 void dispatchWillPerformClientRedirect(const WebCore::URL&, double interval, WallTime fireDate, WebCore::LockBackForwardList) final; 107 107 void dispatchDidChangeLocationWithinPage() final; 108 108 void dispatchDidPushStateWithinPage() final; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r237260 r237264 1 2018-10-18 Alex Christensen <achristensen@webkit.org> 2 3 Clean up FrameLoader two-state enums 4 https://bugs.webkit.org/show_bug.cgi?id=190731 5 6 Reviewed by Chris Dumez. 7 8 * WebCoreSupport/WebFrameLoaderClient.h: 9 * WebCoreSupport/WebFrameLoaderClient.mm: 10 (WebFrameLoaderClient::dispatchWillPerformClientRedirect): 11 1 12 2018-10-18 Alex Christensen <achristensen@webkit.org> 2 13 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h
r237148 r237264 108 108 void dispatchDidReceiveServerRedirectForProvisionalLoad() final; 109 109 void dispatchDidCancelClientRedirect() final; 110 void dispatchWillPerformClientRedirect(const WebCore::URL&, double interval, WallTime fireDate ) final;110 void dispatchWillPerformClientRedirect(const WebCore::URL&, double interval, WallTime fireDate, WebCore::LockBackForwardList) final; 111 111 void dispatchDidChangeLocationWithinPage() final; 112 112 void dispatchDidPushStateWithinPage() final; -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
r237157 r237264 603 603 } 604 604 605 void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const URL& url, double delay, WallTime fireDate )605 void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const URL& url, double delay, WallTime fireDate, LockBackForwardList) 606 606 { 607 607 WebView *webView = getWebView(m_webFrame.get()); -
trunk/Source/WebKitLegacy/win/ChangeLog
r237233 r237264 1 2018-10-18 Alex Christensen <achristensen@webkit.org> 2 3 Clean up FrameLoader two-state enums 4 https://bugs.webkit.org/show_bug.cgi?id=190731 5 6 Reviewed by Chris Dumez. 7 8 * WebCoreSupport/WebFrameLoaderClient.cpp: 9 (WebFrameLoaderClient::dispatchWillPerformClientRedirect): 10 * WebCoreSupport/WebFrameLoaderClient.h: 11 1 12 2018-10-17 Alex Christensen <achristensen@webkit.org> 2 13 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp
r237148 r237264 355 355 } 356 356 357 void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const URL& url, double delay, WallTime fireDate )357 void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const URL& url, double delay, WallTime fireDate, WebCore::LockBackForwardList) 358 358 { 359 359 WebView* webView = m_webFrame->webView(); -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h
r237148 r237264 86 86 void dispatchDidReceiveServerRedirectForProvisionalLoad() override; 87 87 void dispatchDidCancelClientRedirect() override; 88 void dispatchWillPerformClientRedirect(const WebCore::URL&, double interval, WallTime fireDate ) override;88 void dispatchWillPerformClientRedirect(const WebCore::URL&, double interval, WallTime fireDate, WebCore::LockBackForwardList) override; 89 89 void dispatchDidChangeLocationWithinPage() override; 90 90 void dispatchDidPushStateWithinPage() override;
Note: See TracChangeset
for help on using the changeset viewer.