Closed Bug 1522705 Opened 9 months ago Closed 8 months ago

Add streaming download API for GeckoWebExecutor

Categories

(GeckoView :: General, enhancement, P1)

All
Android
enhancement

Tracking

(firefox-esr60 wontfix, firefox65 wontfix, firefox66 wontfix, firefox67 fixed)

RESOLVED FIXED
mozilla67
Tracking Status
firefox-esr60 --- wontfix
firefox65 --- wontfix
firefox66 --- wontfix
firefox67 --- fixed

People

(Reporter: cpeterson, Assigned: snorp)

References

(Blocks 1 open bug)

Details

(Whiteboard: [geckoview:fenix:p1])

Attachments

(2 files)

Instead of adding a GV API to get cookies for a download URL (bug 1476364), James suggests we add a streaming download API to the GeckoWebExecutor API.

We want to use Gecko's network stack, not Android download manager, where possible. Fenix would need to add a download service to keep the download notification alive if the user switches away from the app.

Is this a P1 release blocker for Fenix MVP?

A little discussion around how an implementation would look like: https://mozilla.logbot.info/mobile/20190128#c15889613-c15889753

TBD whether Fenix will want this streaming download API or the "get download URL's cookies so Fenix can pass them to the Android download manager" bug 1476364. IIUC, snorp strongly prefers this streaming download API so we're using Gecko's networking stack and certificate store.

https://github.com/mozilla-mobile/fenix/issues/214#issuecomment-461072064

Whiteboard: [geckoview:fenix:p1] → [geckoview:fenix:p1] [geckoview:fenix:m2]

Sebastian says Fenix MVP can integrate with the Android download manager (like the Reference Browser does), but without user cookies (bug 1476364). After 1.0, Fenix can use this streaming download API to create its own download manager.

Assigning to James because he said he was working on this.

Assignee: nobody → snorp

Moving out of the [geckoview:fenix:m2] milestone because Fenix MVP can integrate with the Android download manager. Still leaving as a [geckoview:fenix:p1] release blocker because James says Fenix needs this API for some other features.

Whiteboard: [geckoview:fenix:p1] [geckoview:fenix:m2] → [geckoview:fenix:p1]

This simply lets you request 'count' random bytes. A SHA-256 digest is
included for verifying the integrity of the response.

Pushed by jwillcox@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d116b3721569
Add /data/<count> path to HttpBinHandler r=geckoview-reviewers,esawin
https://hg.mozilla.org/integration/autoland/rev/194be6b55fc4
Add streaming response support to GeckoWebExecutor r=esawin,agi

Backed out 3 changesets (Bug 1526327, Bug 1522705) for WebExecutorSupport.cpp caused Android build bustages

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=229747488&searchStr=android&revision=11f1c1b18d2823dfcbc92b4272d7a9c1058e6ce1

Backout link: https://hg.mozilla.org/integration/autoland/rev/21e5e458085d7f1ef210e2d4873d9af6d7726ba8

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=229747488&repo=autoland&lineNumber=21903

[task 2019-02-21T22:51:27.260Z] 22:51:27 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/layout/build'
[task 2019-02-21T22:51:27.264Z] 22:51:27 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/xpfe/appshell'
[task 2019-02-21T22:51:27.264Z] 22:51:27 INFO - mkdir -p '.deps/'
[task 2019-02-21T22:51:27.264Z] 22:51:27 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/xpfe/appshell'
[task 2019-02-21T22:51:27.285Z] 22:51:27 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/xpfe/appshell'
[task 2019-02-21T22:51:27.285Z] 22:51:27 INFO - xpfe/appshell/Unified_cpp_xpfe_appshell0.o
[task 2019-02-21T22:51:27.286Z] 22:51:27 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/xpfe/appshell'
[task 2019-02-21T22:51:27.386Z] 22:51:27 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/docshell/base'
[task 2019-02-21T22:51:27.390Z] 22:51:27 INFO - /builds/worker/workspace/build/src/sccache2/sccache /builds/worker/workspace/build/src/clang/bin/clang++ --target=aarch64-linux-android -o Unified_cpp_docshell_base0.o -c -I/builds/worker/workspace/build/src/obj-firefox/dist/stl_wrappers -I/builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DDEBUG=1 -DOS_POSIX=1 -DOS_LINUX=1 -DMOZ_TOOLKIT_SEARCH -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/builds/worker/workspace/build/src/docshell/base -I/builds/worker/workspace/build/src/obj-firefox/docshell/base -I/builds/worker/workspace/build/src/obj-firefox/ipc/ipdl/ipdlheaders -I/builds/worker/workspace/build/src/ipc/chromium/src -I/builds/worker/workspace/build/src/ipc/glue -I/builds/worker/workspace/build/src/docshell/shistory -I/builds/worker/workspace/build/src/dom/base -I/builds/worker/workspace/build/src/dom/bindings -I/builds/worker/workspace/build/src/layout/base -I/builds/worker/workspace/build/src/layout/generic -I/builds/worker/workspace/build/src/layout/style -I/builds/worker/workspace/build/src/layout/xul -I/builds/worker/workspace/build/src/netwerk/base -I/builds/worker/workspace/build/src/netwerk/protocol/viewsource -I/builds/worker/workspace/build/src/toolkit/components/browser -I/builds/worker/workspace/build/src/toolkit/components/find -I/builds/worker/workspace/build/src/tools/profiler -I/builds/worker/workspace/build/src/obj-firefox/dist/include -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nspr -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-firefox/mozilla-config.h -Qunused-arguments -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include/aarch64-linux-android -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include -gcc-toolchain /builds/worker/workspace/build/src/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -D__ANDROID_API_=21 -fstack-protector-strong -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wc++1z-compat -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-sized-deallocation -fno-short-enums -fno-exceptions -I/builds/worker/workspace/build/src/android-ndk/sources/cxx-stl/llvm-libc++/include -I/builds/worker/workspace/build/src/android-ndk/sources/android/support/include -I/builds/worker/workspace/build/src/android-ndk/sources/cxx-stl/llvm-libc++abi/include -fstack-protector-strong -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pipe -g -Xclang -load -Xclang /builds/worker/workspace/build/src/obj-firefox/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -Oz -mno-outline -fno-omit-frame-pointer -funwind-tables -Werror -Wno-error=shadow -MD -MP -MF .deps/Unified_cpp_docshell_base0.o.pp /builds/worker/workspace/build/src/obj-firefox/docshell/base/Unified_cpp_docshell_base0.cpp
[task 2019-02-21T22:51:27.390Z] 22:51:27 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/docshell/base'
[task 2019-02-21T22:51:27.409Z] 22:51:27 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/extensions/universalchardet/src/base'
[task 2019-02-21T22:51:27.411Z] 22:51:27 INFO - mkdir -p '.deps/'
[task 2019-02-21T22:51:27.412Z] 22:51:27 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/extensions/universalchardet/src/base'
[task 2019-02-21T22:51:27.413Z] 22:51:27 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/extensions/universalchardet/src/base'
[task 2019-02-21T22:51:27.415Z] 22:51:27 INFO - extensions/universalchardet/src/base/Unified_cpp_src_base0.o
[task 2019-02-21T22:51:27.416Z] 22:51:27 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/extensions/universalchardet/src/base'
[task 2019-02-21T22:51:27.479Z] 22:51:27 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/widget/android'
[task 2019-02-21T22:51:27.487Z] 22:51:27 INFO - /builds/worker/workspace/build/src/sccache2/sccache /builds/worker/workspace/build/src/clang/bin/clang++ --target=aarch64-linux-android -o Unified_cpp_widget_android0.o -c -I/builds/worker/workspace/build/src/obj-firefox/dist/stl_wrappers -I/builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DDEBUG=1 -DOS_POSIX=1 -DOS_LINUX=1 -DMOZ_NATIVE_DEVICES -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/builds/worker/workspace/build/src/widget/android -I/builds/worker/workspace/build/src/obj-firefox/widget/android -I/builds/worker/workspace/build/src/obj-firefox/ipc/ipdl/ipdlheaders -I/builds/worker/workspace/build/src/ipc/chromium/src -I/builds/worker/workspace/build/src/ipc/glue -I/builds/worker/workspace/build/src/docshell/base -I/builds/worker/workspace/build/src/dom/base -I/builds/worker/workspace/build/src/dom/system/android -I/builds/worker/workspace/build/src/gfx/2d -I/builds/worker/workspace/build/src/gfx/vr -I/builds/worker/workspace/build/src/layout/painting -I/builds/worker/workspace/build/src/netwerk/base -I/builds/worker/workspace/build/src/netwerk/cache -I/builds/worker/workspace/build/src/widget -I/builds/worker/workspace/build/src/xpcom/threads -I/builds/worker/workspace/build/src/obj-firefox/dist/include -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nspr -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-firefox/mozilla-config.h -Qunused-arguments -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include/aarch64-linux-android -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include -gcc-toolchain /builds/worker/workspace/build/src/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -D__ANDROID_API_=21 -fstack-protector-strong -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wc++1z-compat -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-sized-deallocation -fno-short-enums -fno-exceptions -I/builds/worker/workspace/build/src/android-ndk/sources/cxx-stl/llvm-libc++/include -I/builds/worker/workspace/build/src/android-ndk/sources/android/support/include -I/builds/worker/workspace/build/src/android-ndk/sources/cxx-stl/llvm-libc++abi/include -fstack-protector-strong -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pipe -g -Xclang -load -Xclang /builds/worker/workspace/build/src/obj-firefox/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -Oz -mno-outline -fno-omit-frame-pointer -funwind-tables -Werror -Wno-error=shadow -MD -MP -MF .deps/Unified_cpp_widget_android0.o.pp /builds/worker/workspace/build/src/obj-firefox/widget/android/Unified_cpp_widget_android0.cpp
[task 2019-02-21T22:51:27.489Z] 22:51:27 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/widget/android/Unified_cpp_widget_android0.cpp:92:
[task 2019-02-21T22:51:27.491Z] 22:51:27 ERROR - /builds/worker/workspace/build/src/widget/android/WebExecutorSupport.cpp:147:3: error: bad implicit conversion constructor for 'StreamSupport'
[task 2019-02-21T22:51:27.492Z] 22:51:27 INFO - StreamSupport(nsIRequest* aRequest) : mRequest(aRequest) {}
[task 2019-02-21T22:51:27.493Z] 22:51:27 INFO - ^
[task 2019-02-21T22:51:27.494Z] 22:51:27 INFO - /builds/worker/workspace/build/src/widget/android/WebExecutorSupport.cpp:147:3: note: consider adding the explicit keyword to the constructor
[task 2019-02-21T22:51:27.495Z] 22:51:27 INFO - StreamSupport(nsIRequest* aRequest) : mRequest(aRequest) {}
[task 2019-02-21T22:51:27.496Z] 22:51:27 INFO - ^
[task 2019-02-21T22:51:27.497Z] 22:51:27 INFO - explicit
[task 2019-02-21T22:51:27.498Z] 22:51:27 INFO - 1 error generated.
[task 2019-02-21T22:51:27.499Z] 22:51:27 INFO - /builds/worker/workspace/build/src/config/rules.mk:805: recipe for target 'Unified_cpp_widget_android0.o' failed
[task 2019-02-21T22:51:27.500Z] 22:51:27 ERROR - make[4]: *** [Unified_cpp_widget_android0.o] Error 1
[task 2019-02-21T22:51:27.501Z] 22:51:27 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/widget/android'
[task 2019-02-21T22:51:27.503Z] 22:51:27 INFO - make[4]: *** Waiting for unfinished jobs....
[task 2019-02-21T22:51:27.508Z] 22:51:27 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/extensions/universalchardet/src/xpcom'
[task 2019-02-21T22:51:27.509Z] 22:51:27 INFO - mkdir -p '.deps/'

Flags: needinfo?(snorp)

Very strange that I don't get that error locally...

Flags: needinfo?(snorp)
Pushed by jwillcox@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/69196a59302d
Add /data/<count> path to HttpBinHandler r=geckoview-reviewers,esawin
https://hg.mozilla.org/integration/autoland/rev/fd8e8a3cbfac
Add streaming response support to GeckoWebExecutor r=esawin,agi
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
See Also: → 1530069
You need to log in before you can comment on or make changes to this bug.