| Summary: | Replace WebPageConfiguration with API::PageConfiguration and expose a C-SPI accessor for it | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Sam Weinig <sam> | ||||||||||||||||||
| Component: | New Bugs | Assignee: | Sam Weinig <sam> | ||||||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||||||
| Severity: | Normal | CC: | andersca, mitz | ||||||||||||||||||
| Priority: | P2 | ||||||||||||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||||||||||
| Hardware: | Unspecified | ||||||||||||||||||||
| OS: | Unspecified | ||||||||||||||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=148471 | ||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||
|
Description
Sam Weinig
2015-08-08 13:59:10 PDT
This is a step on the way to making WKWebViewConfiguration backed by API::PageConfiguration. Created attachment 258573 [details]
Patch
Created attachment 258574 [details]
Patch
Created attachment 258575 [details]
Patch
Created attachment 258576 [details]
Patch
Created attachment 258577 [details]
Patch
Created attachment 258578 [details]
Patch
Created attachment 258579 [details]
Patch
Created attachment 258587 [details]
Patch
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? (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. Committed r188228: <http://trac.webkit.org/changeset/188228> |