RESOLVED FIXED 167224
Remove PassRefPtr from "page" directory of WebCore, also deploy references
https://bugs.webkit.org/show_bug.cgi?id=167224
Summary Remove PassRefPtr from "page" directory of WebCore, also deploy references
Darin Adler
Reported 2017-01-19 19:02:20 PST
Remove PassRefPtr from "page" directory of WebCore, also deploy references
Attachments
Patch (280.42 KB, patch)
2017-01-19 19:03 PST, Darin Adler
no flags
Patch (284.80 KB, patch)
2017-01-19 19:47 PST, Darin Adler
no flags
Archive of layout-test-results from ews103 for mac-elcapitan (425.96 KB, application/zip)
2017-01-19 20:31 PST, Build Bot
no flags
Archive of layout-test-results from ews107 for mac-elcapitan-wk2 (349.69 KB, application/zip)
2017-01-19 20:34 PST, Build Bot
no flags
Archive of layout-test-results from ews115 for mac-elcapitan (320.75 KB, application/zip)
2017-01-19 20:35 PST, Build Bot
no flags
Patch (308.56 KB, patch)
2017-01-19 23:30 PST, Darin Adler
no flags
Patch (309.06 KB, patch)
2017-01-19 23:42 PST, Darin Adler
no flags
Patch (311.65 KB, patch)
2017-01-20 19:48 PST, Darin Adler
no flags
Patch (363.69 KB, patch)
2017-01-21 10:59 PST, Darin Adler
no flags
Patch (366.57 KB, patch)
2017-01-21 13:44 PST, Darin Adler
no flags
Patch (367.12 KB, patch)
2017-01-21 13:54 PST, Darin Adler
no flags
Patch (368.16 KB, patch)
2017-01-21 18:28 PST, Darin Adler
no flags
Patch (379.57 KB, patch)
2017-01-21 22:04 PST, Darin Adler
no flags
Patch (381.47 KB, patch)
2017-01-22 02:02 PST, Darin Adler
no flags
Archive of layout-test-results from ews100 for mac-elcapitan (777.47 KB, application/zip)
2017-01-22 03:11 PST, Build Bot
no flags
Patch (383.96 KB, patch)
2017-01-22 12:55 PST, Darin Adler
no flags
Archive of layout-test-results from ews102 for mac-elcapitan (714.63 KB, application/zip)
2017-01-22 14:02 PST, Build Bot
no flags
Patch (383.96 KB, patch)
2017-01-22 16:54 PST, Darin Adler
cdumez: review+
Darin Adler
Comment 1 2017-01-19 19:03:55 PST
Darin Adler
Comment 2 2017-01-19 19:47:56 PST
Build Bot
Comment 3 2017-01-19 20:31:38 PST
Comment on attachment 299305 [details] Patch Attachment 299305 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2918133 Number of test failures exceeded the failure limit.
Build Bot
Comment 4 2017-01-19 20:31:41 PST
Created attachment 299306 [details] Archive of layout-test-results from ews103 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 5 2017-01-19 20:34:26 PST
Comment on attachment 299305 [details] Patch Attachment 299305 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2918134 Number of test failures exceeded the failure limit.
Build Bot
Comment 6 2017-01-19 20:34:31 PST
Created attachment 299309 [details] Archive of layout-test-results from ews107 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 7 2017-01-19 20:35:01 PST
Comment on attachment 299305 [details] Patch Attachment 299305 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/2918128 Number of test failures exceeded the failure limit.
Build Bot
Comment 8 2017-01-19 20:35:05 PST
Created attachment 299310 [details] Archive of layout-test-results from ews115 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Darin Adler
Comment 9 2017-01-19 23:30:38 PST
Darin Adler
Comment 10 2017-01-19 23:42:08 PST
Darin Adler
Comment 11 2017-01-20 19:48:58 PST
Darin Adler
Comment 12 2017-01-21 10:59:24 PST
Darin Adler
Comment 13 2017-01-21 13:44:15 PST
Darin Adler
Comment 14 2017-01-21 13:54:57 PST
Darin Adler
Comment 15 2017-01-21 18:28:02 PST
Darin Adler
Comment 16 2017-01-21 22:04:58 PST
Darin Adler
Comment 17 2017-01-22 02:02:29 PST
Build Bot
Comment 18 2017-01-22 03:11:23 PST
Comment on attachment 299465 [details] Patch Attachment 299465 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2929738 New failing tests: media/audio-concurrent-supported.html imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html
Build Bot
Comment 19 2017-01-22 03:11:27 PST
Created attachment 299466 [details] Archive of layout-test-results from ews100 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Darin Adler
Comment 20 2017-01-22 12:55:18 PST
Build Bot
Comment 21 2017-01-22 14:02:54 PST
Comment on attachment 299479 [details] Patch Attachment 299479 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2931902 New failing tests: imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html
Build Bot
Comment 22 2017-01-22 14:02:57 PST
Created attachment 299483 [details] Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Darin Adler
Comment 23 2017-01-22 16:54:59 PST
Darin Adler
Comment 24 2017-01-22 19:42:49 PST
Finally, passing all the EWS tests! Now I need a reviewer.
Chris Dumez
Comment 25 2017-01-22 20:38:47 PST
(In reply to comment #24) > Finally, passing all the EWS tests! Now I need a reviewer. Looking right now.
Chris Dumez
Comment 26 2017-01-22 21:17:04 PST
Comment on attachment 299489 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299489&action=review r=me > Source/WebCore/loader/FrameLoader.cpp:1856 > + if (auto* page = m_frame.page()) Why did we drop the m_frame.document()->doctype() null check? It seems we now call didReceiveDocType() even if we have no doctype. > Source/WebCore/page/DebugPageOverlays.cpp:146 > +RefPtr<RegionOverlay> RegionOverlay::create(MainFrame& frame, DebugPageOverlays::RegionType regionType) Can this return a Ref? The return nullptr below seems useless since the switch handles all enum values. > Source/WebCore/page/DragController.cpp:198 > RefPtr<DataTransfer> dataTransfer = DataTransfer::createForDragAndDrop(policy, dragData); Should be a Ref<> or auto. createForDragAndDrop() returns a Ref<> > Source/WebCore/page/DragController.cpp:228 > RefPtr<DataTransfer> dataTransfer = DataTransfer::createForDragAndDrop(DataTransferAccessPolicy::Readable, dragData); Should be a Ref<> or auto. createForDragAndDrop() returns a Ref<> > Source/WebCore/page/PerformanceUserTiming.cpp:92 > + RefPtr<PerformanceEntry> entry = WTFMove(performanceEntry); Why use a RefPtr here? Can't we use a Ref<> here and releaseNonNull() below? > Source/WebKit/win/WebView.cpp:5856 > + m_page->focusController().setFocusedElement(nullptr, m_page->focusController().focusedOrMainFrame()); Why this change? > Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:182 > +void WebChromeClient::elementDidFocus(WebCore::Element& element) No need for WebCore:: > Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:187 > +void WebChromeClient::elementDidBlur(WebCore::Element& element) No need for WebCore::
Darin Adler
Comment 27 2017-01-22 22:04:38 PST
Comment on attachment 299489 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299489&action=review Thanks for the review. >> Source/WebCore/loader/FrameLoader.cpp:1856 >> + if (auto* page = m_frame.page()) > > Why did we drop the m_frame.document()->doctype() null check? It seems we now call didReceiveDocType() even if we have no doctype. The other call sites for didReceiveDocType, in Document::childrenChanged and Document::updateViewportArguments, are both unconditional. This was the only one checking for a doctype. And if you look at the implementation, didReceiveDocType will call didReceiveMobileDocType with a boolean that correctly is based on whether a doctype is present as well as its contents. I made this call site for loading from a cached page consistent with the other call sites, and I think it is likely a progression even though I did not create a new test case. >> Source/WebCore/page/DebugPageOverlays.cpp:146 >> +RefPtr<RegionOverlay> RegionOverlay::create(MainFrame& frame, DebugPageOverlays::RegionType regionType) > > Can this return a Ref? The return nullptr below seems useless since the switch handles all enum values. Sure. It’s local to this file. It’s sometimes a pain to make something with a switch return a Ref because we have to write the unreachable code to compile correctly with our various compilers, but I will do that. >> Source/WebCore/page/DragController.cpp:198 >> RefPtr<DataTransfer> dataTransfer = DataTransfer::createForDragAndDrop(policy, dragData); > > Should be a Ref<> or auto. createForDragAndDrop() returns a Ref<> OK, done. >> Source/WebCore/page/DragController.cpp:228 >> RefPtr<DataTransfer> dataTransfer = DataTransfer::createForDragAndDrop(DataTransferAccessPolicy::Readable, dragData); > > Should be a Ref<> or auto. createForDragAndDrop() returns a Ref<> OK, done. >> Source/WebCore/page/PerformanceUserTiming.cpp:92 >> + RefPtr<PerformanceEntry> entry = WTFMove(performanceEntry); > > Why use a RefPtr here? Can't we use a Ref<> here and releaseNonNull() below? I am going to just leave this one alone for now. Changing this to a Ref would make the Vector definition below tricky. And, also, this code is disabled on Mac. I’d be fine if someone wants to come refine this later, but I prefer not to do that right now. >> Source/WebKit/win/WebView.cpp:5856 >> + m_page->focusController().setFocusedElement(nullptr, m_page->focusController().focusedOrMainFrame()); > > Why this change? I changed setFocusedElement to take a reference for the frame, not a pointer. I could have kept it taking a pointer just for this one Windows-only code path, but I prefer not to. No code for any other platform needs to pass null for the frame; I do not think Windows needs to. In fact, looking at it further, I think this is unused code on Windows. It’s in IWebViewPrivate.idl so it was exposed, probably for Safari on Windows, but I bet it is unused now and someone working on Windows can just delete this or perhaps empty out the function and make it do nothing. >> Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:182 >> +void WebChromeClient::elementDidFocus(WebCore::Element& element) > > No need for WebCore:: Took care of this. There were lots of other unneeded WebCore prefixes in this file; removed those too. >> Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:187 >> +void WebChromeClient::elementDidBlur(WebCore::Element& element) > > No need for WebCore:: Ditto.
Darin Adler
Comment 28 2017-01-22 22:25:41 PST
Chris Dumez
Comment 29 2017-01-23 09:42:15 PST
Note You need to log in before you can comment on or make changes to this bug.