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

62 Коммитов

Автор SHA1 Сообщение Дата
Ben Kelly 68a7000f5d Bug 1221351 P1 ServiceWorkerContainer and ServiceWorkerRegistration should not crash for null window owner. r=catalinb 2015-11-05 09:33:33 -08: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
Andrew McCreight 5171450b27 Bug 1197893 - Check the number of arguments for ThrowTypeError() and ThrowRangeError() at compile time. r=peterv 2015-10-05 09:38:14 -07:00
Wes Kocher f0d829220d Backed out changeset 821791826960 (bug 1197893) for Nexus build failures CLOSED TREE 2015-10-02 16:17:05 -07:00
Andrew McCreight 35cd15b8de Bug 1197893 - Check the number of arguments for ThrowTypeError() and ThrowRangeError() at compile time. r=peterv 2015-10-02 15:09:02 -07:00
Andrew McCreight 7a2c6267d4 Backed out changeset 6fa9cdf4002b for breaking the build. 2015-10-02 10:49:28 -07:00
Andrew McCreight 404740a102 Bug 1197893 - Check the number of arguments for ThrowTypeError() and ThrowRangeError() at compile time. r=peterv 2015-10-02 10:42:08 -07:00
Nikhil Marathe 6d235278db Bug 1203324 - disable notifications on serviceworkers. r=ehsan,wchen
Per the product discussion, the Notification API should be disabled in
ServiceWorker in release builds for 42 since the UX isn't great [1].

The aim is to release in 44.

Apologies for the code duplication for pref checking in Notification and
ServiceWorkerRegistration. There isn't a easy way to get
ServiceWorkerRegistration's generated binding to include Notification.h without
having an attribute/method that uses Notification.

[1]: https://mana.mozilla.org/wiki/x/TgAJAw

--HG--
extra : commitid : 5dtc2E63kuM
extra : rebase_source : 4265dcd154462aa4f3b915e9e898fe7b82bf9afc
2015-09-15 12:58:32 -07:00
Nikhil Marathe d5c8bfc780 Bug 1197012 - Fix ThrowTypeError in Notification. r=mccr8
--HG--
extra : commitid : EfR8HuHT7WA
extra : rebase_source : 9d713b3293a1b0e08f2be6015a81a179e4aa1c0e
2015-08-20 22:18:49 -07:00
Nikhil Marathe 548809dc68 Bug 1197421 - Fix promise worker proxy cleanup and update callers. r=catalinb
Get rid of having users dispatch control runnables. It was error prone and
required too much reasoning. It was also possible to end up in a state where
callers would dispatch a WorkerRunnable, which would succeed, so they would not
dispatch a WorkerControlRunnable. Then the worker would stop Running,
canceling and releasing the runnable leading to releasing the proxy in an
unclean state. Instead, we AddRef() and add the feature and remove the feature
and Release() on Notify(). If callers successfully run a WorkerRunnable they
clean the proxy. If not, the proxy stays alive until the worker switches to
Canceling state.

--HG--
extra : commitid : BnnijSibVYe
extra : rebase_source : 15f6810dfbd0c88a983196de401c55e782b1d1d8
2015-09-02 10:07:26 -07:00
Nikhil Marathe 0047229d92 Bug 1187350 - update() should return a Promise. r=ehsan,catalinb
--HG--
extra : commitid : 2SkKnobC9jo
extra : rebase_source : 5f5d5c3ca57237fb63044c66a48861a1a4bf19f3
extra : amend_source : 5ea042fc5cc2be52594eca1fd6cda2f36057b3eb
2015-08-14 15:06:00 -07:00
Nikhil Marathe cf6e7ed78b Bug 1184574 - Allow access to PushManager on ServiceWorker. r=kitcambridge,smaug,catalinb
Refactoring to allow access to PushManager in ServiceWorkerGlobalScope. See comment in PushManager.h for details.

--HG--
extra : commitid : A7RvB9rm8av
extra : transplant_source : %20%99%CA%B0%EB%B9%82%27D%F7e%B8UQ%12%E6%9B%18%BB5
2015-07-23 08:30:15 -07:00
Nikhil Marathe c8a46b6965 Bug 1114554 - Patch 5 - getNotifications() on worker thread. r=wchen
--HG--
extra : rebase_source : 7d42bf40e9228d3729e0a269d66fa427db3eb38f
2015-06-25 18:50:25 -07:00
Nikhil Marathe 0dcce8d9fe Bug 1114554 - Patch 4 - ServiceWorkerRegistration.getNotifications() on main thread. r=wchen
--HG--
extra : rebase_source : 094fa1eca4e3a9e303202ecaad4edf6cd816c065
2015-06-25 18:50:25 -07:00
Nikhil Marathe b3f34da652 Bug 1114554 - Patch 2 - ServiceWorkerRegistration.showNotification(). r=wchen,baku
Refactor creation and show dispatch so Notification constructor and showNotification can use it.
Move persistence to ShowInternal.
NotificationStorage calls callback async even when fetching from cache, simply to have similar semantics.
Calls to Notification::Get() are performed async since persistence is now async after being moved to ShowInternal().
Both are in accordance with the spec where the "append to list of notifications" operation is performed in the "show steps" which are performed in parallel from API invocations.

--HG--
extra : rebase_source : 52d3864fb39aa892d2f70dc2b71f09fb0d2ba533
2015-06-25 18:50:24 -07:00
Nikhil Marathe 0b129137a7 Bug 1114554 - Patch 1 - Notification ServiceWorker API stubs. r=wchen,baku
--HG--
extra : rebase_source : e033641ae9d271d1681c424f533db63671b3e735
2015-06-25 18:50:24 -07:00
Birunthan Mohanathas a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Randell Jesup b63478816a Bug 1155059: Patch 5 - clean up ServiceWorkers and avoid leaks r=nikhil 2015-07-09 23:21:46 -04: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
Ryan VanderMeulen 84d140a54b Backed out 11 changesets (bug 916893, bug 1114554) for various mochitest and Gij failures.
Backed out changeset 247ca4bf258e (bug 1114554)
Backed out changeset 5578d5c280a6 (bug 1114554)
Backed out changeset 404830c1ecf7 (bug 1114554)
Backed out changeset 15bdf9c78e6e (bug 1114554)
Backed out changeset f92abe5ec784 (bug 1114554)
Backed out changeset 75324b6862a8 (bug 1114554)
Backed out changeset ce8a768782f2 (bug 1114554)
Backed out changeset 0d860fd12534 (bug 1114554)
Backed out changeset 7dc2448065a9 (bug 916893)
Backed out changeset c3b07f0d1a60 (bug 916893)
Backed out changeset 61c3f24cc908 (bug 916893)

CLOSED TREE
2015-06-25 19:52:40 -04:00
Nikhil Marathe 811edc788a Bug 1114554 - Patch 5 - getNotifications() on worker thread. r=wchen
--HG--
extra : rebase_source : b3f68e725be5cbfedc2995c9b20450e4bcaa1aae
2015-05-04 09:04:25 -04:00
Nikhil Marathe 54e0ea7180 Bug 1114554 - Patch 4 - ServiceWorkerRegistration.getNotifications() on main thread. r=wchen
--HG--
extra : rebase_source : 7963829964347156d091c2c8f492c546a9e5fdc0
extra : amend_source : a1bcbf20f5e4ab65b4214bc97d64deba9732b952
2015-04-27 14:18:54 -07:00
Nikhil Marathe 7df5ce7b58 Bug 1114554 - Patch 2 - ServiceWorkerRegistration.showNotification(). r=wchen,baku
Refactor creation and show dispatch so Notification constructor and showNotification can use it.
Move persistence to ShowInternal.
NotificationStorage calls callback async even when fetching from cache, simply to have similar semantics.
Calls to Notification::Get() are performed async since persistence is now async after being moved to ShowInternal().
Both are in accordance with the spec where the "append to list of notifications" operation is performed in the "show steps" which are performed in parallel from API invocations.

--HG--
extra : rebase_source : 1becb5055dc29166dc6445227bab4b9daed213cf
2015-05-06 13:52:41 -07:00
Nikhil Marathe 914907fc27 Bug 1114554 - Patch 1 - Notification ServiceWorker API stubs. r=wchen,baku
--HG--
extra : rebase_source : 10558f76070842454f22356d35b4f6639f990e29
2015-03-10 18:57:09 -07:00
Andrea Marchesini a71e717b67 Bug 1162088 - patch 1 - ServiceWorkerManager should use OriginAttributes from the principal as scopeKey, r=nsm, r=bholley 2015-06-03 09:43:43 +01:00
Andrew McCreight e32a66ebb3 Bug 1166488 - Eliminate ServiceWorkerRegistrationBase::mCCDummy. r=smaug 2015-05-20 09:55:07 -07:00
Ryan VanderMeulen e1ee0d7597 Backed out changeset f0af05d88416 (bug 1162088) for various web-platform-test failures.
CLOSED TREE
2015-05-19 15:20:15 -04:00
Andrea Marchesini 1d31da42fd Bug 1162088 - ServiceWorkerManager should use the principal+scope for the initialization of ServiceWorkers, r=nsm,ehsan 2015-05-19 17:53:36 +01:00
Daniel Holbert b2bcb0c719 Bug 1131327 followup: Add 'override' annotation to WorkerListener refcounting functions. rs=ehsan 2015-04-23 09:20:08 -07:00
Nikhil Marathe 9ecfa34d9b Bug 1131327 - Patch 10 - Remember to remove the feature. r=baku
--HG--
extra : rebase_source : 3bc133e8e22dce4b65cb0b90db7b806a2ad96eef
2015-04-17 16:44:58 -07:00
Nikhil Marathe de1f3a4bf5 Bug 1131327 - Patch 9 - Fix windows compiler macro error. r=baku
--HG--
extra : rebase_source : d11b7bce9a2a1cc7c3b40262e5cec4aba32886f5
2015-04-16 12:53:14 -07:00
Nikhil Marathe e4c89a3bc6 Bug 1131327 - Patch 8 - Return null on worker attribute access. r=baku
--HG--
extra : rebase_source : 3d959ca15e2d669220882c0611b2235ee3291bf0
2015-04-14 16:12:59 -07:00
Nikhil Marathe a24add821f Bug 1131327 - Patch 7 - Fire updatefound on worker registration. r=baku
--HG--
extra : rebase_source : d87fd98d37ee45fb592a0fba764b099485df7cb3
2015-04-08 15:22:36 -07:00
Nikhil Marathe d7b71e8fbf Bug 1131327 - Patch 6 - SWM holds ServiceWorkerRegistrationListener for updatefound and invalidation notifications. r=baku
Splits up the listener interface to which SWM can hold rawptrs so that registration objects living on the worker thread can use awkward proxies to listen to these events.

--HG--
extra : rebase_source : 7b9753742b3dd6e416057fdee528b0d2067c55a9
2015-04-08 13:13:32 -07:00
Nikhil Marathe e1029f2748 Bug 1131327 - Patch 5 - Implement ServiceWorkerRegistration.unregister() on worker. r=baku
--HG--
extra : rebase_source : f8beb830277b9351673ccfd42b7b0a25516fb4dd
2015-04-07 14:17:02 -07:00
Nikhil Marathe 279301faf2 Bug 1131327 - Patch 4 - Implement ServiceWorkerRegistration.update() on worker. r=baku
ServiceWorkerGlobalScope::Registration() now returns initialized registration.

--HG--
extra : rebase_source : 6c07c86c0ddc4b3d714ebc423ff40282217d7f4c
2015-04-07 11:50:08 -07:00
Nikhil Marathe d9d452e06b Bug 1131327 - Patch 3 - move event listeners to main thread class. r=baku
--HG--
extra : rebase_source : 66145d7dbddd0e0a89164ffa7a3dd2805e3a609b
2015-04-07 13:09:07 -07:00
Nikhil Marathe 5b54bf699f Bug 1131327 - Patch 2 - Expose to workers. r=baku
This patch exposes ServiceWorkerRegistration (and ServiceWorker to satisfy constraints) to workers.

For now, a null registration is returned in the worker.

--HG--
extra : rebase_source : ae1b59d5ee3b3522826ed59fcfcb31e009018ac3
2015-04-03 22:46:07 -07:00
Nikhil Marathe 3f0efb4e4d Bug 1131327 - Patch 1 - Introduce ServiceWorkerRegistration{Base,MainThread,WorkerThread} r=baku
--HG--
extra : rebase_source : 352f05447f45a9dfa651bf683d22659b83508814
2015-04-03 15:18:55 -07:00
Nikhil Marathe e8ed488816 Bug 1131350 - Move update() to ServiceWorkerRegistration. r=baku
--HG--
extra : rebase_source : 0483ec35b9b53c4970afaf76ff3b8a6f92120e34
2015-03-19 18:09:10 -07:00
Doug Turner 9c9d8e38df Bug 1038811 - Push Notifications - ServiceWorker changes, push event implementation. r=nsm 2015-04-10 20:19:28 -07: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
Boris Zbarsky dc24477d79 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Nikhil Marathe a817a419ab Bug 1131882 - Associate ServiceWorkers with underlying ServiceWorkerInfo. r=baku
This allows controller to track state too, and provides better encapsulation.
1) Move SW setup to SWM. RuntimeService now only creates the underlying SharedWorker.
2) Require a SWInfo to create a SW. The SW holds a refptr to the info.

--HG--
extra : rebase_source : d9de8a66a45f597d1613890691d1facae51eb64e
2015-02-19 08:40:21 -08:00
Andrea Marchesini 78ecfc7b0d Bug 984050 - Persist ServiceWorkerRegistrations. r=bent, r=nsm 2015-02-11 06:53:00 -05:00
Carsten "Tomcat" Book 43c27b90f0 Backed out changeset b3a1efe7900a (bug 984050) for cpp unitest failures on a CLOSED TREE 2015-02-11 13:29:16 +01:00
Andrea Marchesini 8fb2e275d3 Bug 984050 - Persist ServiceWorkerRegistrations. r=bent,nsm 2015-02-11 10:10:23 +01:00
Phil Ringnalda 03a26ce028 Back out 3da63ccbadef (bug 984050) for Windows cppunit bustage
CLOSED TREE
2015-02-06 19:49:42 -08:00
Andrea Marchesini ee4cdf6a25 Bug 984050 - Persist ServiceWorker registrations, r=bent, r=nsm 2015-02-06 23:31:33 +00:00
Nikhil Marathe 3e3b6fb8c0 Bug 1113957 - ServiceWorker unregistration uses job queue. r=baku
--HG--
extra : transplant_source : %B3%AA%CF%C5%05%409%D9%15Ly%FA%FF%E3%FA%5E%9B%3F%9F.
2015-01-22 14:10:38 -08:00