Commit Graph

65 Commits

Author SHA1 Message Date
Nikhil Marathe
247d6d8297 Bug 1197012 - Fix ThrowTypeError in Notification. r=mccr8 2015-08-20 22:18:49 -07:00
Nikhil Marathe
17f9c6955f 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.
2015-09-02 10:07:26 -07:00
Nikhil Marathe
8a43f94475 Bug 1199901 - Bustage fix due to rebase. a=bustage
Based on patch here https://reviewboard.mozilla.org/r/17787/diff/1/
CLOSED TREE
2015-09-02 09:07:14 -07:00
Nikhil Marathe
570b3aaaa8 Bug 1199901 - GetOrigin() fails cleanly instead of asserting principal. r=wchen
When we use the XUL based alerts and the main firefox window is closed, the XUL
window still keeps the process running, but as the window closes it calls
DisconnectFromOwner() on the Notification. Later, when the XUL alert closes
(either due to timeout or due to script) attempts to get the principal can
fail. This patch allows that to happen and will just skip deleting the
Notification from persistent storage.
2015-09-01 12:08:36 -07:00
Nikhil Marathe
90207c6753 Bug 1199901 - Clear mObserver when WorkerNotificationObserver is destroyed. r=wchen 2015-08-31 13:17:13 -07:00
Nikhil Marathe
69574050d1 Bug 1196079 - Always try to release Notification via normal WorkerRunnable first. r=wchen 2015-08-24 15:40:57 -07:00
Nicholas Nethercote
69d088e45f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
2015-08-27 20:44:53 -07:00
Aryeh Gregor
2aab280bb3 Bug 874842 - Return Event instead of nsIDOMEvent 2015-08-12 14:39:31 +03:00
Nikhil Marathe
10bf553eb0 Bug 1187018 - Ensure feature is nulled out if it does not get added. r=khuey 2015-07-24 10:25:00 -07:00
Aryeh Gregor
300e014861 Bug 1191305 - Alphabetize some includes; r=froydnj 2015-08-06 15:45:21 +03:00
Aryeh Gregor
3713e55caa Bug 1190823 - Move OwningNonNull.h to xpcom/base/; r=froydnj 2015-08-05 15:28:27 +03:00
Olli Pettay
cb6eb89bc1 Bug 1183954, Don't leak nsStructuredCloneContainer (use of 'auto' is error prone), r=leak 2015-08-02 12:34:26 +03:00
Nikhil Marathe
e9d71f7375 Bug 1183954 - Fix Notification.data structured cloning on workers. r=robertbindar,mccr8
Rather than store a non-thread-safe refcounted nsIStructuredCloneContainer, store the base64 representation.
Caches a jsval the first time an attempt to access data is made from content script.
2015-07-30 12:44:14 -07:00
Ehsan Akhgari
ced20cc4d7 Bug 1189090 - Rework the nsISupports implementation in the ScopeCheckingGetCallback and its subclasses; r=nsm 2015-07-30 01:05:04 -04:00
Robert Bindar
0aa1a50c3f Bug 1114554 - Patch 9 - Fixed crash in b2g-desktop tests. r=nsm 2015-07-13 13:45:17 -07:00
Nikhil Marathe
c0a2d1d0b6 Bug 1114554 - Patch 7 - Call BindToOwner on all threads. r=wchen 2015-06-25 18:50:25 -07:00
Nikhil Marathe
2ce316e71c Bug 1114554 - Patch 5 - getNotifications() on worker thread. r=wchen 2015-06-25 18:50:25 -07:00
Nikhil Marathe
c82f6f8cc8 Bug 1114554 - Patch 4 - ServiceWorkerRegistration.getNotifications() on main thread. r=wchen 2015-06-25 18:50:25 -07:00
Nikhil Marathe
40af10ec0b Bug 1114554 - Patch 3 - Fire notificationclick event on ServiceWorkerGlobalScope. r=wchen,baku
Bug 1114554 - Patch 3.1 - ServiceWorker principal fixes. r=baku

Bug 1162088 introduced origin attributes that ServiceWorkerManager callers have to use. This patch updates notificationclick events to work.

Folded:
Hide NotificationEvent behind pref
2015-06-25 18:50:25 -07:00
Nikhil Marathe
d7c89d1814 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.
2015-06-25 18:50:24 -07:00
Nikhil Marathe
b043678543 Bug 1114554 - Patch 1 - Notification ServiceWorker API stubs. r=wchen,baku 2015-06-25 18:50:24 -07:00
Birunthan Mohanathas
47ed3a3675 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
Nikhil Marathe
0f70982b4a Bug 916893 - Patch 3 - Walk up worker chain to find correct window for WorkerNotificationObserver. r=khuey
In case of child workers.
2015-06-25 18:53:02 -07:00
Nikhil Marathe
10c5efa9f8 Bug 916893 - Patch 2 - Deal with onclose. Some grammar fixes. r=wchen 2015-06-25 18:53:02 -07:00
Nikhil Marathe
870def21e1 Bug 916893 - Patch 1 - Notification on workers. r=khuey,wchen
Does not implement the Service Worker API - https://notifications.spec.whatwg.org/#service-worker-api
***
Folded:
Bug 916893 - Better ownership model. r=khuey
Fix for bug found by ASan where we were touching the NotificationFeature after releasing it.
2015-06-25 18:53:02 -07:00
Ryan VanderMeulen
beb2b187f5 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
376318522c Bug 1114554 - Patch 7 - Call BindToOwner on all threads. r=wchen 2015-05-22 14:55:40 -07:00
Nikhil Marathe
e0074dc7bd Bug 1114554 - Patch 5 - getNotifications() on worker thread. r=wchen 2015-05-04 09:04:25 -04:00
Nikhil Marathe
2f93c26df5 Bug 1114554 - Patch 4 - ServiceWorkerRegistration.getNotifications() on main thread. r=wchen 2015-04-27 14:18:54 -07:00
Nikhil Marathe
fc6c5fd22e Bug 1114554 - Patch 3 - Fire notificationclick event on ServiceWorkerGlobalScope. r=wchen,baku
Bug 1114554 - Patch 3.1 - ServiceWorker principal fixes. r=baku

Bug 1162088 introduced origin attributes that ServiceWorkerManager callers have to use. This patch updates notificationclick events to work.

Folded:
Hide NotificationEvent behind pref
2015-06-25 15:01:01 -07:00
Nikhil Marathe
137854b7b3 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.
2015-05-06 13:52:41 -07:00
Nikhil Marathe
943e8a2744 Bug 1114554 - Patch 1 - Notification ServiceWorker API stubs. r=wchen,baku 2015-03-10 18:57:09 -07:00
Nikhil Marathe
fcb663156b Bug 916893 - Patch 3 - Walk up worker chain to find correct window for WorkerNotificationObserver. r=khuey
In case of child workers.
2015-04-28 13:15:51 -07:00
Nikhil Marathe
d9c7bbd18b Bug 916893 - Patch 2 - Deal with onclose. Some grammar fixes. r=wchen 2015-04-27 11:54:48 -07:00
Nikhil Marathe
5aa559655d Bug 916893 - Patch 1 - Notification on workers. r=khuey,wchen
Does not implement the Service Worker API - https://notifications.spec.whatwg.org/#service-worker-api
***
Folded:
Bug 916893 - Better ownership model. r=khuey
Fix for bug found by ASan where we were touching the NotificationFeature after releasing it.
2015-06-25 11:36:53 -07:00
Terrence Cole
0aefa6e182 Bug 1164602 - Replace js::NullPtr and JS::NullPtr with nullptr_t; r=sfink 2015-05-13 14:07:34 -07:00
Alexandre Lissy
8bf3c597f2 Bug 960762 - Fix intermittence of Notification mochitests. r=mhenretty 2015-05-18 09:49:00 +02:00
Alexandre Lissy
dfbf99d57c Bug 1159128 - Only save valid app notifications. r=mhenretty 2015-05-14 10:59:00 +02:00
Andrew McCreight
c979f253c0 Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Andrew McCreight
5a5637e076 Bug 1152551, part 1 - Remove leading tabs in dom/. r=baku
Also, remove trailing whitespace in nsXMLContentSink.cpp
2015-05-03 15:32:33 -04:00
Boris Zbarsky
6a3f2d3909 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
Boris Zbarsky
b246ea2ae9 Bug 1154366. Pass in a JSContext to StructuredCloneContainer::InitFromJSVal so it will throw its exceptions somewhere where people might see them. r=bholley 2015-04-16 13:22:15 -04:00
Kershaw Chang
31cff83422 Bug 1020179 - Let PContent manage PContentPermissionRequest. r=fabrice, r=khuey 2015-04-13 21:08:00 -04:00
Andrea Marchesini
94545cbb2e Bug 1148527 - Indentation fix after bug 1145631, r=ehsan 2015-03-27 18:52:19 +00:00
Ehsan Akhgari
5cccea6f0f 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
988b8e01be 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
Kyle Huey
2a6f8887b5 Bug 1121673: Use move references in IPDL. r=bent 2015-01-16 11:58:52 -08:00
Ehsan Akhgari
37c07444a0 Bug 1118803 - Mark virtual overridden functions as MOZ_OVERRIDE in misc DOM code; r=baku 2015-01-08 08:49:54 -05:00
Ehsan Akhgari
278bbb319d Bug 1106116 - Load images for notifications triggered from private browsing windows as private; r=jdm 2014-11-28 14:08:29 -05:00
Alexandre Lissy
9c2b5b205d Bug 1100876 - Add showOnlyOnce to MozBehavior dict. r=mhenretty, r=smaug
There are some notifications that we know we don't want to resend. For
instance, Voicemail notifications are some, since everytime the network
will be ready it will notify us of the status, so we don't have to
resend it on reboot. We add a 'showOnlyOnce' key in the MozBehavior dict
for this usecase.
2014-11-25 08:26:00 -05:00