RESOLVED FIXED 147811
Replace WebPageConfiguration with API::PageConfiguration and expose a C-SPI accessor for it
https://bugs.webkit.org/show_bug.cgi?id=147811
Summary Replace WebPageConfiguration with API::PageConfiguration and expose a C-SPI a...
Sam Weinig
Reported 2015-08-08 13:59:10 PDT
Replace WebPageConfiguration with API::PageConfiguration and expose a C-SPI accessor for it
Attachments
Patch (41.43 KB, patch)
2015-08-08 14:06 PDT, Sam Weinig
no flags
Patch (48.34 KB, patch)
2015-08-08 14:24 PDT, Sam Weinig
no flags
Patch (48.34 KB, patch)
2015-08-08 14:25 PDT, Sam Weinig
no flags
Patch (51.12 KB, patch)
2015-08-08 14:36 PDT, Sam Weinig
no flags
Patch (51.27 KB, patch)
2015-08-08 16:00 PDT, Sam Weinig
no flags
Patch (51.78 KB, patch)
2015-08-08 16:01 PDT, Sam Weinig
no flags
Patch (51.78 KB, patch)
2015-08-08 16:15 PDT, Sam Weinig
no flags
Patch (51.95 KB, patch)
2015-08-08 20:23 PDT, Sam Weinig
darin: review+
Sam Weinig
Comment 1 2015-08-08 14:06:17 PDT
This is a step on the way to making WKWebViewConfiguration backed by API::PageConfiguration.
Sam Weinig
Comment 2 2015-08-08 14:06:44 PDT
Sam Weinig
Comment 3 2015-08-08 14:24:33 PDT
Sam Weinig
Comment 4 2015-08-08 14:25:56 PDT
Sam Weinig
Comment 5 2015-08-08 14:36:51 PDT
Sam Weinig
Comment 6 2015-08-08 16:00:51 PDT
Sam Weinig
Comment 7 2015-08-08 16:01:51 PDT
Sam Weinig
Comment 8 2015-08-08 16:15:49 PDT
Sam Weinig
Comment 9 2015-08-08 20:23:32 PDT
Darin Adler
Comment 10 2015-08-09 18:10:05 PDT
Comment on attachment 258587 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=258587&action=review > Source/WebKit2/UIProcess/API/APIPageConfiguration.cpp:55 > + auto copy = this->create(); Why the explicit "this->"? > Source/WebKit2/UIProcess/API/APIPageConfiguration.cpp:70 > + copy->m_processPool = this->m_processPool; > + copy->m_userContentController = this->m_userContentController; > + copy->m_pageGroup = this->m_pageGroup; > + copy->m_preferences = this->m_preferences; > + copy->m_preferenceValues = this->m_preferenceValues; > + copy->m_relatedPage = this->m_relatedPage; > + copy->m_visitedLinkProvider = this->m_visitedLinkProvider; > + copy->m_websiteDataStore = this->m_websiteDataStore; > + copy->m_sessionID = this->m_sessionID; > + copy->m_treatsSHA1SignedCertificatesAsInsecure = this->m_treatsSHA1SignedCertificatesAsInsecure; > + > +#if PLATFORM(IOS) > + copy->m_alwaysRunsAtForegroundPriority = this->m_alwaysRunsAtForegroundPriority; > +#endif This seems likely to be fragile. What will remind us to keep this in sync as we add data members? Is there a good reason to not use a copy constructor instead? It could be a private one to avoid confusion about reference counting, just as other constructors are private for the same reason. > Source/WebKit2/UIProcess/API/C/WKPage.cpp:134 > + auto configuration = toImpl(pageRef)->configuration().copy(); > + return toAPI(&configuration.leakRef()); Is the local variable needed? I think it would read fine without it. > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:305 > + Ref<API::PageConfiguration> pageConfiguration = API::PageConfiguration::create(); auto? > Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp:1320 > + Ref<API::PageConfiguration> pageConfiguration = API::PageConfiguration::create(); auto? > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:1049 > + Ref<API::PageConfiguration> pageConfiguration = API::PageConfiguration::create(); auto? > Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm:229 > + Ref<API::PageConfiguration> configuration = API::PageConfiguration::create(); auto? > Source/WebKit2/UIProcess/API/mac/WKView.mm:3997 > + Ref<API::PageConfiguration> configuration = API::PageConfiguration::create(); auto? > Source/WebKit2/UIProcess/API/mac/WKView.mm:4007 > + Ref<API::PageConfiguration> configuration = *toImpl(configurationRef); auto? > Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp:56 > + Ref<API::PageConfiguration> pageConfiguration = API::PageConfiguration::create(); auto?
Sam Weinig
Comment 11 2015-08-09 19:28:11 PDT
(In reply to comment #10) > Comment on attachment 258587 [details] > Patch > > Source/WebKit2/UIProcess/API/APIPageConfiguration.cpp:70 > > + copy->m_processPool = this->m_processPool; > > + copy->m_userContentController = this->m_userContentController; > > + copy->m_pageGroup = this->m_pageGroup; > > + copy->m_preferences = this->m_preferences; > > + copy->m_preferenceValues = this->m_preferenceValues; > > + copy->m_relatedPage = this->m_relatedPage; > > + copy->m_visitedLinkProvider = this->m_visitedLinkProvider; > > + copy->m_websiteDataStore = this->m_websiteDataStore; > > + copy->m_sessionID = this->m_sessionID; > > + copy->m_treatsSHA1SignedCertificatesAsInsecure = this->m_treatsSHA1SignedCertificatesAsInsecure; > > + > > +#if PLATFORM(IOS) > > + copy->m_alwaysRunsAtForegroundPriority = this->m_alwaysRunsAtForegroundPriority; > > +#endif > > This seems likely to be fragile. What will remind us to keep this in sync as > we add data members? Is there a good reason to not use a copy constructor > instead? It could be a private one to avoid confusion about reference > counting, just as other constructors are private for the same reason. Honestly, I was just blindingly following APIProcessPoolConfiguration, which does it this way. A copy constructor that copy calls would be cleaner. I'll do that for both classes in a follow up.
Sam Weinig
Comment 12 2015-08-10 13:52:10 PDT
Note You need to log in before you can comment on or make changes to this bug.