Create NS_NewURIOnAnyThread

RESOLVED FIXED in Firefox 68

Status

()

enhancement
P2
normal
RESOLVED FIXED
3 months ago
2 months ago

People

(Reporter: valentin, Assigned: valentin)

Tracking

(Blocks 3 bugs)

60 Branch
mozilla68
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

(Whiteboard: [necko-triaged])

Attachments

(5 attachments)

This should avoid calling into any protocol handlers, since those can be JS implemented and not thread-safe.

The protocols that are left:

  • moz-gio - depends on prefs
  • moz-icon - calls IOService.newURI
  • view-source - calls NS_NewURI for inner part of the URI - we make it call NS_NewURIOnAnyThread
  • resource - extends SubstitutingProtocolHandler (substitution flags + jar)
  • moz-extension - extends SubstitutingProtocolHandler (substitution flags + jar)
  • jar - nsJARURI::SetSpecWithBase calls ioServ->NewURI
  • about - calls NS_GetAboutModule (can be JS implemented)

Apart from these there's nsExternalProtocolHandler::NewURI which simply instantiates a new nsSimpleURI, but we can't fall back to it if the above protocols aren't handled.

Attachment #9048581 - Attachment description: Bug 1532253 - Use nsIURI.prePath instead of manually computing it r=baku → Bug 1532253 - Use nsIURI.prePath instead of manually computing it r=baku!
Attachment #9048585 - Attachment description: Bug 1532253 - Add NS_NewURIOnAnyThread r=baku → Bug 1532253 - Add NS_NewURIOnAnyThread r=baku!

Comment 6

3 months ago
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5384779a3b1f
Add NS_NewURIOnAnyThread r=baku!
https://hg.mozilla.org/integration/mozilla-inbound/rev/0491d225285c
make BlobURL.mMutable be private r=baku
https://hg.mozilla.org/integration/mozilla-inbound/rev/8e10880ff30b
Add threadsafe BlobURLProtocolHandler::CreateNewURI r=baku
https://hg.mozilla.org/integration/mozilla-inbound/rev/498d0bcc8ce8
Use nsIURI.prePath instead of manually computing it r=baku!

Backed out 4 changesets (bug 1532253) for Windows bustage at Unified_cpp_netwerk_base2.i_o on a CLOSED TREE.

Backout link: https://hg.mozilla.org/integration/mozilla-inbound/rev/949fbfb190a2627fbbeb842ac90e2ad7ed96c038

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&resultStatus=testfailed%2Cbusted%2Cexception&revision=498d0bcc8ce8b5cc8c5f7b9af8ebda9136718e12&selectedJob=233093291

Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=233093291&repo=mozilla-inbound&lineNumber=14382

Log snippet:

13:06:05 INFO - mkdir -p '.deps/'
13:06:05 INFO - mozmake.EXE[5]: Leaving directory 'z:/build/build/src/obj-firefox/netwerk/cache'
13:06:05 INFO - mozmake.EXE[5]: Entering directory 'z:/build/build/src/obj-firefox/netwerk/cache'
13:06:05 INFO - netwerk/cache/Unified_cpp_netwerk_cache0.i_o
13:06:05 INFO - mozmake.EXE[5]: Leaving directory 'z:/build/build/src/obj-firefox/netwerk/cache'
13:06:06 INFO - mozmake.EXE[5]: Entering directory 'z:/build/build/src/obj-firefox/security/sandbox'
13:06:06 INFO - z:/build/build/src/clang/bin/clang.exe --driver-mode=cl -m32 -Fosandbox_rand.i_o -c -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -DNS_NO_XPCOM -D_CRT_RAND_S -DCHROMIUM_SANDBOX_BUILD -DSANDBOX_EXPORTS -Iz:/build/build/src/security/sandbox -Iz:/build/build/src/obj-firefox/security/sandbox -Iz:/build/build/src/security/sandbox/chromium-shim -Iz:/build/build/src/security/sandbox/chromium -Iz:/build/build/src/nsprpub -Iz:/build/build/src/obj-firefox/dist/include -Iz:/build/build/src/obj-firefox/dist/include/nspr -Iz:/build/build/src/obj-firefox/dist/include/nss -MD -FI z:/build/build/src/obj-firefox/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -guard:cf -Qunused-arguments -fcrash-diagnostics-dir=z:/build/public/build -TP -nologo -w15038 -wd5026 -wd5027 -Zc:sizedDealloc- -wd4091 -wd4577 -D_HAS_EXCEPTIONS=0 -guard:cf -W3 -Gy -Zc:inline -arch:SSE2 -Gw -wd4251 -wd4244 -wd4267 -wd4800 -wd4595 -wd4065 -Wno-inline-new-delete -Wno-invalid-offsetof -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -we4553 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Z7 -Xclang -load -Xclang z:/build/build/src/obj-firefox/build/clang-plugin/clang-plugin.dll -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -WX -wd4275 -wd4717 -wd4996 -wd4302 -wd4311 -wd4312 -fprofile-instr-generate -Xclang -MP -Xclang -dependency-file -Xclang .deps/sandbox_rand.i_o.pp -Xclang -MT -Xclang sandbox_rand.i_o z:/build/build/src/security/sandbox/chromium/sandbox/win/src/sandbox_rand.cc
13:06:06 INFO - mozmake.EXE[5]: Leaving directory 'z:/build/build/src/obj-firefox/security/sandbox'
13:06:06 INFO - mozmake.EXE[5]: Entering directory 'z:/build/build/src/obj-firefox/security/sandbox'
13:06:06 INFO - security/sandbox/sandbox_utils.i_o
13:06:06 INFO - mozmake.EXE[5]: Leaving directory 'z:/build/build/src/obj-firefox/security/sandbox'
13:06:07 INFO - mozmake.EXE[5]: Entering directory 'z:/build/build/src/obj-firefox/netwerk/base'
13:06:07 INFO - z:/build/build/src/clang/bin/clang.exe --driver-mode=cl -m32 -FoUnified_cpp_netwerk_base2.i_o -c -Iz:/build/build/src/obj-firefox/dist/stl_wrappers -DNDEBUG=1 -DTRIMMED=1 -DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DOS_WIN=1 -D_UNICODE -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DUNICODE -D_WINDOWS -D_SECURE_ATL -DCOMPILER_MSVC -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -Iz:/build/build/src/netwerk/base -Iz:/build/build/src/obj-firefox/netwerk/base -Iz:/build/build/src/obj-firefox/ipc/ipdl/_ipdlheaders -Iz:/build/build/src/ipc/chromium/src -Iz:/build/build/src/ipc/glue -Iz:/build/build/src/docshell/base -Iz:/build/build/src/dom/base -Iz:/build/build/src/netwerk/protocol/http -Iz:/build/build/src/netwerk/socket -Iz:/build/build/src/netwerk/url-classifier -Iz:/build/build/src/obj-firefox/dist/include -Iz:/build/build/src/obj-firefox/dist/include/nspr -Iz:/build/build/src/obj-firefox/dist/include/nss -MD -FI z:/build/build/src/obj-firefox/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -guard:cf -Qunused-arguments -fcrash-diagnostics-dir=z:/build/public/build -TP -nologo -w15038 -wd5026 -wd5027 -Zc:sizedDealloc- -wd4091 -wd4577 -D_HAS_EXCEPTIONS=0 -guard:cf -W3 -Gy -Zc:inline -arch:SSE2 -Gw -wd4251 -wd4244 -wd4267 -wd4800 -wd4595 -wd4065 -Wno-inline-new-delete -Wno-invalid-offsetof -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -we4553 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Z7 -Xclang -load -Xclang z:/build/build/src/obj-firefox/build/clang-plugin/clang-plugin.dll -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -WX -fprofile-instr-generate -Xclang -finstrument-functions-after-inlining -Xclang -MP -Xclang -dependency-file -Xclang .deps/Unified_cpp_netwerk_base2.i_o.pp -Xclang -MT -Xclang Unified_cpp_netwerk_base2.i_o z:/build/build/src/obj-firefox/netwerk/base/Unified_cpp_netwerk_base2.cpp
13:06:07 INFO - In file included from z:/build/build/src/obj-firefox/netwerk/base/Unified_cpp_netwerk_base2.cpp:128:
13:06:07 INFO - z:/build/build/src/netwerk/base/nsNetUtil.cpp(1719,20): error: use of undeclared identifier 'typeof'; did you mean 'typeid'?
13:06:07 INFO - TlsAutoIncrement<typeof(gTlsURLRecursionCount)> inc(gTlsURLRecursionCount);
13:06:07 INFO - ^
13:06:07 INFO - z:/build/build/src/netwerk/base/nsNetUtil.cpp(1720,7): error: use of undeclared identifier 'inc'
13:06:07 INFO - if (inc.value() >= MAX_RECURSION_COUNT) {
13:06:07 INFO - ^
13:06:07 INFO - 2 errors generated.
13:06:07 INFO - z:/build/build/src/config/rules.mk:805: recipe for target 'Unified_cpp_netwerk_base2.i_o' failed
13:06:07 INFO - mozmake.EXE[5]: *** [Unified_cpp_netwerk_base2.i_o] Error 1
13:06:07 INFO - mozmake.EXE[5]: Leaving directory 'z:/build/build/src/obj-firefox/netwerk/base'
13:06:07 INFO - mozmake.EXE[5]: *** Waiting for unfinished jobs....
13:06:07 INFO - mozmake.EXE[5]: Entering directory 'z:/build/build/src/obj-firefox/netwerk/cache2'
13:06:07 INFO - mkdir -p '.deps/'
13:06:07 INFO - mozmake.EXE[5]: Leaving directory 'z:/build/build/src/obj-firefox/netwerk/cache2'
13:06:07 INFO - mozmake.EXE[5]: Entering directory 'z:/build/build/src/obj-firefox/netwerk/cache2'
13:06:07 INFO - netwerk/cache2/AppCacheStorage.i_o

Flags: needinfo?(valentin.gosu)
Attachment #9048584 - Attachment description: Bug 1532253 - make BlobURL.mMutable be private r=baku → Bug 1532253 - make BlobURL.mMutable be private r=baku!

Comment 9

2 months ago
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/dbe9eae80e63
Add NS_NewURIOnAnyThread r=baku
https://hg.mozilla.org/integration/autoland/rev/6a37aed60cfb
make BlobURL.mMutable be private r=baku
https://hg.mozilla.org/integration/autoland/rev/26d06f8f1ca8
Add threadsafe BlobURLProtocolHandler::CreateNewURI r=baku
https://hg.mozilla.org/integration/autoland/rev/618267ebb6a4
Use nsIURI.prePath instead of manually computing it r=baku
https://hg.mozilla.org/integration/autoland/rev/3fef04ae16fd
Hold lock in mozilla::dom::IsType() r=baku
Assignee

Updated

2 months ago
Flags: needinfo?(valentin.gosu)
Assignee

Updated

2 months ago
Blocks: 1536744
You need to log in before you can comment on or make changes to this bug.