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

270 Коммитов

Автор SHA1 Сообщение Дата
Andrea Marchesini 45087a7970 Bug 1269154 - Get rid of WorkerFeature: WorkerHolder, r=khuey
--HG--
rename : dom/cache/Feature.cpp => dom/cache/CacheWorkerHolder.cpp
rename : dom/cache/Feature.h => dom/cache/CacheWorkerHolder.h
rename : dom/workers/WorkerFeature.h => dom/workers/WorkerHolder.h
2016-06-22 17:24:35 +02:00
Jonas Sicking 32162d33c2 Bug 1273279 - Changes in preparation for FlyWeb landing. Change InternalResponse handling to track body size. r=baku f=bkelly
--HG--
extra : amend_source : 257331b8f4b86d6e1c7608ca6866526ce6aa645a
2016-06-01 17:02:29 -04:00
Carsten "Tomcat" Book 927b1a0b3a Backed out changeset 7469725d7461 (bug 959388) 2016-05-23 11:36:12 +02:00
Thomas Nguyen 32e38271c9 Bug 959388 - Deliver CSP from HTTP header. r=ckerschb r=khuey
MozReview-Commit-ID: LUl5LyO94m3

--HG--
extra : rebase_source : f2ddfcbf6237b11ebb19adfabf346cf76f4a6ab8
2016-05-19 11:57:32 +08:00
Trevor Saunders a868a5867f bug 1271436 - use do_GetInterface() a little less r=smaug 2016-05-17 18:16:07 -04:00
Boris Zbarsky 0a8135300a Bug 1270783. If we end up erroring out of a worker main-script load before we get to creating a global for the worker, don't try to enter that global's compartment to throw an exception. Just squelch it instead. r=khuey 2016-05-13 20:09:50 -04:00
Stone Shih d9f82778f9 Bug 482388 - Use default url encoding to create channel when creating child workers or importing scripts in a worker. r=khuey
--HG--
extra : rebase_source : 78b0ddd725205028c6dc4c193cbbce0e0a628d77
2016-04-28 15:44:08 +08:00
Kyle Huey 941ab1f522 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Andrea Marchesini 0fdab8e9ee Bug 1268230 - RunTime.cpp and ScriptLoader do not have to use MainThreadStopSyncLoopRunnable, r=khuey 2016-05-03 10:21:57 +02:00
Carsten "Tomcat" Book ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Kyle Huey 48a594a09e Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
Kyle Huey c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
Olli Pettay cc6d1d9827 Bug 1257096, don't try to report about unusual unhandled rejected Promises, r=bz,waldo
--HG--
extra : rebase_source : a53d6853feeae3c54f307cef71edcdba4f771803
2016-04-20 02:29:21 +03:00
Kyle Huey 1cc02aa8c6 Bug 1263311: Part 1 - Change the nsICancelableRunnable interface. r=froydnj 2016-04-11 11:40:06 -07:00
Wes Kocher 7d2cebe912 Backed out 3 changesets (bug 1263311) for Windows build failures in ServiceWorkerPrivate.cpp CLOSED TREE
Backed out changeset 0434a548e1fe (bug 1263311)
Backed out changeset 60b1be29446c (bug 1263311)
Backed out changeset 18132498bc40 (bug 1263311)

MozReview-Commit-ID: LPEa05QobdQ
2016-04-11 12:50:56 -07:00
Kyle Huey f13a6fc866 Bug 1263311: Part 1 - Change the nsICancelableRunnable interface. r=froydnj 2016-04-11 11:40:06 -07:00
Kyle Huey d9265a3eaf Bug 1259294: Part 2 - Use MOZ_ALWAYS_SUCCEEDS. r=froydnj 2016-03-28 10:28:15 -07:00
Kyle Huey fe5f7b4105 Bug 1259290: Part 5 - Remove the cx from WorkerFeature::Notify. r=bz 2016-03-28 10:28:14 -07:00
Kyle Huey 2b94386d24 Bug 1259290: Part 4 - Remove JS_ReportError for a situation that can never happen. r=bz 2016-03-28 10:28:14 -07:00
Boris Zbarsky e3b2de6aa9 Bug 1255817 part 2. Get rid of AutoJSAPI::OwnsErrorReporting and AutoJSAPI::TakeOwnershipOfErrorReporting. r=bholley 2016-03-23 11:44:54 -04:00
Ben Kelly cbc3ebad39 Bug 1253793 Update ScriptLoader assertion to handle cancelation case. r=khuey 2016-03-22 13:22:15 -07:00
Eddy Bruel 6894a80365 Bug 1047663 - Disabling the cache in a tab should also disable it for all workers in that tab;r=khuey 2016-03-17 11:03:05 +01:00
Kyle Huey d11b9db617 Bug 1257032: Make files in dom/workers actually build without unification. r=baku 2016-03-16 11:51:11 -07:00
Ehsan Akhgari 38637e2005 Bug 1251872 - Part 1: Implement Request.referrerPolicy; r=jdm 2016-03-03 16:43:55 -05:00
Boris Zbarsky 9679610dbb Bug 1072144 part 4. Add a WorkerRunnable::PreRun so that we can move worker global creation to it and always have an AutoEntryScript by the time we're evaluating the main worker script. r=khuey 2016-03-01 16:52:26 -05:00
Wes Kocher af73c13ee2 Backed out 6 changesets (bug 1072144) for test_recursion.html failures
Backed out changeset ac15fe0e71fd (bug 1072144)
Backed out changeset b666d48a267d (bug 1072144)
Backed out changeset 0f0464ef08ed (bug 1072144)
Backed out changeset 7ba5f3b95022 (bug 1072144)
Backed out changeset 1912f838fcaa (bug 1072144)
Backed out changeset 145c9bb59b97 (bug 1072144)

MozReview-Commit-ID: 7cl4RtpHSfl
2016-03-01 15:41:24 -08:00
Boris Zbarsky de208d989a Bug 1072144 part 4. Add a WorkerRunnable::PreRun so that we can move worker global creation to it and always have an AutoEntryScript by the time we're evaluating the main worker script. r=khuey 2016-03-01 16:52:26 -05:00
Boris Zbarsky 2a1057f5b2 Bug 1252221. When GetOrCreateGlobalScope fails while trying to run a ScriptExecutorRunnable::WorkerRun, just suppress the exception, because there is no way to report it without a compartment to work with. r=khuey 2016-03-01 13:49:21 -05:00
Boris Zbarsky 69924c14ce Bug 1252123. Remove some unnecessary JSContext arguments from worker ScriptLoader methods. r=khuey 2016-02-29 14:52:42 -05:00
Boris Zbarsky 663b9bd562 Bug 1252091. Add/RemoveFeature don't need a JSContext argument. r=khuey 2016-02-29 14:52:42 -05:00
Boris Zbarsky 7413f2bf46 Bug 1251369. Use an AutoJSAPI that reports its own exceptions around the main runloop in workers. r=khuey
The silly leading ": " on the error messages is due to bug 1251518.
2016-02-26 15:23:13 -05:00
Boris Zbarsky 7345c5edb1 Bug 1251045 part 4. Remove the JSContext argument of WorkerRunnable::Dispatch. r=khuey 2016-02-26 15:23:12 -05:00
Boris Zbarsky 44f8a852c3 Bug 1249673. Muted errors should be turned into NetworkError DOMExceptions when returning from importScripts on workers, instead of becoming NS_ERROR_FAILURE. r=baku 2016-02-24 10:38:31 -05:00
Boris Zbarsky bb7c756f0e Bug 1249652 part 3. Simplify way we handle canceling when ScriptLoaderRunnable::RunInternal fails by canceling things with its actual failure code, so we don't have to guess which failed loads are actual failures and which are just canceled via this mechanism. r=baku,khuey
There is a bit of subtlety here with NS_BINDING_ABORTED.  Before these changes,
we would land in ReportLoadError, not do anything with NS_BINDING_ABORTED, and
just return.  If called from WorkerPrivate::Constructor we'd then go ahead and
throw it on the ErrorResult, but I'm pretty sure we never ended up with
NS_BINDING_ABORTED there.  If called from ScriptExecutorRunnable::WorkerRun, we
would proceed on to ScriptExecutorRunnable::PostRun and hence
ShutdownScriptLoader where we would throw on the ErrorResult but NOT on the
JSContext.  Then we would unwind to our consumer and if that consumer was a
toplevel script load we would suppress the exception on the ErrorResult.
Otherwise we'd go ahead and throw the exception we ended up with to the caller.

The upshot is that we used to not fire error events on a worker whose main
script load was canceled with NS_BINDING_ABORTED.  So we try to preserve that
behavior explicitly for toplevel scripts.
2016-02-24 10:38:31 -05:00
Boris Zbarsky 2ac6ce9202 Bug 1249652 part 2. ScriptExecutorRunnable::WorkerRun should immediately move JS exceptions to its ErrorResult instead of allowing them to linger on the JSContext. r=baku,khuey 2016-02-24 10:38:31 -05:00
Boris Zbarsky 8b630a7187 Bug 1249351 part 1. When doing importScripts of multiple scripts in a service worker, make sure to track the cache streams per-loadinfo, instead of trying to make them all wait on the same stream. r=bkelly 2016-02-22 17:13:38 -05:00
Chris Peterson c824bef9fe Bug 1240265 - Annotate intentional switch fallthroughs in dom/. r=mrbkap
dom/base/Element.cpp:2920:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/base/Element.cpp:2935:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/base/nsDocument.cpp:6595:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/base/nsDocument.cpp:7631:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/base/nsDocument.cpp:7922:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/base/nsGlobalWindow.cpp:7573:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/base/nsXMLContentSerializer.cpp:1393:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/cache/AutoUtils.cpp:487:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/html/HTMLInputElement.cpp:3808:15 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/html/HTMLInputElement.cpp:3836:15 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/storage/DOMStorageDBThread.cpp:224:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/workers/ScriptLoader.cpp:1994:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels

--HG--
extra : rebase_source : ba9bd93b2c65e2db05b26e7b4c203dd7710516f3
2015-11-25 23:26:32 -08:00
Ben Kelly 1d9e5fddae Bug 1233171 Cancel channel when ScriptLoader is aborted during service worker script load. r=khuey 2015-12-17 10:11:26 -05:00
Ben Kelly 3e447dafea Bug 1229970 Abort script loading start requests if a load has been canceled. r=khuey 2015-12-09 18:21:00 -05:00
Andrea Marchesini bae9fd5f6c Bug 1229071 - importScripts should throw the correct error result in case the loading of one of scripts fails, r=bz 2015-12-02 13:02:58 +00:00
Andrea Marchesini fe6be4c172 Bug 1218433 - Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 1, r=sicking 2015-11-16 22:41:03 +00:00
Wes Kocher 9d1f194cbb Backed out 2 changesets (bug 1218433) for wpt failures CLOSED TREE
Backed out changeset 1cc8cc0444c0 (bug 1218433)
Backed out changeset 5418ca0e0378 (bug 1218433)

--HG--
extra : commitid : H1h8VHrzxx8
2015-11-16 11:13:43 -08:00
Andrea Marchesini d35be12a6d Bug 1218433 - Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 1, r=sicking 2015-11-16 16:57:29 +00:00
Sebastian Hengst a0cf7d50ad Backed out 2 changesets (22360424ed15, 325a67608df0) (bug 1218433) for W(1,2) failures. r=backout on a CLOSED TREE
Backed out changeset 22360424ed15 (bug 1218433)
Backed out changeset 325a67608df0 (bug 1218433)
2015-11-15 15:56:45 +01:00
Andrea Marchesini 9137d7e47b Bug 1218433 - Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 1, r=sicking 2015-11-15 11:57:06 +00:00
Jonas Sicking 27c89ea082 Bug 1223647: CSP erroneously inherited into dedicated workers. r=ckerschb
--HG--
rename : dom/workers/test/serviceworkers/test_eval_not_allowed.html^headers^ => dom/workers/test/serviceworkers/test_eval_allowed.html^headers^
2015-11-10 21:16:12 -08:00
Sebastian Hengst c7cc4bc5c8 Backed out changesets 5a3092c456c0,8dcbfd14f1e5 (bug 1218433) for M3, W3 failures and M10 failure on Android. r=backout
* * *
Backed out changeset 8dcbfd14f1e5 (bug 1218433)


462 INFO TEST-UNEXPECTED-FAIL | dom/security/test/csp/test_child-src_worker-redirect.html | CSP child-src worker test other-src-worker_redir-same - got "Error: Failed to load script (nsresult = 0x805e0006)", expected "blocked"
479 INFO TEST-UNEXPECTED-FAIL | dom/security/test/csp/test_child-src_worker.html | Test timed out.
486 INFO TEST-UNEXPECTED-FAIL | dom/security/test/csp/test_child-src_worker_data.html | Test timed out.
2015-11-12 18:44:51 +01:00
Andrea Marchesini f55a08e614 Bug 1218433 - Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 1, r=sicking 2015-11-12 14:51:17 +00:00
Wes Kocher 2e6d1e7dfb Backed out changeset d12f758f5f36 (bug 1223647) for android csp test failures
--HG--
extra : commitid : GRTvvKDy9Ki
2015-11-11 14:27:52 -08:00
Jonas Sicking ea6cf63b0f Bug 1223647: CSP erroneously inherited into dedicated workers. r=ckerschb 2015-11-10 21:16:12 -08:00
Wes Kocher 9e8bd5977f Backed out 2 changesets (bug 1218433) for android CSP test failures in m(10) CLOSED TREE
Backed out changeset 50af9a9ba6d9 (bug 1218433)
Backed out changeset 5d8b8744419f (bug 1218433)

--HG--
extra : commitid : 625lyUcSwAk
2015-11-11 10:22:08 -08:00
Andrea Marchesini 934e4c3ba4 Bug 1218433 - Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 1, r=sicking 2015-11-11 16:59:46 +00:00
Phil Ringnalda b98d58e46d Back out changeset 4d6d9c1e52e4 (bug 1223647) for failures in test_csp.html, csp/test_redirects.html and csp/test_worker_redirect.html
--HG--
extra : rebase_source : a4a53053968cfa19e6544dd3e59e36ef23fcf353
2015-11-10 23:10:04 -08:00
Jonas Sicking 426e42e7f9 Bug 1223647: CSP erroneously inherited into dedicated workers. r=ckerschb 2015-11-10 21:16:12 -08:00
Andrea Marchesini 24cd451d65 Bug 1211967 - Fix how we report errors when loading a worker from a data url, r=bz 2015-10-26 17:28:45 +00:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Andrea Marchesini f93604eafb Bug 1211970 - "Muted errors in workers are not correctly reported to the console". r=bz 2015-10-15 05:05:00 +02:00
Andrea Marchesini ef38daea39 Bug 1160890, r=smaug 2015-10-15 14:06:55 +02:00
Ben Kelly 323efab6af Bug 1210941 P11 Use LOAD_BYPASS_SERVICE_WORKER in worker ScriptLoader. r=ehsan 2015-10-06 06:37:07 -07:00
Ehsan Akhgari 59c135c176 Bug 1198078 - Add support for TYPE_INTERNAL_SERVICE_WORKER; r=ckerschb,tanvi 2015-09-16 19:15:30 -04:00
Kyle Huey d4f49ff9e9 Bug 1198982: Don't fail the SW load for an importScripts failure. r=bkelly 2015-08-30 10:31:52 -07:00
Phil Ringnalda 700dfcd3d1 Back out f9edb5fe8fb9 (bug 1198982) for webplatform registration.https.html failures
CLOSED TREE
2015-08-26 21:36:40 -07:00
Kyle Huey 517ebc93c6 Bug 1198982: Don't fail the SW load for an importScripts failure. r=bkelly 2015-08-26 19:21:03 -07:00
Nikhil Marathe b5681e95be Bug 1193911 - Ensure synthetic Responses gets a valid channel info. r=ehsan
Right now, synthetic Responses did not have a valid channel info. When these
were saved in the Cache, and then restored, the restored Response did have
a ChannelInfo, but that ChannelInfo did not have a valid security info.
Passing this to respondWith() then caused the interception to fail.

This patch modifies Response::Constructor() to initialize its ChannelInfo from
the global. ChannelInfo can now initialize itself from a nsIDocument. All
workers now store their ChannelInfo on the WorkerLoadInfo.

--HG--
extra : commitid : L1wltwPICd8
extra : rebase_source : 8dab4c414eb50e02a00dd2cb3ee848b811060e70
2015-08-17 15:08:58 -07:00
Andrew McCreight 621e57b2b7 Bug 1176341 - De-holder nsIXPConnect::CreateSandbox. r=baku,gabor 2015-07-21 11:31:44 -07:00
Ryan VanderMeulen fb3e0b058e Backed out changeset 553a3e1e7b18 (bug 1176341) for bustage.
CLOSED TREE
2015-07-21 13:00:55 -04:00
Andrew McCreight 5cbc3abf39 Bug 1176341 - De-holder nsIXPConnect::CreateSandbox. r=baku,gabor 2015-07-21 09:44:37 -07:00
Ben Kelly 55e3066722 Bug 1181887 Fall back to network if ServiceWorker script fails to load. r=ehsan r=khuey 2015-07-15 12:21:40 -07:00
Andrea Marchesini 804881c9a1 Bug 1160890 - Part 2: ImportScripts() should return muted errors with 3rd party scripts. r=smaug 2015-07-14 16:08:38 +01:00
Andrea Marchesini 6aa2608c1c Bug 1160890 - Part 1: Remove unneeded code from ImportScripts(). r=smaug 2015-07-14 16:08:36 +01:00
Michael Layzell 562c0a00bc Bug 1181321 - Eliminate duplicate mRefCnt members in PromiseNativeHandler subclasses. r=baku
--HG--
extra : rebase_source : 64348ca27d2f70dc116856dd4f9271e1fb63a467
2015-07-09 08:56:00 +02:00
Wes Kocher d8780b2a3f Backed out changeset 74293125739a (bug 1176341) 2015-07-10 12:48:20 -07:00
Andrew McCreight 8047284e97 Bug 1176341 - De-holder nsIXPConnect::CreateSandbox. r=baku,gabor 2015-07-10 07:41:33 -07:00
Emanuel Hoogeveen 7d1e52f2ff Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00
Hiroyuki Ikezoe 47d5b2db66 Bug 1179982 - Fix all compile errors in dom/workers on non-unified build. r=mrbkap 2015-07-02 14:54:00 +02:00
Ben Kelly 0fd3dd2bfb Bug 1178508 ServiceWorker scripts should never be intercepted. r=baku 2015-07-02 07:30:06 -07:00
Ehsan Akhgari a7e0f3e102 Bug 1148935 - Correctly reflect worker and sharedworker RequestContext values; r=smaug 2015-06-30 18:52:42 -04:00
Ryan VanderMeulen c4367148d1 Backed out changeset 07bf31cca660 (bug 1148935) for Werror bustage.
CLOSED TREE
2015-06-30 15:53:43 -04:00
Ehsan Akhgari d560d3dcf3 Bug 1148935 - Correctly reflect worker and sharedworker RequestContext values; r=smaug 2015-06-30 15:30:08 -04:00
Ben Kelly 2de3ef558a Bug 1175138 P5 Make CacheStorage reject on untrusted origins. r=ehsan 2015-06-27 23:19:24 -04:00
Ben Kelly d722c7d5fb Bug 1173467 P3 Pass private browsing flag into CacheStorage factory methods. r=ehsan 2015-06-26 19:36:40 -07:00
Cameron McCormack 5ccbe11d06 Back out bug 1173467 (changesets a20799ebf48c, 9312c5cb756e, c0e8bba17067, af075443ab21, 30cefdf8d020) for assertion failures in test_app_protocol.html. 2015-06-27 11:57:17 +10:00
Ben Kelly 73d7dcb1a3 Bug 1173467 P3 Pass private browsing flag into CacheStorage factory methods. r=ehsan 2015-06-26 17:42:56 -07:00
Andrea Marchesini d56d23dc96 Bug 1168933 - Send referrer when downloading worker script. r=khuey
--HG--
extra : rebase_source : b4fa11d4ba34525979c98de119934beffba284f7
2015-06-04 16:20:13 -07:00
Nikhil Marathe 769b046558 Bug 1169044 - Patch 5 - build fixes. a=bustage
--HG--
extra : rebase_source : 3983bd2531b85f3f1f61b360aa44a11f0effe8bc
2015-06-04 17:26:05 -07:00
Nikhil Marathe b52b66ebf5 Bug 1169044 - Patch 3 - Store and set principal with script URI on ServiceWorkers. r=ehsan
The ServiceWorkerRegistrationInfo's principal is the principal of the document
that called register(). If we create WorkerPrivate instances based off of
this, they have a valid principal in terms of security and same-origin-ness,
but the URI path is wrong. When fetching the script from the network, the
channel's principal is used to update the worker principal. We need to do the
same when the script is loaded from Cache. This patch adds support to store the
channel principal in the cache.

--HG--
extra : rebase_source : e7d527335aa4f0d4ee52e58915c8b0ef4ad26983
2015-06-04 21:39:34 -07:00
Ben Turner 496e2b6920 Bug 1173139 - Reorder global creation on workers, r=khuey. 2015-06-10 14:12:55 -07:00
Ben Turner 215b1e0292 Bug 1173002 - Set worker system principal flag correctly when created from chrome, r=bz, a=kwierso. 2015-06-09 14:34:00 -07:00
Ehsan Akhgari 4017e4028f Bug 1168208 - Refactor the existing logic for syncing the security info between Response and channel objects into a new helper class; r=nsm,jdm,bkelly
--HG--
rename : dom/fetch/InternalResponse.cpp => dom/fetch/ChannelInfo.cpp
rename : dom/fetch/Response.h => dom/fetch/ChannelInfo.h
2015-05-27 14:22:53 -04:00
Carsten "Tomcat" Book 1f0ef48e79 Backed out changeset ae9c77fa58d1 (bug 1168208) for bustage on a CLOSED TREE 2015-05-27 14:50:43 +02:00
Ehsan Akhgari c66a858d3a Bug 1168208 - Refactor the existing logic for syncing the security info between Response and channel objects into a new helper class; r=nsm,jdm,bkelly
--HG--
rename : dom/fetch/InternalResponse.cpp => dom/fetch/ChannelInfo.cpp
rename : dom/fetch/Response.h => dom/fetch/ChannelInfo.h
2015-05-27 08:25:03 -04:00
Ben Turner 57dc7c8b04 Bug 1163109. Restrict the resource:// weirdness in workers to loads from a system principal. r=bzbarsky 2015-05-26 17:27:01 -04:00
Andrew McCreight 9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Daniel Holbert 37bc14ef82 Bug 1156847 followup: annotate workers helper-class "ScriptLoaderRunnable" OnStartRequest/OnStopRequest as override. rs=ehsan 2015-04-30 11:42:16 -07:00
Ehsan Akhgari cea01af662 Bug 1156847 - Part 5: When loading a service worker from the cache, set its security info on the WorkerPrivate; r=nsm 2015-04-29 20:22:30 -04:00
Ehsan Akhgari cd281dd5d2 Bug 1156847 - Part 4: When storing a service worker script to the cache, store its security info in the cache as well; r=khuey
Before this patch, we would call Cache.put() before opening the channel,
which means that we have no way of knowing the security info for the
channel in order to set it on the Response object that we synthesize.
This patch adds an nsIRequestObserver to the tee created for piping the
body of the response to the cache, and delays calling Cache.put() until
we receive the nsIRequestObserver::OnStartRequest() notification, at
which point we set the obtained security info on the Response object to
be stored in the cache.
2015-04-29 20:22:29 -04:00
Ehsan Akhgari a2a584db69 Bug 1156847 - Part 3: When loading a service worker from the network, remember the security info of the channel on the WorkerPrivate; r=nsm 2015-04-29 20:22:28 -04:00
Boris Zbarsky d36060dc11 Bug 1157898 part 5. Eliminate the remaining non-ErrorResult consumers of ErrorResult::ErrorCode and make it protected. r=peterv 2015-04-27 09:18:52 -04:00
Boris Zbarsky 1540774b0c Bug 1157898 part 1. Make code of the form "return rv.ErrorCode();" where rv is an ErrorResult use StealNSResult instead. r=peterv
This patch was generated with the following command:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 's/return ([a-zA-Z0-9]+)\.ErrorCode\(\);/return \1.StealNSResult();/'
2015-04-27 09:18:51 -04:00
Ehsan Akhgari dc30989a71 Bug 1148942 - Ensure that the registration of empty service workers succeeds; r=bent 2015-04-16 18:18:20 -04:00
Nikhil Marathe 3927633b56 Bug 1151916 - Set worker principalinfo on cache load. r=bkelly
--HG--
extra : rebase_source : ac5c81a995badf835a9d81f76d674c55c38bd6bb
2015-04-10 14:14:44 -07:00
Nikhil Marathe 68a8b2850e Bug 931249 - Patch 15 - assert later. r=baku
--HG--
extra : rebase_source : a311232492d5e135aa383757eadd4efc117d713f
2015-03-27 13:29:40 -07:00
Nikhil Marathe 7821a17b77 Bug 931249 - Patch 14 - kungfuDeathGrip. r=baku
--HG--
extra : rebase_source : 9ef21438c85cb30aa7b2579e4ac6efdb6980b49d
2015-03-27 10:00:59 -07:00
Nikhil Marathe a715e011ee Bug 931249 - Patch 13 - Fix finish condition in CacheScriptLoader::Fail. r=baku
--HG--
extra : rebase_source : abd3b49a789b256eeb7aa763f4f8996afa77d5b3
2015-03-26 15:56:02 -07:00
Nikhil Marathe 8983db35fe Bug 931249 - Patch 12 - Call LoadingFinished even if channel is not present. r=khuey
If the failure was due to inability to create a channel (csp, other restrictions) we still want to mark the load as finished

--HG--
extra : rebase_source : e8e6705984ce3895604fdff358df7375e5c4c1c5
2015-03-24 17:11:57 -07:00
Nikhil Marathe 78132f902f Bug 931249 - Patch 8 - Provide direct getter to the fact that we are loading a worker instead of relying on cache name. r=khuey
--HG--
extra : rebase_source : ad85e2de17f562449f041fcb66a061a319da45f0
2015-03-19 16:39:01 -07:00
Nikhil Marathe 42de02a529 Bug 931249 - patch 2 - cachename integration. r=nsm
--HG--
extra : rebase_source : 8a5bd6a3ec53ccd83c08e58f7a74f6ae1f0edea7
2015-03-18 09:46:38 -07:00
Nikhil Marathe e0c3f020d5 Bug 931249 - Patch 1.1 - Set baseURI when script is obtained from cache. r=khuey
--HG--
extra : rebase_source : f8bd9b047518b3e5e220eddc3eab1f0918b83f6b
2015-03-18 16:14:30 -07:00
Nikhil Marathe 238374c507 Bug 931249 - patch 1 - Scriptloader use cache if needed. r=khuey
--HG--
extra : rebase_source : c81b13a05ec04a68c3acd25807fcf997bd9db81e
2015-03-19 11:41:42 -07:00
Eddy Bruël b86b9bb514 Bug 1092102 - Implement WorkerDebuggerGlobalScope.createSandbox;r=khuey 2015-03-31 12:22:40 +02:00
Carsten "Tomcat" Book 5245fa5a7b Backed out changeset 71abbf190d53 (bug 1092102) for static analysis build bustage on a CLOSED TREE
--HG--
extra : rebase_source : fb64615c90507f79d27f3ab096e6e0259cb38c3e
2015-03-31 11:14:46 +02:00
Eddy Bruël 0c47b481d2 Bug 1092102 - Implement WorkerDebuggerGlobalScope.createSandbox;r=khuey 2015-03-31 10:19:04 +02:00
Andrea Marchesini e6f385fb3d Bug 1148527 - Indentation fix after bug 1145631, r=ehsan 2015-03-27 18:52:19 +00:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Eddy Bruël 2d0841a4c7 Bug 1092102 - Implement WorkerDebugger.initialize;r=khuey 2015-03-17 11:15:19 +01:00
Boris Zbarsky fe0f33e72f Bug 1097987 part 7. Require callers of JS::Evaluate to either use the global as the scope or pass in an explicit scopechain. r=waldo 2015-03-14 01:36:16 -04:00
Ben Kelly 28e0242799 Bug 1107516 - Part 3: Make sure all workers have an nsILoadGroup when loading scripts. r=sicking, r=bent 2014-12-12 11:06:00 -05:00
Boris Zbarsky 67d7197390 Bug 1100579 part 1. Remove the overloads of JS::Evaluate that don't take an rval mutable handle, and control the behavior via the JS::CompileOptions instead. r=waldo,bholley 2014-11-18 23:27:16 -05:00
Christoph Kerschbaumer 29facae35b Bug 1041180: Remove deprecated nsIChannelPolicy (r=sstamm,jduell,jst) 2014-10-15 19:11:45 -07:00
Christoph Kerschbaumer 4e801b4d7b Bug 1038756: Callsites creating a channel in /dom/workers/ (r=bent) 2014-09-21 09:39:57 -07:00
Chris Peterson d126c3c24f Bug 1063962 - Replace jschar typedef with C++11 char16_t type. r=jandem 2014-07-21 21:43:21 -07:00
Christoph Kerschbaumer 68de320099 Bug 1062529 - Split GetChannelPrincipal into GetChannelResultPrincipal and GetChannelURIPrincipal. r=bz 2014-08-06 16:05:40 -07:00
Andrea Marchesini 0c788084d3 Bug 1036484 - empty 404 worker script should emit a 'error' event, r=khuey
--HG--
rename : dom/workers/test/test_404.html => dom/workers/test/test_bug1036484.html
2014-08-10 15:33:06 +02:00
Bobby Holley a23211976d Bug 940321 - Eliminate ambient noScriptRval, and make it live exclusively on CompileOptions. r=jandem 2014-07-31 09:55:20 -07:00
Bobby Holley 6807884378 Bug 940305 - Move extraWarnings to RuntimeOptions with a per-compartment override. r=jandem,r=khuey 2014-07-29 21:00:37 -07:00
Kyle Huey 8c5cca136c Bug 996133: Remove unnecessary NS_DISPATCH_NORMAL arguments to NS_DispatchToMainThread. r=ehsan 2014-05-23 12:53:17 -07:00
Ben Turner 42455fcdcb Bug 999274 - Wait for the last runnable before calling ShutdownScriptLoader. r=sicking 2014-05-20 08:34:25 -04:00
Birunthan Mohanathas 5f1fde8824 Bug 900908 - Part 3: Change uses of numbered macros in nsIClassInfoImpl.h/nsISupportsImpl.h to the variadic variants. r=froydnj 2014-04-27 03:06:00 -04:00
Ben Kelly ba737351be Bug 987556 Part 9 Use JS::SourceBufferHolder in worker ScriptLoader. r=bz 2014-04-25 10:11:57 -04:00
Bobby Holley e1d5378ac6 Bug 990353 - Flag for discarding where appropriate. r=bent 2014-04-22 14:08:28 -07:00
Jon Coppeard fb6ccb11db Bug 959787 - Handlify JS_ExecuteScript and JS::Evaluate APIs r=terrence r=bz 2014-04-01 11:34:39 +01:00
Luke Wagner 1f15bc50e0 Bug 980180 - remove principals as an argument to compilation, part 1 (r=terrence)
--HG--
extra : rebase_source : 8bf0ff6974870d6772021aafa88dd8fd5132fc70
2014-03-06 16:28:05 -06:00
Andrew McCreight 22928ce074 Bug 947592 - Streamline ReportLoadError. r=bent 2014-01-23 17:20:53 -08:00
Kyle Huey 87cce0f558 Bug 959070: Make sure to call ScriptExecutorRunnable's base class's Cancel method too. r=janv 2014-01-13 09:41:02 -08:00
Kyle Huey 8da7a3e86b Bug 957693: Fix a worker hang and other related bugs. r=bent 2014-01-10 16:37:47 -08:00
Ben Turner 357b12898a Bug 914762 - Switch Workers to use a normal nsThread event loop, r=mrbkap.
--HG--
extra : transplant_source : /%93%60%CC%3A%16%B16%A1%5Bmx%9F%FA%7B%10JD%F0%E7
2013-10-23 06:16:49 -07:00
Ms2ger 0fdc697b63 No bug - Fix some style issues in DOM code. 2013-11-11 09:04:41 +01:00
Kyle Huey 020d8b6c36 Bug 928312: Convert the worker global object and all remaining EventTargets to new DOM bindings. r=bent,peterv,smaug 2013-11-05 22:16:26 +08:00
Nikhil Marathe d4d7f9747c Bug 484305 - Worker scripts should always be decoded as UTF-8. r=bent 2013-10-09 18:23:47 -04:00
Ben Turner 866302e69b Bug 643325 - Implement SharedWorker. r=khuey.
--HG--
extra : transplant_source : %D6%8C%9Ajc%3C%F0%0E%DB%C6%7E2%AA%97%B8%AA%B2%7EY%B6
2013-06-05 07:04:23 -07:00
Ehsan Akhgari 7233ba7103 Bug 918923 - Part 2: Switch to #including nsString.h in code using the internal strings API; r=bsmedberg 2013-09-23 13:25:00 -04:00
Kyle Huey bf7d0aa16a Bug 911258: Part 5 - Use the unified exception handling mechanism on workers. r=bz 2013-09-08 20:29:21 -07:00
Bobby Holley 98a0425f0f Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke
This was done with perl/grep.
2013-07-29 16:45:27 -07:00
Joshua Cranmer 36673bcae2 Bug 884061 - Part 3f: Use NS_DECL_THREADSAFE_ISUPPORTS in dom/, r=smaug,dhylands.
--HG--
extra : rebase_source : b8eaae07c54c94c8c46c7ed4c0e226eb74584652
2013-07-18 21:21:20 -05:00
Bobby Holley 66cbfb2448 Bug 869800 - Remove JS_GetGlobalObject from workers. r=bent 2013-05-08 10:45:46 -07:00
Trevor Saunders 9c14887d75 bug 856700 - don't check the result of infalible nsTArray::SwapElements() in dom/ r=khuey 2013-04-01 13:35:13 -04:00
Masatoshi Kimura 030c7764da Bug 587251 - new Worker(badURL) should throw a SECURITY_ERR. r=khuey 2013-03-08 07:27:21 +09:00
Jon Coppeard a0a3f88913 Bug 848395 - GC: Move Rooted to JS namespace - rename js::Rooted to JS::Rooted outside SpiderMonkey r=terrence
--HG--
extra : rebase_source : 35cbf3cc4da4598c2e9e6975028ef397718849db
2013-03-06 16:41:43 +00:00
Ed Morley 3a53c22824 Backed out changeset 28ef4bdff455 (bug 848395) 2013-03-07 13:03:35 +00:00
Jon Coppeard 6a98a4532a Bug 848395 - GC: Move Rooted to JS namespace - rename js::Rooted to JS::Rooted outside SpiderMonkey r=terrence
--HG--
extra : rebase_source : 866879df05e3ec3f8e93570eb3f6b71103636b41
2013-03-06 16:41:43 +00:00