Use DocumentChannel for view-source loads
Categories
(Core :: Networking, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: mattwoodrow, Assigned: mattwoodrow)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(6 files)
We currently don't use DocumentChannel for view-source, but we could/should (especially since it's usually http).
nsViewSourceChannel doesn't implement nsIChildChannel/nsIParentChannel.
I tried implementing nsIChildChannel and forwarding that to the inner channel.
This doesn't work because we create the 'real' channel as nsViewSourceChannel+HttpChannelChild. ConnectParent is forwarded to the http, which creates an HttpChannelParent in the parent process.
HttpChannelParent tries to initialize, but finds the registered channel is nsViewSourceChannel, not nsHttpChannel.
We may instead want nsViewSourceChannel to be a content-process only wrapper around DocumentChannelChild, so that all the existing DocumentChannel parts work.
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
I thought about a couple of approaches for fixing the issues outlined in comment 0.
The first was to have DocumentChannelParent/DocumentLoadListener detect 'view-source' in the passed URI (probably via nsINestedURI), and strip it out. That way the parent-side would only create the 'inner' real channel.
When forwarding the final channel into the content process, we'd re-add the view-source prefix so that we still get nsViewSourceChannel in the child (and implement forwarding nsIChildChannel so that the inner HttpChannelChild will connect to the nsHttpChannel in the parent).
That's a bit weird though, since the channel that we'll end up exposing to the process switching selection logic won't be view-source in any way, so we won't be able to use that in our decision making.
The other alternative is to create nsViewSourceChannel, but add a way to expose the 'inner' channel, so that we can put that channel into the registar instead of the nsViewSourceChannel. That'll mean when we setup the HttpChannelParent, it'll find the inner nsHttpChannel, not the nsViewSourceChannel.
That seemed easy enough, so I tried it, and it passes test.
Assignee | ||
Comment 2•5 years ago
|
||
Note that this also implicitly adds support for the view-source+srcdoc configuration, and setting of the BaseURI, which were both in the nsDocShell version but not the others.
Depends on D57590
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D57887
Assignee | ||
Comment 4•5 years ago
|
||
Depends on D57888
Assignee | ||
Comment 5•5 years ago
|
||
Depends on D57890
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D57891
Assignee | ||
Comment 7•5 years ago
|
||
Depends on D57893
Comment 9•5 years ago
|
||
Backed out 6 changesets (Bug 1598523) for geckoview failures complaining about NavigationDelegateTest.loadUnknownProtocol
Backout link: https://hg.mozilla.org/integration/autoland/rev/04d83102a831521995c6ebc15c210d7f81c6a2d8
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=283913915&repo=autoland&lineNumber=6325
[task 2020-01-07T23:45:39.177Z] 23:45:39 INFO - TEST-START | org.mozilla.geckoview.test.NavigationDelegateTest.loadUnknownProtocol
[task 2020-01-07T23:46:09.221Z] 23:46:09 INFO - org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: numtests=621
[task 2020-01-07T23:46:09.221Z] 23:46:09 INFO - org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: stream=
[task 2020-01-07T23:46:09.222Z] 23:46:09 INFO - org.mozilla.geckoview.test | Error in loadUnknownProtocol(org.mozilla.geckoview.test.NavigationDelegateTest):
[task 2020-01-07T23:46:09.222Z] 23:46:09 INFO - org.mozilla.geckoview.test | org.mozilla.geckoview.test.util.UiThreadUtils$TimeoutException: Timed out after 30000ms
[task 2020-01-07T23:46:09.222Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.util.UiThreadUtils$TimeoutRunnable.run(UiThreadUtils.java:58)
[task 2020-01-07T23:46:09.222Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Handler.handleCallback(Handler.java:751)
[task 2020-01-07T23:46:09.222Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Handler.dispatchMessage(Handler.java:95)
[task 2020-01-07T23:46:09.223Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.util.UiThreadUtils.waitForCondition(UiThreadUtils.java:161)
[task 2020-01-07T23:46:09.223Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.waitUntilCalled(GeckoSessionTestRule.java:1565)
[task 2020-01-07T23:46:09.223Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.waitUntilCalled(GeckoSessionTestRule.java:1448)
[task 2020-01-07T23:46:09.223Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.waitUntilCalled(GeckoSessionTestRule.java:1391)
[task 2020-01-07T23:46:09.229Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.waitUntilCalled(GeckoSessionTestRule.java:1377)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.NavigationDelegateTest.testLoadEarlyErrorWithErrorPage(NavigationDelegateTest.kt:123)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.NavigationDelegateTest.testLoadEarlyError(NavigationDelegateTest.kt:137)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.NavigationDelegateTest.loadUnknownProtocol(NavigationDelegateTest.kt:205)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at java.lang.reflect.Method.invoke(Native Method)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule$2.lambda$evaluate$0$GeckoSessionTestRule$2(GeckoSessionTestRule.java:1298)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.-$$Lambda$GeckoSessionTestRule$2$sIbRNaZJgAu-QrUVWSGD8JbPSWM.run(lambda)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:1950)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Handler.handleCallback(Handler.java:751)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Handler.dispatchMessage(Handler.java:95)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Looper.loop(Looper.java:154)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.app.ActivityThread.main(ActivityThread.java:6077)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at java.lang.reflect.Method.invoke(Native Method)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test |
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: test=loadUnknownProtocol
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: class=org.mozilla.geckoview.test.NavigationDelegateTest
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: stack=org.mozilla.geckoview.test.util.UiThreadUtils$TimeoutException: Timed out after 30000ms
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.util.UiThreadUtils$TimeoutRunnable.run(UiThreadUtils.java:58)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Handler.handleCallback(Handler.java:751)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Handler.dispatchMessage(Handler.java:95)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.util.UiThreadUtils.waitForCondition(UiThreadUtils.java:161)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.waitUntilCalled(GeckoSessionTestRule.java:1565)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.waitUntilCalled(GeckoSessionTestRule.java:1448)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.waitUntilCalled(GeckoSessionTestRule.java:1391)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.waitUntilCalled(GeckoSessionTestRule.java:1377)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.NavigationDelegateTest.testLoadEarlyErrorWithErrorPage(NavigationDelegateTest.kt:123)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.NavigationDelegateTest.testLoadEarlyError(NavigationDelegateTest.kt:137)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.NavigationDelegateTest.loadUnknownProtocol(NavigationDelegateTest.kt:205)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at java.lang.reflect.Method.invoke(Native Method)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.GeckoSessionTestRule$2.lambda$evaluate$0$GeckoSessionTestRule$2(GeckoSessionTestRule.java:1298)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at org.mozilla.geckoview.test.rule.-$$Lambda$GeckoSessionTestRule$2$sIbRNaZJgAu-QrUVWSGD8JbPSWM.run(lambda)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:1950)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Handler.handleCallback(Handler.java:751)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Handler.dispatchMessage(Handler.java:95)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.os.Looper.loop(Looper.java:154)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at android.app.ActivityThread.main(ActivityThread.java:6077)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at java.lang.reflect.Method.invoke(Native Method)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test |
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: current=292
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - org.mozilla.geckoview.test | INSTRUMENTATION_STATUS_CODE: -2
[task 2020-01-07T23:46:09.230Z] 23:46:09 WARNING - TEST-UNEXPECTED-FAIL | org.mozilla.geckoview.test.NavigationDelegateTest.loadUnknownProtocol | org.mozilla.geckoview.test.util.UiThreadUtils$TimeoutException: Timed out after 30000ms
[task 2020-01-07T23:46:09.230Z] 23:46:09 INFO - TEST-INFO took 30053ms
Comment 10•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Comment 11•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0de528fdfc4c
https://hg.mozilla.org/mozilla-central/rev/0a5c41c98d9b
https://hg.mozilla.org/mozilla-central/rev/447bc9d5d15a
https://hg.mozilla.org/mozilla-central/rev/0b1449f4dc1c
https://hg.mozilla.org/mozilla-central/rev/529e61c0f598
https://hg.mozilla.org/mozilla-central/rev/39c4e3bab99a
Description
•