Граф коммитов

79 Коммитов

Автор SHA1 Сообщение Дата
Nika Layzell 7eef772214 Bug 1773088 - Part 2: Stop requiring an actor to serialize StructuredCloneData over IPC, r=asuth
This is largely a straightforward find and replace of various methods, with the
unnecessary arguments removed and compiler errors fixed.

Differential Revision: https://phabricator.services.mozilla.com/D148532
2022-06-08 15:24:27 +00:00
Molnar Sandor 4fd6d28fda Backed out 4 changesets (bug 1715547) for causing leakcheck failures in ServiceWorkerPrivate. CLOSED TREE
Backed out changeset c2114b608577 (bug 1715547)
Backed out changeset c8985e7c6a71 (bug 1715547)
Backed out changeset 8af1f4a4be08 (bug 1715547)
Backed out changeset 85b20f601145 (bug 1715547)
2022-05-17 02:27:10 +03:00
Eden Chuang 2b97dacb22 Bug 1715547 - Remove ServiceWorkerContainer::Inner r=dom-worker-reviewers,asuth
Depends on D117344

Differential Revision: https://phabricator.services.mozilla.com/D138999
2022-05-16 22:52:23 +00:00
Kagami Sascha Rosylight 7f86063f8d Bug 1768189 - Part 28: Apply modernize-concat-nested-namespaces to dom/serviceworkers/ServiceWorkerCloneData.cpp ... r=andi
Depends on D145761

Differential Revision: https://phabricator.services.mozilla.com/D145762
2022-05-09 20:41:14 +00:00
Tim Huang e3e09e1fdf Bug 1731999 - Part 3: Enable partitioned service workers. r=pbz
This patch enables partitioned service workers in third-party contexts.
Doesn't like before, we will allow service workers to be registered even
the third-party contexts don't have storage access and the registered
service workers will be partitioned by the top-level site.

You can control this by using the pref 'privacy.partition.serviceWorkers'.
Setting this to true will enable the partitioning, otherwise, it will
still use the old behavior.

Differential Revision: https://phabricator.services.mozilla.com/D131788
2021-11-30 13:40:31 +00:00
Tim Huang bf00e6e2cf Bug 1731999 - Part 2: Use regular principal for service workers if pref 'privacy.partition.serviceWorkers' is false. r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D131787
2021-11-30 13:40:31 +00:00
Tim Huang bdeaf4cf23 Bug 1731990 - Part 2: Using foreignPartitionedPrincipal in ServiceWorkerContainer. r=asuth
The patch modifies ServiceWorkerContainer::GetScopeForUrl() to use the
foreign partitioned principal.

Differential Revision: https://phabricator.services.mozilla.com/D128732
2021-11-25 13:11:34 +00:00
Yaron Tausky dde1fe54eb Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D101632
2021-06-08 21:02:54 +00:00
Alexis Beingessner 719dd81cbb Bug 1686616 - make ServiceWorkerManager use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105527
2021-02-18 13:26:31 +00:00
Simon Giesecke 330a65a7de Bug 1692996 - Remove redundant nullptr checks of return value of infallible new in dom/serviceworkers. r=dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D105289
2021-02-16 15:52:09 +00:00
Emilio Cobos Álvarez 635e3580e3 Bug 1655967 - Move serviceWorkersTestingEnabled to BrowsingContext. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D103757
2021-02-03 10:38:43 +00:00
Luca Greco c87982167d Bug 1609920 - part 2: Guard ServiceWorkerContainer::Register to allow/disallow moz-extension scheme based on prefs. r=dom-workers-and-storage-reviewers,asuth,webidl,smaug
- Adds a new "extensions.serviceWorkerRegister.allowed" pref (defaults to false)
- Makes ServiceWorkerContainer::Register to throw NS_ERROR_DOM_SECURITY_ERR if the
  script url is a moz-extension url and the caller is a non-system caller
  (but do not throw NS_ERROR_DOM_SECURITY_ERR if the caller is a moz-extension
  and the new pref is set to true)

Depends on D60244

Differential Revision: https://phabricator.services.mozilla.com/D60245
2020-07-03 10:14:42 +00:00
Sebastian Hengst 255c22186f Backed out 4 changesets (bug 1609920) for leaks in browser-chrome. CLOSED TREE
Backed out changeset 1c8faab05606 (bug 1609920)
Backed out changeset eaa0bb2cf36b (bug 1609920)
Backed out changeset fd1e4db7cf78 (bug 1609920)
Backed out changeset 0e68db4ad6af (bug 1609920)
2020-07-01 17:10:13 +02:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Luca Greco ac67fbe999 Bug 1609920 - part 2: Guard ServiceWorkerContainer::Register to allow/disallow moz-extension scheme based on prefs. r=dom-workers-and-storage-reviewers,asuth,webidl,smaug
- Adds a new "extensions.serviceWorkerRegister.allowed" pref (defaults to false)
- Makes ServiceWorkerContainer::Register to throw NS_ERROR_DOM_SECURITY_ERR if the
  script url is a moz-extension url and the caller is a non-system caller
  (but do not throw NS_ERROR_DOM_SECURITY_ERR if the caller is a moz-extension
  and the new pref is set to true)

Depends on D60244

Differential Revision: https://phabricator.services.mozilla.com/D60245
2020-06-30 20:40:53 +00:00
ssengupta cf852bbfb9 Bug 1635399 - Function PrincipalInfoToPrincipal now returns Result<nsCOMPtr<nsIPrincipal>, nsresult> r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D73868
2020-05-12 19:02:05 +00:00
Andreas Farre 25ca8d7890 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
TabGroup never really made any difference in which thread something go
dispatched to. This was the intended use, but development of TabGroups
with abstract main threads never made it that far. The good thing is
that thish makes it safe to also remove to the SystemGroup and instead
switch all SystemGroup dispatches to dispatches to main thread.

Timers for setTimeout and workers were the sole users of wrapped and
throttled event targets, that those throttled queues have been moved
to the BrowsingContextGroup and are now accessed explicitly.

The SchedulerEventTarget has been removed, since there are no longer a
separate event target for every TaskCategory. Instead a
LabellingEventTarget has been added to DocGroup to handle the case
where an event is dispatched do DocGroup or when an AbstractThread is
created using a DocGroup. This means that we'll actually label more
events correctly with the DocGroup that they belong to.

DocGroups have also been moved to BrowsingContextGroup.

Depends on D67636

Differential Revision: https://phabricator.services.mozilla.com/D65936

--HG--
extra : moz-landing-system : lando
2020-04-07 15:17:47 +00:00
Boris Zbarsky 00cd5d4380 Bug 1619112 part 5. Stop accepting nsAString in ErrorResult error-throwing. r=smaug
Callers should pass in UTF-8, since that's what the JS engine ends up with in the end anyway.

The various URL changes are because NS_NewURI converts incoming nsAString to
UTF-8 anyway.  So we might as well do that up-front and then use the UTF-8
string for both the NS_NewURI call and the error-reporting if it fails.

Differential Revision: https://phabricator.services.mozilla.com/D65543

--HG--
extra : moz-landing-system : lando
2020-03-06 21:08:02 +00:00
Tom Tung 2577a8c2b7 Bug 1613900 - P3 - ServiceWorker should treat all failures after deserializing as deserialization failures; r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D62881

--HG--
extra : moz-landing-system : lando
2020-02-14 21:23:28 +00:00
Boris Zbarsky 6c66fa85a4 Bug 1615022 part 2. Require an rvalue reference to reject a Promise with an ErrorResult. r=farre,kvark
The rejection process consumes the ErrorResult, so an rvalue reference is the honest thing here.

Differential Revision: https://phabricator.services.mozilla.com/D62632

--HG--
extra : moz-landing-system : lando
2020-02-14 15:42:30 +00:00
Simon Giesecke b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
shindli 91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Boris Zbarsky 7472066554 Bug 1613571. Align service worker invalid-script-url and invalid-scope-url checks better with the spec. r=dom-workers-and-storage-reviewers,perry
Behavior changes:

1) We now throw a TypeError, not a SecurityError, when the script URI scheme is
not 'http' or 'https', like the spec says to.

2) We now throw when the scope URI scheme is not 'http' or 'https', like the
spec says to.

3) We now throw a proper TypeError, not a DOMException, at the end of
CheckForSlashEscapedCharsInPath.

4) More informative error messages.

Differential Revision: https://phabricator.services.mozilla.com/D61782

--HG--
extra : moz-landing-system : lando
2020-02-06 19:56:31 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Boris Zbarsky 75124bdd98 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067

--HG--
extra : moz-landing-system : lando
2019-12-05 04:44:32 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Nicholas Nethercote 18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Boris Zbarsky d5a8a4a595 Bug 1557793 part 3. Change the signatures of various nsContentUtils localization methods to play nicer with the new stringbundle API. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D34201

--HG--
extra : moz-landing-system : lando
2019-06-08 21:26:12 +00:00
Ehsan Akhgari 98960a9c41 Bug 1554361 - Move the high-level storage access check APIs to mozilla/StorageAccess.h; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D32556

--HG--
extra : moz-landing-system : lando
2019-05-27 14:06:49 +00:00
Johann Hofmann 6e3969226a Bug 1524619 - Part 5 - Propagate user interaction through APIs that return ServiceWorkerRegistrations. r=Ehsan
This is done to support requiring user interaction when calling PushManager.subscribe().
Because PushManager must usually be accessed with async APIs, this makes for a better
developer experience and should reduce breakage.

Differential Revision: https://phabricator.services.mozilla.com/D23970

--HG--
extra : rebase_source : 047b28e99d80e1adfe14aaea99bc56800dc4281b
2019-03-19 00:13:36 +01:00
Ryan Hunt 00e98538aa Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21106

--HG--
extra : rebase_source : ea3f51c2c11247114deccbc86e90fb02b8a97257
2019-02-25 16:05:29 -06:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Perry Jiang 0516414da1 Bug 1399446 - implement ServiceWorkerGlobalScope and ServiceWorkerContainer onmessageerror event handlers r=edenchuang,baku
Differential Revision: https://phabricator.services.mozilla.com/D5213

--HG--
extra : moz-landing-system : lando
2018-10-22 21:22:25 +00:00
Yaron Tausky f6f1bde06f Bug 1263734: Implement ServiceWorkerContainer.startMessages() r=asuth,smaug
Differential Revision: https://phabricator.services.mozilla.com/D4237

--HG--
extra : moz-landing-system : lando
2018-10-11 12:37:37 +00:00
Dorel Luca 14654707e6 Backed out changeset 2c01f22661fa (bug 1263734) for wpt failures in fetch/api/request/destination/fetch-destination-no-load-event.https.html. CLOSED TREE 2018-10-10 18:31:01 +03:00
Yaron Tausky 286a3c2333 Bug 1263734: Implement ServiceWorkerContainer.startMessages() r=asuth,smaug
Differential Revision: https://phabricator.services.mozilla.com/D4237

--HG--
extra : moz-landing-system : lando
2018-10-10 13:55:23 +00:00
Steve Fink 1554c31d8c Bug 1487167 - Various DOM rooting issues. r=bz
--HG--
extra : amend_source : dc5bf09193860ac7a3f01071132284ed10423e97
2018-08-28 21:26:50 -07:00
Andrea Marchesini 7cef10ddb5 Bug 1489844 - Port DOMPrefs to StaticPrefs - part 9 - dom.serviceWorkers.testing.enabled, r=ehsan 2018-09-10 20:36:16 +02:00
Andrea Marchesini 70d8e635cf Bug 1489844 - Port DOMPrefs to StaticPrefs - part 8 - dom.serviceWorkers.enabled, r=ehsan 2018-09-10 20:36:15 +02:00
Yaron Tausky 7d9fd70298 Bug 1455078: Implement [SecureContext] for ServiceWorkerContainer r=asuth
The spec mandates that ServiceWorkerContainer only be visible in a secure context,
yet currently it is (almost) always visible, but rejects calls to register() in
non-secure contexts. This commit moves the context check to a [Func] function, thus
implementing the behavior exactly as specified.

This commit uses the same mechanism used by [SecureContext] bindings instead of the
current ad hoc implementation.

Differential Revision: https://phabricator.services.mozilla.com/D2950

--HG--
extra : moz-landing-system : lando
2018-08-22 15:22:40 +00:00
Valentin Gosu 7937c7c4cc Bug 1476928 - Remove nsIURI.CloneIgnoringRef and nsIURI.CloneWithNewRef r=JuniorHsu
The patch introduces NS_GetURIWithNewRef and NS_GetURIWithNewRef which perform the same function.

Differential Revision: https://phabricator.services.mozilla.com/D2239

--HG--
extra : moz-landing-system : lando
2018-07-23 11:28:47 +00:00
Ben Kelly 9797d85bc5 Bug 1459209 P3 Scaffold RemoteServiceWorkerContainerImpl to connect the binding ServiceWorkerContainer to the PServiceWorkerContainerChild actor. r=mrbkap
--HG--
extra : rebase_source : b0a51ce7bbc1b9b27531584d0647ae28d56b15e2
2018-07-09 16:02:39 -07:00
Ben Kelly 09c855d41b Bug 1459209 P2 Scaffold RemoteServiceWorkerImpl to connect the binding ServiceWorker to the PServiceWorkerChild actor. r=mrbkap
--HG--
extra : rebase_source : 07ec45d8d019e708be144464302168ce331518e9
2018-07-09 16:02:39 -07:00
Ben Kelly d2e065fc4e Bug 1472005 Don't resolve ready promise until the registration has reached the right state version. r=mrbkap 2018-07-05 13:13:48 -04:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00