Bug 108808

Summary: [Qt] Restore URL Scheme Delegates after QtWebProcess crash
Product: WebKit Reporter: Milian Wolff <milian.wolff>
Component: WebKit QtAssignee: Milian Wolff <milian.wolff>
Status: RESOLVED FIXED    
Severity: Normal CC: abecsi, benjamin, cmarcelo, hausmann, menard, webkit.review.bot, zeno
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Milian Wolff 2013-02-04 03:17:20 PST
When the QtWebProcess crashes, the registered URL Scheme Delegates are not properly restored over IPC in the newly launched process instance.
Comment 1 Milian Wolff 2013-02-04 03:27:29 PST
Created attachment 186334 [details]
Patch
Comment 2 Zeno Albisser 2013-02-04 04:48:06 PST
LGTM
Comment 3 Simon Hausmann 2013-02-04 05:35:22 PST
Comment on attachment 186334 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=186334&action=review

> Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:790
> +    for (int i = 0; i < experimental->schemeDelegates_Count(&schemes); ++i) {

Why not call _Count before the loop instead of for each iteration? It cannot be inlined.

LGTM otherwise.
Comment 4 Milian Wolff 2013-02-04 06:17:12 PST
Created attachment 186364 [details]
Patch
Comment 5 Simon Hausmann 2013-02-04 07:02:05 PST
LGTM. Perhaps Benjamin can help us with the review :)
Comment 6 Michael BrĂ¼ning 2013-02-14 07:11:51 PST
Comment on attachment 186364 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=186364&action=review

> Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:789
> +    QQmlListProperty<QQuickUrlSchemeDelegate> schemes = experimental->schemeDelegates();

I think we have to add this here in order to keep qrc-schemes working:
webPageProxy->registerApplicationScheme(ASCIILiteral("qrc"));
Comment 7 Benjamin Poulain 2013-02-14 16:33:13 PST
Comment on attachment 186364 [details]
Patch

I have nothing against this. Simon, feel free to review.

On a related node: shouldn't you switch to the CustomProtocolManager instead of the custom ApplicationScheme thingy?
On a slightly related side note: It would be good to split WebPage and WebPageProxy between the stuff that are core, and the stuff that are platform quirks. This could be done by supplements and/or subclasses. Maybe you want to start something like this to clean custom handling like ApplicationScheme?
Comment 8 Zeno Albisser 2013-02-15 01:10:40 PST
(In reply to comment #7)
> (From update of attachment 186364 [details])
> I have nothing against this. Simon, feel free to review.
> 
> On a related node: shouldn't you switch to the CustomProtocolManager instead of the custom ApplicationScheme thingy?
> On a slightly related side note: It would be good to split WebPage and WebPageProxy between the stuff that are core, and the stuff that are platform quirks. This could be done by supplements and/or subclasses. Maybe you want to start something like this to clean custom handling like ApplicationScheme?

Hi Benjamin,
I am currently working on exactly that issue. I think the CustomProtocolManager will fit relatively well.
The only thing that I am aware of, that might be missing is a way to register/unregister schemes at runtime through the C-API. - Or did I overlook anything there?
Comment 9 Benjamin Poulain 2013-02-15 01:17:38 PST
> The only thing that I am aware of, that might be missing is a way to register/unregister schemes at runtime through the C-API. - Or did I overlook anything there?

RegisterScheme/UnregisterScheme? http://trac.webkit.org/browser/trunk/Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.messages.in :)
Comment 10 Benjamin Poulain 2013-02-15 01:18:34 PST
Oh, through C API! Yep, it is possible there isn't one.
Comment 11 Simon Hausmann 2013-02-15 01:39:20 PST
Comment on attachment 186364 [details]
Patch

r=me, signed off for WK2 by Benjamin, but Michael's proposed change seems required before landing (cq-)
Comment 12 Milian Wolff 2013-02-15 06:42:06 PST
Created attachment 188553 [details]
Patch
Comment 13 Milian Wolff 2013-02-15 06:44:03 PST
OK, qrc scheme handler gets reregistered now as well. I furthermore created https://bugs.webkit.org/show_bug.cgi?id=109934 to figure out how we can disable the qrc scheme handler if not desired.

Anything else?
Comment 14 WebKit Review Bot 2013-02-15 07:35:37 PST
Comment on attachment 188553 [details]
Patch

Clearing flags on attachment: 188553

Committed r142997: <http://trac.webkit.org/changeset/142997>
Comment 15 WebKit Review Bot 2013-02-15 07:35:42 PST
All reviewed patches have been landed.  Closing bug.