Summary: | [Qt][WK2] Allow QtWebContext to call directly to QQuickWebView with a WKPageRef | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jocelyn Turcotte <jturcotte> | ||||
Component: | New Bugs | Assignee: | Jocelyn Turcotte <jturcotte> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | abecsi, allan.jensen, benjamin, buildbot, cmarcelo, hausmann, jturcotte, menard, rniwa, webkit.review.bot | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | 109827 | ||||||
Bug Blocks: | 108475 | ||||||
Attachments: |
|
Description
Jocelyn Turcotte
2013-02-14 07:15:53 PST
Created attachment 188345 [details]
Patch
Comment on attachment 188345 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=188345&action=review > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:92 > +typedef QMap<WKPageRef, QQuickWebViewPrivate*> PageToViewMap; > +Q_GLOBAL_STATIC(PageToViewMap, pageToView) Wouldn't an extra pointer in qquickwebviewprivate be more efficient. This doesn't seem like a rare property where we can save memory from using a map over using normal pointers. (In reply to comment #2) > (From update of attachment 188345 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=188345&action=review > > > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:92 > > +typedef QMap<WKPageRef, QQuickWebViewPrivate*> PageToViewMap; > > +Q_GLOBAL_STATIC(PageToViewMap, pageToView) > > Wouldn't an extra pointer in qquickwebviewprivate be more efficient. This doesn't seem like a rare property where we can save memory from using a map over using normal pointers. We already have a WKPageRef in qquickwebviewprivate. The matter is more the lookup, I need to find a qquickwebviewprivate using a WKPageRef. The only other solution I see is to keep a vector of all views and iterate them to find my page, that doesn't sound much better. (In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 188345 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=188345&action=review > > > > > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:92 > > > +typedef QMap<WKPageRef, QQuickWebViewPrivate*> PageToViewMap; > > > +Q_GLOBAL_STATIC(PageToViewMap, pageToView) > > > > Wouldn't an extra pointer in qquickwebviewprivate be more efficient. This doesn't seem like a rare property where we can save memory from using a map over using normal pointers. > > We already have a WKPageRef in qquickwebviewprivate. > The matter is more the lookup, I need to find a qquickwebviewprivate using a WKPageRef. The only other solution I see is to keep a vector of all views and iterate them to find my page, that doesn't sound much better. Ah, right. I read the map the wrong way. Comment on attachment 188345 [details]
Patch
LGTM.
Comment on attachment 188345 [details] Patch Attachment 188345 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/16595050 New failing tests: media/video-controls-captions-trackmenu.html Comment on attachment 188345 [details]
Patch
LGTM, but needs approval of owners. I am assuming the failure by the mac build-bot is an unmarked flaky test.
Benjamin, can you help us sign off on this one, too? :) WK2-sign-off-ping :) Comment on attachment 188345 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=188345&action=review That is great, sorry I did not see it earlier. I sign of on the change. > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:91 > +typedef QMap<WKPageRef, QQuickWebViewPrivate*> PageToViewMap; No love for HashTable? :( (In reply to comment #10) > (From update of attachment 188345 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=188345&action=review > > That is great, sorry I did not see it earlier. > I sign of on the change. > > > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:91 > > +typedef QMap<WKPageRef, QQuickWebViewPrivate*> PageToViewMap; > > No love for HashTable? :( Thanks! :) I'm trying to use Qt containers to avoid dependencies to WTF. There will generally be less than 5 pages open and rarely more than 50, so QMap should fit better than QHash, theoretically. > I'm trying to use Qt containers to avoid dependencies to WTF.
> There will generally be less than 5 pages open and rarely more than 50, so QMap should fit better than QHash, theoretically.
In Qt4, QMap was a fairly bad linked list.
(In reply to comment #12) > > I'm trying to use Qt containers to avoid dependencies to WTF. > > There will generally be less than 5 pages open and rarely more than 50, so QMap should fit better than QHash, theoretically. > > In Qt4, QMap was a fairly bad linked list. In QT 5 it's a red black tree again :) Committed r145515: <http://trac.webkit.org/changeset/145515> |