WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
66886
[Qt][WK2] Remove QWKContext class and make sure the WebProcessProxy life is correctly managed.
https://bugs.webkit.org/show_bug.cgi?id=66886
Summary
[Qt][WK2] Remove QWKContext class and make sure the WebProcessProxy life is c...
Alexis Menard (darktears)
Reported
2011-08-24 13:19:54 PDT
[Qt][WK2] Remove QWKContext class and make sure the WebContext life is correctly managed.
Attachments
Patch
(18.42 KB, patch)
2011-08-24 13:28 PDT
,
Alexis Menard (darktears)
no flags
Details
Formatted Diff
Diff
Patch
(19.23 KB, patch)
2011-08-25 06:13 PDT
,
Alexis Menard (darktears)
no flags
Details
Formatted Diff
Diff
Patch
(19.36 KB, patch)
2011-08-25 06:46 PDT
,
Alexis Menard (darktears)
no flags
Details
Formatted Diff
Diff
Patch
(19.68 KB, patch)
2011-08-25 07:28 PDT
,
Alexis Menard (darktears)
benjamin
: review+
benjamin
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Alexis Menard (darktears)
Comment 1
2011-08-24 13:28:54 PDT
Created
attachment 105057
[details]
Patch
Kenneth Rohde Christiansen
Comment 2
2011-08-25 05:07:25 PDT
Comment on
attachment 105057
[details]
Patch jocelyn did the QWKContext class, he might have comments
Andreas Kling
Comment 3
2011-08-25 05:25:08 PDT
Comment on
attachment 105057
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=105057&action=review
> Source/WebKit2/ChangeLog:8 > + Remove QWKContext class from Qt APIs as it doesn't bring that much value. QtWebPageProxy now holds
I don't agree that QWKContext brings no value, it was just way too low-level for the current Qt5 API vision. :)
> Source/WebKit2/UIProcess/qt/ClientImpl.cpp:153 > - emit toQWKContext(clientInfo)->iconChangedForPageURL(qUrl); > + // FIXME : emit toQWKContext(clientInfo)->iconChangedForPageURL(qUrl);
I'd rather you remove this function altogether.
> Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp:63 > +RefPtr<WebContext> QtWebPageProxy::defaultContext;
I'm not 100% sure about this. This means that defaultWKContext() is unsafe to call during static object initialization.
> Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp:212 > + if (m_context == defaultContext && m_context->refCount() == 2) > + defaultContext = 0;
This looks very fragile. If someone adds another ref somewhere in the future, we'll never reset the defaultContext ptr. Can we solve this in another way?
> Source/WebKit2/UIProcess/qt/QtWebPageProxy.h:198 > + static RefPtr<WebContext> defaultContext;
I like the s_ prefix for static variables. NABD.
> Source/WebKit2/UIProcess/qt/QtWebPageProxy.h:200 > + RefPtr<WebContext> m_context;
Two spaces.
Alexis Menard (darktears)
Comment 4
2011-08-25 05:35:47 PDT
(In reply to
comment #3
)
> (From update of
attachment 105057
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=105057&action=review
> > > Source/WebKit2/ChangeLog:8 > > + Remove QWKContext class from Qt APIs as it doesn't bring that much value. QtWebPageProxy now holds > > I don't agree that QWKContext brings no value, it was just way too low-level for the current Qt5 API vision. :)
Ok ok Andreas don't be too personal about that class, I don't want you to cry maouahahahhaa.
> > > Source/WebKit2/UIProcess/qt/ClientImpl.cpp:153 > > - emit toQWKContext(clientInfo)->iconChangedForPageURL(qUrl); > > + // FIXME : emit toQWKContext(clientInfo)->iconChangedForPageURL(qUrl); > > I'd rather you remove this function altogether.
Will do.
> > > Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp:63 > > +RefPtr<WebContext> QtWebPageProxy::defaultContext; > > I'm not 100% sure about this. This means that defaultWKContext() is unsafe to call during static object initialization.
But how this could happen? Like someone nasty use another static which get a defaultWKContext() as a value. static relaying on other static are usually not recommended, or do you have an other use case in mind?
> > > Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp:212 > > + if (m_context == defaultContext && m_context->refCount() == 2) > > + defaultContext = 0; > > This looks very fragile. If someone adds another ref somewhere in the future, we'll never reset the defaultContext ptr. Can we solve this in another way?
Wait let me see what I can improve.
> > > Source/WebKit2/UIProcess/qt/QtWebPageProxy.h:198 > > + static RefPtr<WebContext> defaultContext; > > I like the s_ prefix for static variables. NABD.
Kenneth'd.
> > > Source/WebKit2/UIProcess/qt/QtWebPageProxy.h:200 > > + RefPtr<WebContext> m_context; > > Two spaces.
Will change.
Alexis Menard (darktears)
Comment 5
2011-08-25 06:13:11 PDT
Created
attachment 105167
[details]
Patch
Alexis Menard (darktears)
Comment 6
2011-08-25 06:46:05 PDT
Created
attachment 105174
[details]
Patch
Alexis Menard (darktears)
Comment 7
2011-08-25 07:28:02 PDT
Created
attachment 105184
[details]
Patch
Benjamin Poulain
Comment 8
2011-08-25 07:30:02 PDT
View in context:
https://bugs.webkit.org/attachment.cgi?id=105174&action=review
> Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp:219 > + s_defaultContext = 0;
s_defaultContext.clear() or = nullptr for clarity?
> Source/WebKit2/UIProcess/qt/QtWebPageProxy.h:72 > + QtWebPageProxy(WebKit::ViewInterface*, WebKit::PolicyInterface*, WKContextRef, WKPageGroupRef = 0);
WKContextRef = 0 so you can simplify the constructors of the views?
Benjamin Poulain
Comment 9
2011-08-25 07:31:39 PDT
Comment on
attachment 105184
[details]
Patch Check my previous comments before landing.
Alexis Menard (darktears)
Comment 10
2011-08-25 07:35:54 PDT
(In reply to
comment #8
)
> View in context:
https://bugs.webkit.org/attachment.cgi?id=105174&action=review
> > > Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp:219 > > + s_defaultContext = 0; > > s_defaultContext.clear() or = nullptr for clarity?
ok
> > > Source/WebKit2/UIProcess/qt/QtWebPageProxy.h:72 > > + QtWebPageProxy(WebKit::ViewInterface*, WebKit::PolicyInterface*, WKContextRef, WKPageGroupRef = 0); > > WKContextRef = 0 so you can simplify the constructors of the views?
Fine will do before landing
Alexis Menard (darktears)
Comment 11
2011-08-25 08:14:00 PDT
Committed
r93784
: <
http://trac.webkit.org/changeset/93784
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug