Commit Graph
37 Commits
Author SHA1 Message Date
Karl Tomlinson eaa5302ce6 bug 1391482 accept int16_t-sample initialization of AudioBuffer r=padenot
MozReview-Commit-ID: 5UaVZYneN2b
2017-08-17 17:23:27 +12:00
Karl Tomlinson addbff42f0 bug 1391482 add a method to create an AudioBuffer from AudioChunk data r=padenot
MozReview-Commit-ID: GkJJo6UW4gl
2017-08-16 17:45:48 +12:00
Karl Tomlinson 7142d0c200 bug 1391482 move AudioBuffer parameter checking to constructor r=padenot
for sharing with a new factory method in a future patch.

MozReview-Commit-ID: LAtbRVttMh8
2017-08-16 17:38:43 +12:00
Karl Tomlinson 71ced4475f bug 1391482 generalize shared channel data from AudioBuffer as AudioChunk r=padenot
Although the AudioChunk buffer is still always a
ThreadSharedFloatArrayBufferList, 16 bit buffers will be permitted in a future
patch.

MozReview-Commit-ID: FPZ6VcX4C1q
2017-08-09 16:39:40 +12:00
Karl Tomlinson e974c43fab bug 1391482 use AudioChunk to generalize AudioBuffer shared channel storage r=padenot
Although the AudioChunk buffer is still always a
ThreadSharedFloatArrayBufferList, buffers with 16-bit data will be permitted
in a future patch.

MozReview-Commit-ID: FEGKMiQOCpR
2017-08-03 17:58:23 +12:00
Phil Ringnalda e53faebe6b Backed out 15 changesets (bug 1391482) for rooting hazard
Backed out changeset 4d4ed9b64bdb (bug 1391482)
Backed out changeset c02da061fc56 (bug 1391482)
Backed out changeset 7f096b0d1d0e (bug 1391482)
Backed out changeset 497e04031fc3 (bug 1391482)
Backed out changeset cb6ac4267562 (bug 1391482)
Backed out changeset b9a522cc88c9 (bug 1391482)
Backed out changeset 6feba222e86b (bug 1391482)
Backed out changeset ee13302be6c8 (bug 1391482)
Backed out changeset 0e12a1bdb2fa (bug 1391482)
Backed out changeset 7ffc044e742a (bug 1391482)
Backed out changeset fc35c12c815f (bug 1391482)
Backed out changeset 527ea972cdf3 (bug 1391482)
Backed out changeset a9c7abf92455 (bug 1391482)
Backed out changeset fea3e5cd3590 (bug 1391482)
Backed out changeset ca07d3a43b11 (bug 1391482)

MozReview-Commit-ID: 9Cq8e7pr2SP
2017-08-28 20:40:11 -07:00
Karl Tomlinson 7544057d1f bug 1391482 accept int16_t-sample initialization of AudioBuffer r=padenot
MozReview-Commit-ID: 5UaVZYneN2b
2017-08-17 17:23:27 +12:00
Karl Tomlinson d6b0bfb115 bug 1391482 add a method to create an AudioBuffer from AudioChunk data r=padenot
MozReview-Commit-ID: GkJJo6UW4gl
2017-08-16 17:45:48 +12:00
Karl Tomlinson fb269d09a7 bug 1391482 move AudioBuffer parameter checking to constructor r=padenot
for sharing with a new factory method in a future patch.

MozReview-Commit-ID: LAtbRVttMh8
2017-08-16 17:38:43 +12:00
Karl Tomlinson 30d13e5cfc bug 1391482 generalize shared channel data from AudioBuffer as AudioChunk r=padenot
Although the AudioChunk buffer is still always a
ThreadSharedFloatArrayBufferList, 16 bit buffers will be permitted in a future
patch.

MozReview-Commit-ID: FPZ6VcX4C1q
2017-08-09 16:39:40 +12:00
Karl Tomlinson 26ad72cf01 bug 1391482 use AudioChunk to generalize AudioBuffer shared channel storage r=padenot
Although the AudioChunk buffer is still always a
ThreadSharedFloatArrayBufferList, buffers with 16-bit data will be permitted
in a future patch.

MozReview-Commit-ID: FEGKMiQOCpR
2017-08-03 17:58:23 +12:00
Jean-Yves Avenard fa1fcd710b Bug 1319987: P9. More coding style fixes. r=gerald
MozReview-Commit-ID: DhFRqkWQZny
2017-01-27 13:20:37 +01:00
Andrea Marchesini 58bffa7d8d Bug 1329744 - AudioBuffer ctor updated, r=padenot 2017-01-10 21:30:28 +00:00
Olli Pettay 3898f7d882 Bug 1326507, remove NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS, r=mccr8 2017-01-03 21:47:55 +02:00
Andrea Marchesini fa88279902 Bug 1322883 - AudioNode constructors - part 15 - AudioBuffer, r=padenot 2016-12-15 19:24:42 +01:00
Jon Coppeard 863d796e4b Bug 1297558 - Remove explicit calls to Expose*ToActiveJS r=mccr8 2016-10-18 17:58:19 +01:00
Andrew McCreight bd14645323 Bug 1296275 - Be better about exposing to active js in AudioBuffer::StealJSArrayDataIntoSharedChannels(). r=terrence
MozReview-Commit-ID: GC8sncFJlPS
2016-08-29 15:03:42 -07:00
Nicholas Nethercote 1009bf0056 Bug 1297658 - Avoid unnecessary checking in memory reporters. r=erahm.
This patch removes checking of all the callback calls in memory reporter
CollectReport() functions, because it's not useful.

The patch also does some associated clean-up.

- Replaces some uses of nsIMemoryReporterCallback with the preferred
  nsIHandleReportCallback typedef.

- Replaces aCallback/aCb/aClosure with aHandleRepor/aData for CollectReports()
  parameter names, for consistency.

- Adds MOZ_MUST_USE/[must_use] in a few places in nsIMemoryReporter.idl.

- Uses the MOZ_COLLECT_REPORT macro in all suitable places.

Overall the patch reduces code size by ~300 lines and reduces the size of
libxul by about 37 KiB on my Linux64 builds.
2016-08-24 15:23:45 +10:00
Thomas Wisniewski 1f8482d321 Bug 1017704 - Move DropJSObjects into the destructor in AudioBuffer.cpp. r=mccr8 2016-08-20 20:32:52 -04:00
Paul Adenot 0c15fa48d6 Bug 1241096 - Add a better memory reporting system for AudioBuffers. r=erahm
MozReview-Commit-ID: GHiauyyD3R2
2016-04-01 13:36:41 +02:00
Carsten "Tomcat" Book 62abbba184 Backed out changeset 5d5b5862ab90 (bug 1241096) for crashtest crashes 2016-04-01 09:42:07 +02:00
Paul Adenot 9868c92c43 Bug 1241096 - Add a better memory reporting system for AudioBuffers. r=erahm
MozReview-Commit-ID: GHiauyyD3R2
2016-04-01 08:27:08 +02:00
Boris Zbarsky ae9cbe5fbd Bug 1255718. Remove the unused JSContext argument of AudioBuffer::Create. r=ehsan 2016-03-11 16:43:31 -05:00
Jeff Walden 78f75957bc Bug 1079844 - Change various non-js/ files/tests/etc. to refer to detaching of ArrayBuffers rather than neutering. (DOM references to "neutering" of DOM things remain as neutering.) r=bz 2016-01-25 18:10:22 -08:00
Lars T Hansen f7d6191975 Bug 1176214 - Part 11: Changes to DOM, except for WebGL. r=bz, r=clb 2015-11-25 19:04:50 +01:00
Nathan Froyd 4e6d8f6705 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
2015-10-18 01:24:48 -04:00
Karl Tomlinson 5854af9107 bug 1198656 delay AudioBuffer allocation until required r=padenot
This saves an allocation and zeroing for buffers generated by AudioNodes and
avoids allocation altogether for empty buffers.

Incidentally, RestoreJSChannelData() now avoids unnecessary recreation of
Float32Arrays if they already exist after a previous call failed.
2015-08-24 19:30:36 +12:00
Karl Tomlinson 6c1b9dacbf bug 1198656 clear references in mJSChannels on successful content acquire r=padenot
The array buffers are no longer available and mJSChannels will be overwritten
in RestoreJSChannelData() before it is used again.  This is consistent with
"Attach ArrayBuffers containing copies of the data to the AudioBuffer, to be
returned by the next call to getChannelData."
2015-08-24 15:06:43 +12:00
Karl Tomlinson 042e537ed3 bug 1198656 refactor acquiring the content into an object method r=padenot
This makes it clearer that the algorithm is intentionally aborted when any of
the buffers have been neutered and that the stolen data has the correct
length.

It also makes mJSChannels available for clearing in a subsequent changeset.
2015-08-25 08:51:55 +12:00
Karl Tomlinson f7496aa617 bug 1198656 remove unnecessary reinterpret_casts r=padenot
JS_StealArrayBufferContents() returns void*.
2015-08-21 16:44:04 +12:00
Karl Tomlinson 726926a76c bug 1199559 remove now unused SetRawChannelContents r=padenot 2015-08-25 11:46:30 +12:00
Karl Tomlinson 31d984a6dd bug 1199559 add a factory method to accept generated buffer contents in a format suitable for direct use r=padenot
This API lets AudioBuffer generators avoid a copy.

Future modifications to AudioBuffer will remove the unnecessary initial
allocation and zeroing.
2015-08-28 18:30:49 +12:00
Karl Tomlinson fd31ca64ad bug 1196111 don't keep AudioContext alive from AudioBuffer r=baku
AudioBuffers are often generated from OfflineAudioContext to be used in other
contexts, when the OfflineAudioContext is no longer required.
2015-08-18 11:48:38 +12:00
Nicholas Nethercote 37d91ed8fe Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj.
This makes it clearer that, unlike how SizeOf*() functions usually work, this
doesn't measure any children hanging off the array.

And do likewise for nsTObserverArray.
2015-07-28 23:24:24 -07:00
Birunthan Mohanathas a29151dc87 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
Boris Zbarsky 3a822d99b4 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
Birunthan Mohanathas 417b400d55 Bug 946065 - Part 10: Move content/media/ to dom/. r=peterv 2014-10-25 20:24:36 +03:00