mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Merge m-c to fx-team. a=merge
CLOSED TREE
This commit is contained in:
commit
d988da03f5
1
.hgtags
1
.hgtags
@ -103,3 +103,4 @@ ba2cc1eda988a1614d8986ae145d28e1268409b9 FIREFOX_AURORA_29_BASE
|
||||
cfde3603b0206e119abea76fdd6e134b634348f1 FIREFOX_AURORA_31_BASE
|
||||
16f3cac5e8fe471e12f76d6a94a477b14e78df7c FIREFOX_AURORA_32_BASE
|
||||
dc23164ba2a289a8b22902e30990c77d9677c214 FIREFOX_AURORA_33_BASE
|
||||
c360f3d1c00d73b0c1fb0a2c0da525cb55e58b83 FIREFOX_AURORA_34_BASE
|
||||
|
2
CLOBBER
2
CLOBBER
@ -22,4 +22,4 @@
|
||||
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
||||
# don't change CLOBBER for WebIDL changes any more.
|
||||
|
||||
dom/ flattening might need a CLOBBER.
|
||||
Merge day clobber
|
@ -23,7 +23,7 @@ typedef RootAccessible RootAccessibleWrap;
|
||||
class GtkWindowAccessible MOZ_FINAL : public DummyAccessible
|
||||
{
|
||||
public:
|
||||
GtkWindowAccessible(AtkObject* aAccessible);
|
||||
explicit GtkWindowAccessible(AtkObject* aAccessible);
|
||||
virtual ~GtkWindowAccessible();
|
||||
};
|
||||
|
||||
|
@ -23,7 +23,7 @@ namespace a11y {
|
||||
class MaiHyperlink
|
||||
{
|
||||
public:
|
||||
MaiHyperlink(Accessible* aHyperLink);
|
||||
explicit MaiHyperlink(Accessible* aHyperLink);
|
||||
~MaiHyperlink();
|
||||
|
||||
public:
|
||||
|
@ -234,7 +234,7 @@ uint8_t AttrCharacteristicsFor(nsIAtom* aAtom);
|
||||
class AttrIterator
|
||||
{
|
||||
public:
|
||||
AttrIterator(nsIContent* aContent) :
|
||||
explicit AttrIterator(nsIContent* aContent) :
|
||||
mContent(aContent), mAttrIdx(0)
|
||||
{
|
||||
mAttrCount = mContent->GetAttrCount();
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
|
||||
protected:
|
||||
// Make sure it's used by Accessible class only.
|
||||
EmbeddedObjCollector(Accessible* aRoot) :
|
||||
explicit EmbeddedObjCollector(Accessible* aRoot) :
|
||||
AccCollector(aRoot, filters::GetEmbeddedObject) { }
|
||||
|
||||
virtual void AppendObject(Accessible* aAccessible);
|
||||
|
@ -52,7 +52,7 @@ private:
|
||||
|
||||
struct IteratorState
|
||||
{
|
||||
IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
|
||||
explicit IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
|
||||
|
||||
Accessible* mParent;
|
||||
int32_t mIndex;
|
||||
@ -254,7 +254,7 @@ private:
|
||||
class SingleAccIterator : public AccIterable
|
||||
{
|
||||
public:
|
||||
SingleAccIterator(Accessible* aTarget): mAcc(aTarget) { }
|
||||
explicit SingleAccIterator(Accessible* aTarget): mAcc(aTarget) { }
|
||||
virtual ~SingleAccIterator() { }
|
||||
|
||||
virtual Accessible* Next();
|
||||
@ -274,7 +274,7 @@ private:
|
||||
class ItemIterator : public AccIterable
|
||||
{
|
||||
public:
|
||||
ItemIterator(Accessible* aItemContainer) :
|
||||
explicit ItemIterator(Accessible* aItemContainer) :
|
||||
mContainer(aItemContainer), mAnchor(nullptr) { }
|
||||
virtual ~ItemIterator() { }
|
||||
|
||||
|
@ -19,7 +19,7 @@ class DocAccessible;
|
||||
class EventQueue
|
||||
{
|
||||
protected:
|
||||
EventQueue(DocAccessible* aDocument) : mDocument(aDocument) { }
|
||||
explicit EventQueue(DocAccessible* aDocument) : mDocument(aDocument) { }
|
||||
|
||||
/**
|
||||
* Put an accessible event into the queue to process it later.
|
||||
|
@ -275,8 +275,8 @@ private:
|
||||
typedef T* KeyType;
|
||||
typedef const T* KeyTypePointer;
|
||||
|
||||
nsCOMPtrHashKey(const T* aKey) : mKey(const_cast<T*>(aKey)) {}
|
||||
nsCOMPtrHashKey(const nsPtrHashKey<T> &aToCopy) : mKey(aToCopy.mKey) {}
|
||||
explicit nsCOMPtrHashKey(const T* aKey) : mKey(const_cast<T*>(aKey)) {}
|
||||
explicit nsCOMPtrHashKey(const nsPtrHashKey<T> &aToCopy) : mKey(aToCopy.mKey) {}
|
||||
~nsCOMPtrHashKey() { }
|
||||
|
||||
KeyType GetKey() const { return mKey; }
|
||||
|
@ -23,10 +23,10 @@ class Relation
|
||||
public:
|
||||
Relation() : mFirstIter(nullptr), mLastIter(nullptr) { }
|
||||
|
||||
Relation(AccIterable* aIter) :
|
||||
explicit Relation(AccIterable* aIter) :
|
||||
mFirstIter(aIter), mLastIter(aIter) { }
|
||||
|
||||
Relation(Accessible* aAcc) :
|
||||
explicit Relation(Accessible* aAcc) :
|
||||
mFirstIter(nullptr), mLastIter(nullptr)
|
||||
{ AppendTarget(aAcc); }
|
||||
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
/**
|
||||
* Constructor. Used to expose default text attributes.
|
||||
*/
|
||||
TextAttrsMgr(HyperTextAccessible* aHyperTextAcc) :
|
||||
explicit TextAttrsMgr(HyperTextAccessible* aHyperTextAcc) :
|
||||
mOffsetAcc(nullptr), mHyperTextAcc(aHyperTextAcc),
|
||||
mOffsetAccIdx(-1), mIncludeDefAttrs(true) { }
|
||||
|
||||
@ -126,7 +126,7 @@ protected:
|
||||
class TTextAttr : public TextAttr
|
||||
{
|
||||
public:
|
||||
TTextAttr(bool aGetRootValue) : mGetRootValue(aGetRootValue) {}
|
||||
explicit TTextAttr(bool aGetRootValue) : mGetRootValue(aGetRootValue) {}
|
||||
|
||||
// TextAttr
|
||||
virtual void Expose(nsIPersistentProperties* aAttributes,
|
||||
@ -393,7 +393,7 @@ protected:
|
||||
{
|
||||
public:
|
||||
TextDecorValue() { }
|
||||
TextDecorValue(nsIFrame* aFrame);
|
||||
explicit TextDecorValue(nsIFrame* aFrame);
|
||||
|
||||
nscolor Color() const { return mColor; }
|
||||
uint8_t Style() const { return mStyle; }
|
||||
|
@ -19,8 +19,8 @@ using namespace mozilla::a11y;
|
||||
class RuleCache
|
||||
{
|
||||
public:
|
||||
RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule),
|
||||
mAcceptRoles(nullptr) { }
|
||||
explicit RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule),
|
||||
mAcceptRoles(nullptr) { }
|
||||
~RuleCache () {
|
||||
if (mAcceptRoles)
|
||||
nsMemory::Free(mAcceptRoles);
|
||||
|
@ -25,7 +25,7 @@ class nsAccessiblePivot MOZ_FINAL : public nsIAccessiblePivot
|
||||
public:
|
||||
typedef mozilla::a11y::Accessible Accessible;
|
||||
|
||||
nsAccessiblePivot(Accessible* aRoot);
|
||||
explicit nsAccessiblePivot(Accessible* aRoot);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsAccessiblePivot, nsIAccessiblePivot)
|
||||
|
@ -21,7 +21,7 @@ class TableAccessible;
|
||||
class xpcAccessibleTable
|
||||
{
|
||||
public:
|
||||
xpcAccessibleTable(mozilla::a11y::TableAccessible* aTable) : mTable(aTable) { }
|
||||
explicit xpcAccessibleTable(mozilla::a11y::TableAccessible* aTable) : mTable(aTable) { }
|
||||
|
||||
nsresult GetCaption(nsIAccessible** aCaption);
|
||||
nsresult GetSummary(nsAString& aSummary);
|
||||
|
@ -25,7 +25,7 @@ class TableCellAccessible;
|
||||
class xpcAccessibleTableCell
|
||||
{
|
||||
public:
|
||||
xpcAccessibleTableCell(mozilla::a11y::TableCellAccessible* aTableCell) :
|
||||
explicit xpcAccessibleTableCell(mozilla::a11y::TableCellAccessible* aTableCell) :
|
||||
mTableCell(aTableCell) { }
|
||||
|
||||
nsresult GetTable(nsIAccessibleTable** aTable);
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLETEXTRANGE_IMPL_IID)
|
||||
|
||||
private:
|
||||
xpcAccessibleTextRange(TextRange&& aRange) :
|
||||
explicit xpcAccessibleTextRange(TextRange&& aRange) :
|
||||
mRange(Forward<TextRange>(aRange)) {}
|
||||
xpcAccessibleTextRange() {}
|
||||
|
||||
|
@ -215,6 +215,13 @@ RunProcesses(int argc, const char *argv[])
|
||||
return XRE_ProcLoaderServiceRun(getppid(), childSock, argc, argv);
|
||||
}
|
||||
|
||||
// Reap zombie child process.
|
||||
struct sigaction sa;
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
sigaction(SIGCHLD, &sa, nullptr);
|
||||
|
||||
// The b2g process
|
||||
int childPid = pid;
|
||||
XRE_ProcLoaderClientInit(childPid, parentSock);
|
||||
|
@ -754,13 +754,11 @@ pref("hal.processPriorityManager.gonk.notifyLowMemUnderKB", 14336);
|
||||
// blocked on a poll(), and this pref has no effect.)
|
||||
pref("gonk.systemMemoryPressureRecoveryPollMS", 5000);
|
||||
|
||||
#ifndef DEBUG
|
||||
// Enable pre-launching content processes for improved startup time
|
||||
// (hiding latency).
|
||||
pref("dom.ipc.processPrelaunch.enabled", true);
|
||||
// Wait this long before pre-launching a new subprocess.
|
||||
pref("dom.ipc.processPrelaunch.delayMs", 5000);
|
||||
#endif
|
||||
|
||||
pref("dom.ipc.reuse_parent_app", false);
|
||||
|
||||
|
@ -55,13 +55,17 @@ function checkDebuggerPort() {
|
||||
// DebuggerServer.openListener detects that it isn't a file path (string),
|
||||
// and starts listening on the tcp port given here as command line argument.
|
||||
|
||||
if (!window.arguments) {
|
||||
// Get the command line arguments that were passed to the b2g client
|
||||
let args;
|
||||
try {
|
||||
let service = Cc["@mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds"].getService(Ci.nsISupports);
|
||||
args = service.wrappedJSObject.cmdLine;
|
||||
} catch(e) {}
|
||||
|
||||
if (!args) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the command line arguments that were passed to the b2g client
|
||||
let args = window.arguments[0].QueryInterface(Ci.nsICommandLine);
|
||||
|
||||
let dbgport;
|
||||
try {
|
||||
dbgport = args.handleFlagWithParam('start-debugger-server', false);
|
||||
|
@ -5,12 +5,17 @@
|
||||
|
||||
let runAppObj;
|
||||
window.addEventListener('load', function() {
|
||||
if (!window.arguments) {
|
||||
// Get the command line arguments that were passed to the b2g client
|
||||
let args;
|
||||
try {
|
||||
let service = Cc["@mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds"].getService(Ci.nsISupports);
|
||||
args = service.wrappedJSObject.cmdLine;
|
||||
} catch(e) {}
|
||||
|
||||
if (!args) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the command line arguments that were passed to the b2g client
|
||||
let args = window.arguments[0].QueryInterface(Ci.nsICommandLine);
|
||||
let appname;
|
||||
|
||||
// - Check if the argument is present before doing any work.
|
||||
|
@ -62,8 +62,8 @@ window.addEventListener('ContentStart', function() {
|
||||
// Get the command line arguments that were passed to the b2g client
|
||||
let args;
|
||||
try {
|
||||
// On Firefox Mulet, we don't always have a command line argument
|
||||
args = window.arguments[0].QueryInterface(Ci.nsICommandLine);
|
||||
let service = Cc["@mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds"].getService(Ci.nsISupports);
|
||||
args = service.wrappedJSObject.cmdLine;
|
||||
} catch(e) {}
|
||||
|
||||
let screenarg = null;
|
||||
|
@ -96,6 +96,10 @@ category profile-after-change SimulatorScreen @mozilla.org/simulator-screen;1
|
||||
component {e30b0e13-2d12-4cb0-bc4c-4e617a1bf76e} OopCommandLine.js
|
||||
contract @mozilla.org/commandlinehandler/general-startup;1?type=b2goop {e30b0e13-2d12-4cb0-bc4c-4e617a1bf76e}
|
||||
category command-line-handler m-b2goop @mozilla.org/commandlinehandler/general-startup;1?type=b2goop
|
||||
|
||||
component {385993fe-8710-4621-9fb1-00a09d8bec37} CommandLine.js
|
||||
contract @mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds {385993fe-8710-4621-9fb1-00a09d8bec37}
|
||||
category command-line-handler m-b2gcmds @mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds
|
||||
#endif
|
||||
|
||||
# MobileIdentityUIGlue.js
|
||||
@ -105,4 +109,4 @@ contract @mozilla.org/services/mobileid-ui-glue;1 {83dbe26a-81f3-4a75-9541-3d0b7
|
||||
# B2GAppMigrator.js
|
||||
component {7211ece0-b458-4635-9afc-f8d7f376ee95} B2GAppMigrator.js
|
||||
contract @mozilla.org/b2g-app-migrator;1 {7211ece0-b458-4635-9afc-f8d7f376ee95}
|
||||
category profile-after-change B2GAppMigrator @mozilla.org/b2g-app-migrator;1
|
||||
category profile-after-change B2GAppMigrator @mozilla.org/b2g-app-migrator;1
|
||||
|
25
b2g/components/CommandLine.js
Normal file
25
b2g/components/CommandLine.js
Normal file
@ -0,0 +1,25 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
|
||||
// Small helper to expose nsICommandLine object to chrome code
|
||||
|
||||
function CommandlineHandler() {
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
|
||||
CommandlineHandler.prototype = {
|
||||
handle: function(cmdLine) {
|
||||
this.cmdLine = cmdLine;
|
||||
},
|
||||
|
||||
helpInfo: "",
|
||||
classID: Components.ID("{385993fe-8710-4621-9fb1-00a09d8bec37}"),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
|
||||
};
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CommandlineHandler]);
|
@ -30,6 +30,7 @@ EXTRA_COMPONENTS += [
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
|
||||
EXTRA_COMPONENTS += [
|
||||
'CommandLine.js',
|
||||
'OopCommandLine.js',
|
||||
'SimulatorScreen.js'
|
||||
]
|
||||
|
@ -15,9 +15,9 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="4b4336c73c081b39776d399835ce4853aee5cc1c">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
@ -127,7 +127,7 @@
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/external/icu4c" path="external/icu4c" revision="2bb01561780583cc37bc667f0ea79f48a122d8a2"/>
|
||||
<!-- dolphin specific things -->
|
||||
<project name="device/sprd" path="device/sprd" revision="ee67887cb2b7171db34b92d3f72b159d7dc51f10"/>
|
||||
<project name="device/sprd" path="device/sprd" revision="4eac1e31bf69596bf229a6877c9aa3493ecd9fce"/>
|
||||
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="4e58336019b5cbcfd134caf55b142236cf986618"/>
|
||||
<project name="platform/frameworks/av" path="frameworks/av" revision="facca8d3e35431b66f85a4eb42bc6c5b24bd04da"/>
|
||||
<project name="platform/hardware/akm" path="hardware/akm" revision="6d3be412647b0eab0adff8a2768736cf4eb68039"/>
|
||||
|
@ -19,8 +19,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c058843242068d0df7c107e09da31b53d2e08fa6"/>
|
||||
|
@ -17,8 +17,8 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7ddb07033043613303061416882c9b02ac3d76b6"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
|
@ -15,9 +15,9 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="4b4336c73c081b39776d399835ce4853aee5cc1c">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
|
@ -19,8 +19,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c058843242068d0df7c107e09da31b53d2e08fa6"/>
|
||||
|
@ -15,9 +15,9 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="4b4336c73c081b39776d399835ce4853aee5cc1c">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
|
@ -17,8 +17,8 @@
|
||||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7ddb07033043613303061416882c9b02ac3d76b6"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "14400ee07e836d74039e2317feebc0a13fcb60c8",
|
||||
"revision": "a5c22fd2faed558bd633a191e9db710b8080abca",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,8 +17,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
|
@ -15,8 +15,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
|
@ -17,8 +17,8 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7ddb07033043613303061416882c9b02ac3d76b6"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
|
@ -17,8 +17,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="44bf2e3bc5ddea9db9a8c851bd353cb234aa883c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7e469783859785a8bd4bf02a802f32561c84be7b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
|
@ -5,12 +5,12 @@
|
||||
MOZ_APP_BASENAME=B2G
|
||||
MOZ_APP_VENDOR=Mozilla
|
||||
|
||||
MOZ_APP_VERSION=34.0a1
|
||||
MOZ_APP_VERSION=35.0a1
|
||||
MOZ_APP_UA_NAME=Firefox
|
||||
|
||||
MOZ_UA_OS_AGNOSTIC=1
|
||||
|
||||
MOZ_B2G_VERSION=2.1.0.0-prerelease
|
||||
MOZ_B2G_VERSION=2.2.0.0-prerelease
|
||||
MOZ_B2G_OS_NAME=Boot2Gecko
|
||||
|
||||
MOZ_BRANDING_DIRECTORY=b2g/branding/unofficial
|
||||
|
@ -451,6 +451,7 @@
|
||||
@BINPATH@/components/amWebInstallListener.js
|
||||
@BINPATH@/components/nsBlocklistService.js
|
||||
@BINPATH@/components/OopCommandLine.js
|
||||
@BINPATH@/components/CommandLine.js
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
|
@ -1 +1 @@
|
||||
34.0a1
|
||||
35.0a1
|
||||
|
@ -10,4 +10,4 @@
|
||||
# hardcoded milestones in the tree from these two files.
|
||||
#--------------------------------------------------------
|
||||
|
||||
34.0a1
|
||||
35.0a1
|
||||
|
@ -2358,10 +2358,23 @@ bool HTMLMediaElement::ParseAttribute(int32_t aNamespaceID,
|
||||
|
||||
AudioChannel audioChannel = static_cast<AudioChannel>(aResult.GetEnumValue());
|
||||
|
||||
if (audioChannel != mAudioChannel &&
|
||||
!mDecoder &&
|
||||
CheckAudioChannelPermissions(aValue)) {
|
||||
mAudioChannel = audioChannel;
|
||||
if (audioChannel == mAudioChannel ||
|
||||
!CheckAudioChannelPermissions(aValue)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// We cannot change the AudioChannel of a decoder.
|
||||
if (mDecoder) {
|
||||
return true;
|
||||
}
|
||||
|
||||
mAudioChannel = audioChannel;
|
||||
|
||||
if (mSrcStream) {
|
||||
nsRefPtr<MediaStream> stream = mSrcStream->GetStream();
|
||||
if (stream) {
|
||||
stream->SetAudioChannelType(mAudioChannel);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -2822,6 +2835,12 @@ void HTMLMediaElement::SetupSrcMediaStreamPlayback(DOMMediaStream* aStream)
|
||||
NS_ASSERTION(!mSrcStream && !mSrcStreamListener, "Should have been ended already");
|
||||
|
||||
mSrcStream = aStream;
|
||||
|
||||
nsRefPtr<MediaStream> stream = mSrcStream->GetStream();
|
||||
if (stream) {
|
||||
stream->SetAudioChannelType(mAudioChannel);
|
||||
}
|
||||
|
||||
// XXX if we ever support capturing the output of a media element which is
|
||||
// playing a stream, we'll need to add a CombineWithPrincipal call here.
|
||||
mSrcStreamListener = new StreamListener(this);
|
||||
|
@ -324,10 +324,18 @@ IsDirectShowSupportedType(const nsACString& aType)
|
||||
|
||||
#ifdef MOZ_FMP4
|
||||
static bool
|
||||
IsMP4SupportedType(const nsACString& aType)
|
||||
IsMP4SupportedType(const nsACString& aType,
|
||||
const nsAString& aCodecs = EmptyString())
|
||||
{
|
||||
// Currently on B2G, FMP4 is only working for MSE playback.
|
||||
// For other normal MP4, it still uses current omx decoder.
|
||||
// Bug 1061034 is a follow-up bug to enable all MP4s with MOZ_FMP4
|
||||
#ifdef MOZ_OMX_DECODER
|
||||
return false;
|
||||
#else
|
||||
return Preferences::GetBool("media.fragmented-mp4.exposed", false) &&
|
||||
MP4Decoder::CanHandleMediaType(aType);
|
||||
MP4Decoder::CanHandleMediaType(aType, aCodecs);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -410,7 +418,7 @@ DecoderTraits::CanHandleMediaType(const char* aMIMEType,
|
||||
}
|
||||
#endif
|
||||
#ifdef MOZ_FMP4
|
||||
if (MP4Decoder::CanHandleMediaType(nsDependentCString(aMIMEType),
|
||||
if (IsMP4SupportedType(nsDependentCString(aMIMEType),
|
||||
aRequestedCodecs)) {
|
||||
return aHaveRequestedCodecs ? CANPLAY_YES : CANPLAY_MAYBE;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MediaKeyMessageEvent, Event)
|
||||
protected:
|
||||
virtual ~MediaKeyMessageEvent();
|
||||
MediaKeyMessageEvent(EventTarget* aOwner);
|
||||
explicit MediaKeyMessageEvent(EventTarget* aOwner);
|
||||
|
||||
JS::Heap<JSObject*> mMessage;
|
||||
nsString mDestinationURL;
|
||||
|
@ -40,7 +40,7 @@ GstMozVideoBufferData* gst_moz_video_buffer_get_data(const GstMozVideoBuffer* bu
|
||||
|
||||
class GstMozVideoBufferData {
|
||||
public:
|
||||
GstMozVideoBufferData(layers::PlanarYCbCrImage* aImage) : mImage(aImage) {}
|
||||
explicit GstMozVideoBufferData(layers::PlanarYCbCrImage* aImage) : mImage(aImage) {}
|
||||
|
||||
static void* Copy(void* aData) {
|
||||
return new GstMozVideoBufferData(reinterpret_cast<GstMozVideoBufferData*>(aData)->mImage);
|
||||
|
@ -38,7 +38,7 @@ class GStreamerReader : public MediaDecoderReader
|
||||
typedef gfx::IntRect IntRect;
|
||||
|
||||
public:
|
||||
GStreamerReader(AbstractMediaDecoder* aDecoder);
|
||||
explicit GStreamerReader(AbstractMediaDecoder* aDecoder);
|
||||
virtual ~GStreamerReader();
|
||||
|
||||
virtual nsresult Init(MediaDecoderReader* aCloneDonor);
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#include "MediaStreamSource.h"
|
||||
#include "MediaTaskQueue.h"
|
||||
#include "MP3FrameParser.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "ImageContainer.h"
|
||||
#include "SharedThreadPool.h"
|
||||
@ -131,6 +132,7 @@ MediaCodecReader::TrackInputCopier::Copy(MediaBuffer* aSourceBuffer,
|
||||
|
||||
MediaCodecReader::Track::Track()
|
||||
: mSourceIsStopped(true)
|
||||
, mDurationLock("MediaCodecReader::Track::mDurationLock")
|
||||
, mDurationUs(INT64_C(0))
|
||||
, mInputIndex(sInvalidInputIndex)
|
||||
, mInputEndOfStream(false)
|
||||
@ -193,10 +195,96 @@ MediaCodecReader::CodecBufferInfo::CodecBufferInfo()
|
||||
{
|
||||
}
|
||||
|
||||
MediaCodecReader::SignalObject::SignalObject(const char* aName)
|
||||
: mMonitor(aName)
|
||||
, mSignaled(false)
|
||||
{
|
||||
}
|
||||
|
||||
MediaCodecReader::SignalObject::~SignalObject()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
MediaCodecReader::SignalObject::Wait()
|
||||
{
|
||||
MonitorAutoLock al(mMonitor);
|
||||
if (!mSignaled) {
|
||||
mMonitor.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MediaCodecReader::SignalObject::Signal()
|
||||
{
|
||||
MonitorAutoLock al(mMonitor);
|
||||
mSignaled = true;
|
||||
mMonitor.Notify();
|
||||
}
|
||||
|
||||
MediaCodecReader::ParseCachedDataRunnable::ParseCachedDataRunnable(nsRefPtr<MediaCodecReader> aReader,
|
||||
const char* aBuffer,
|
||||
uint32_t aLength,
|
||||
int64_t aOffset,
|
||||
nsRefPtr<SignalObject> aSignal)
|
||||
: mReader(aReader)
|
||||
, mBuffer(aBuffer)
|
||||
, mLength(aLength)
|
||||
, mOffset(aOffset)
|
||||
, mSignal(aSignal)
|
||||
{
|
||||
MOZ_ASSERT(mReader, "Should have a valid MediaCodecReader.");
|
||||
MOZ_ASSERT(mBuffer, "Should have a valid buffer.");
|
||||
MOZ_ASSERT(mOffset >= INT64_C(0), "Should have a valid offset.");
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MediaCodecReader::ParseCachedDataRunnable::Run()
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
|
||||
|
||||
if (mReader->ParseDataSegment(mBuffer, mLength, mOffset)) {
|
||||
MonitorAutoLock monLock(mReader->mParserMonitor);
|
||||
if (mReader->mNextParserPosition >= mOffset + mLength &&
|
||||
mReader->mParsedDataLength < mOffset + mLength) {
|
||||
mReader->mParsedDataLength = mOffset + mLength;
|
||||
}
|
||||
}
|
||||
|
||||
if (mSignal != nullptr) {
|
||||
mSignal->Signal();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
MediaCodecReader::ProcessCachedDataTask::ProcessCachedDataTask(nsRefPtr<MediaCodecReader> aReader,
|
||||
int64_t aOffset)
|
||||
: mReader(aReader)
|
||||
, mOffset(aOffset)
|
||||
{
|
||||
MOZ_ASSERT(mReader, "Should have a valid MediaCodecReader.");
|
||||
MOZ_ASSERT(mOffset >= INT64_C(0), "Should have a valid offset.");
|
||||
}
|
||||
|
||||
void
|
||||
MediaCodecReader::ProcessCachedDataTask::Run()
|
||||
{
|
||||
mReader->ProcessCachedData(mOffset, nullptr);
|
||||
nsRefPtr<ReferenceKeeperRunnable<MediaCodecReader>> runnable(
|
||||
new ReferenceKeeperRunnable<MediaCodecReader>(mReader));
|
||||
mReader = nullptr;
|
||||
NS_DispatchToMainThread(runnable.get());
|
||||
}
|
||||
|
||||
MediaCodecReader::MediaCodecReader(AbstractMediaDecoder* aDecoder)
|
||||
: MediaOmxCommonReader(aDecoder)
|
||||
, mColorConverterBufferSize(0)
|
||||
, mExtractor(nullptr)
|
||||
, mParserMonitor("MediaCodecReader::mParserMonitor")
|
||||
, mParseDataFromCache(true)
|
||||
, mNextParserPosition(INT64_C(0))
|
||||
, mParsedDataLength(INT64_C(0))
|
||||
{
|
||||
mHandler = new MessageHandler(this);
|
||||
mVideoListener = new VideoResourceListener(this);
|
||||
@ -421,6 +509,144 @@ MediaCodecReader::HasVideo()
|
||||
return mInfo.mVideo.mHasVideo;
|
||||
}
|
||||
|
||||
void
|
||||
MediaCodecReader::NotifyDataArrived(const char* aBuffer,
|
||||
uint32_t aLength,
|
||||
int64_t aOffset)
|
||||
{
|
||||
MonitorAutoLock monLock(mParserMonitor);
|
||||
if (mNextParserPosition == mParsedDataLength &&
|
||||
mNextParserPosition >= aOffset &&
|
||||
mNextParserPosition <= aOffset + aLength) {
|
||||
// No pending parsing runnable currently. And available data are adjacent to
|
||||
// parsed data.
|
||||
int64_t shift = mNextParserPosition - aOffset;
|
||||
const char* buffer = aBuffer + shift;
|
||||
uint32_t length = aLength - shift;
|
||||
int64_t offset = mNextParserPosition;
|
||||
if (length > 0) {
|
||||
MonitorAutoUnlock monUnlock(mParserMonitor);
|
||||
ParseDataSegment(buffer, length, offset);
|
||||
}
|
||||
mParseDataFromCache = false;
|
||||
mParsedDataLength = offset + length;
|
||||
mNextParserPosition = mParsedDataLength;
|
||||
}
|
||||
}
|
||||
|
||||
int64_t
|
||||
MediaCodecReader::ProcessCachedData(int64_t aOffset,
|
||||
nsRefPtr<SignalObject> aSignal)
|
||||
{
|
||||
// We read data in chunks of 32 KiB. We can reduce this
|
||||
// value if media, such as sdcards, is too slow.
|
||||
// Because of SD card's slowness, need to keep sReadSize to small size.
|
||||
// See Bug 914870.
|
||||
static const int64_t sReadSize = 32 * 1024;
|
||||
|
||||
MOZ_ASSERT(!NS_IsMainThread(), "Should not be on main thread.");
|
||||
|
||||
{
|
||||
MonitorAutoLock monLock(mParserMonitor);
|
||||
if (!mParseDataFromCache) {
|
||||
// Skip cache processing since data can be continuously be parsed by
|
||||
// ParseDataSegment() from NotifyDataArrived() directly.
|
||||
return INT64_C(0);
|
||||
}
|
||||
}
|
||||
|
||||
MediaResource *resource = mDecoder->GetResource();
|
||||
MOZ_ASSERT(resource);
|
||||
|
||||
int64_t resourceLength = resource->GetCachedDataEnd(0);
|
||||
NS_ENSURE_TRUE(resourceLength >= 0, INT64_C(-1));
|
||||
|
||||
if (aOffset >= resourceLength) {
|
||||
return INT64_C(0); // Cache is empty, nothing to do
|
||||
}
|
||||
|
||||
int64_t bufferLength = std::min<int64_t>(resourceLength - aOffset, sReadSize);
|
||||
|
||||
nsAutoArrayPtr<char> buffer(new char[bufferLength]);
|
||||
|
||||
nsresult rv = resource->ReadFromCache(buffer.get(), aOffset, bufferLength);
|
||||
NS_ENSURE_SUCCESS(rv, INT64_C(-1));
|
||||
|
||||
MonitorAutoLock monLock(mParserMonitor);
|
||||
if (mParseDataFromCache) {
|
||||
nsRefPtr<ParseCachedDataRunnable> runnable(
|
||||
new ParseCachedDataRunnable(this,
|
||||
buffer.forget(),
|
||||
bufferLength,
|
||||
aOffset,
|
||||
aSignal));
|
||||
|
||||
rv = NS_DispatchToMainThread(runnable.get());
|
||||
NS_ENSURE_SUCCESS(rv, INT64_C(-1));
|
||||
|
||||
mNextParserPosition = aOffset + bufferLength;
|
||||
if (mNextParserPosition < resource->GetCachedDataEnd(0)) {
|
||||
// We cannot read data in the main thread because it
|
||||
// might block for too long. Instead we post an IO task
|
||||
// to the IO thread if there is more data available.
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE,
|
||||
new ProcessCachedDataTask(this, mNextParserPosition));
|
||||
}
|
||||
}
|
||||
|
||||
return bufferLength;
|
||||
}
|
||||
|
||||
bool
|
||||
MediaCodecReader::ParseDataSegment(const char* aBuffer,
|
||||
uint32_t aLength,
|
||||
int64_t aOffset)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
|
||||
|
||||
int64_t duration = INT64_C(-1);
|
||||
|
||||
{
|
||||
MonitorAutoLock monLock(mParserMonitor);
|
||||
|
||||
// currently only mp3 files are supported for incremental parsing
|
||||
if (mMP3FrameParser == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mMP3FrameParser->IsMP3()) {
|
||||
return true; // NO-OP
|
||||
}
|
||||
|
||||
mMP3FrameParser->Parse(aBuffer, aLength, aOffset);
|
||||
|
||||
duration = mMP3FrameParser->GetDuration();
|
||||
}
|
||||
|
||||
bool durationUpdateRequired = false;
|
||||
|
||||
{
|
||||
MutexAutoLock al(mAudioTrack.mDurationLock);
|
||||
if (duration > mAudioTrack.mDurationUs) {
|
||||
mAudioTrack.mDurationUs = duration;
|
||||
durationUpdateRequired = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (durationUpdateRequired && HasVideo()) {
|
||||
MutexAutoLock al(mVideoTrack.mDurationLock);
|
||||
durationUpdateRequired = duration > mVideoTrack.mDurationUs;
|
||||
}
|
||||
|
||||
if (durationUpdateRequired) {
|
||||
MOZ_ASSERT(mDecoder);
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
mDecoder->UpdateEstimatedMediaDuration(duration);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
MediaCodecReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
@ -435,6 +661,10 @@ MediaCodecReader::ReadMetadata(MediaInfo* aInfo,
|
||||
CheckAudioOffload();
|
||||
#endif
|
||||
|
||||
if (!TriggerIncrementalParser()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (IsWaitingMediaResources()) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -454,9 +684,18 @@ MediaCodecReader::ReadMetadata(MediaInfo* aInfo,
|
||||
}
|
||||
|
||||
// Set the total duration (the max of the audio and video track).
|
||||
int64_t duration = mAudioTrack.mDurationUs > mVideoTrack.mDurationUs ?
|
||||
mAudioTrack.mDurationUs : mVideoTrack.mDurationUs;
|
||||
if (duration >= 0LL) {
|
||||
int64_t audioDuration = INT64_C(-1);
|
||||
{
|
||||
MutexAutoLock al(mAudioTrack.mDurationLock);
|
||||
audioDuration = mAudioTrack.mDurationUs;
|
||||
}
|
||||
int64_t videoDuration = INT64_C(-1);
|
||||
{
|
||||
MutexAutoLock al(mVideoTrack.mDurationLock);
|
||||
videoDuration = mVideoTrack.mDurationUs;
|
||||
}
|
||||
int64_t duration = audioDuration > videoDuration ? audioDuration : videoDuration;
|
||||
if (duration >= INT64_C(0)) {
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
mDecoder->SetMediaDuration(duration);
|
||||
}
|
||||
@ -814,8 +1053,7 @@ MediaCodecReader::CreateMediaSources()
|
||||
return false;
|
||||
}
|
||||
|
||||
sp<MetaData> extractorMetaData = mExtractor->getMetaData();
|
||||
// TODO: Check MP3 file format
|
||||
mMetaData = mExtractor->getMetaData();
|
||||
|
||||
const ssize_t invalidTrackIndex = -1;
|
||||
ssize_t audioTrackIndex = invalidTrackIndex;
|
||||
@ -960,7 +1198,6 @@ MediaCodecReader::CreateMediaCodec(sp<ALooper>& aLooper,
|
||||
bool
|
||||
MediaCodecReader::ConfigureMediaCodec(Track& aTrack)
|
||||
{
|
||||
|
||||
if (aTrack.mSource != nullptr && aTrack.mCodec != nullptr) {
|
||||
if (!aTrack.mCodec->allocated()) {
|
||||
return false;
|
||||
@ -1009,6 +1246,54 @@ MediaCodecReader::DestroyMediaCodecs(Track& aTrack)
|
||||
aTrack.mCodec = nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
MediaCodecReader::TriggerIncrementalParser()
|
||||
{
|
||||
if (mMetaData == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int64_t duration = INT64_C(-1);
|
||||
|
||||
{
|
||||
MonitorAutoLock monLock(mParserMonitor);
|
||||
|
||||
// only support incremental parsing for mp3 currently.
|
||||
if (mMP3FrameParser != nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
mParseDataFromCache = true;
|
||||
mNextParserPosition = INT64_C(0);
|
||||
mParsedDataLength = INT64_C(0);
|
||||
|
||||
// MP3 file duration
|
||||
mMP3FrameParser = new MP3FrameParser(mDecoder->GetResource()->GetLength());
|
||||
const char* mime = nullptr;
|
||||
if (mMetaData->findCString(kKeyMIMEType, &mime) &&
|
||||
!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_MPEG)) {
|
||||
{
|
||||
MonitorAutoUnlock monUnlock(mParserMonitor);
|
||||
// trigger parsing logic and wait for finishing parsing data in the beginning.
|
||||
nsRefPtr<SignalObject> signalObject = new SignalObject("MediaCodecReader::UpdateDuration()");
|
||||
if (ProcessCachedData(INT64_C(0), signalObject) > INT64_C(0)) {
|
||||
signalObject->Wait();
|
||||
}
|
||||
}
|
||||
duration = mMP3FrameParser->GetDuration();
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
MutexAutoLock al(mAudioTrack.mDurationLock);
|
||||
if (duration > mAudioTrack.mDurationUs) {
|
||||
mAudioTrack.mDurationUs = duration;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
MediaCodecReader::UpdateDuration()
|
||||
{
|
||||
@ -1016,23 +1301,26 @@ MediaCodecReader::UpdateDuration()
|
||||
if (mAudioTrack.mSource != nullptr) {
|
||||
sp<MetaData> audioFormat = mAudioTrack.mSource->getFormat();
|
||||
if (audioFormat != nullptr) {
|
||||
int64_t audioDurationUs = 0LL;
|
||||
if (audioFormat->findInt64(kKeyDuration, &audioDurationUs) &&
|
||||
audioDurationUs > mAudioTrack.mDurationUs) {
|
||||
mAudioTrack.mDurationUs = audioDurationUs;
|
||||
int64_t duration = INT64_C(0);
|
||||
if (audioFormat->findInt64(kKeyDuration, &duration)) {
|
||||
MutexAutoLock al(mAudioTrack.mDurationLock);
|
||||
if (duration > mAudioTrack.mDurationUs) {
|
||||
mAudioTrack.mDurationUs = duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: MP3 file duration
|
||||
|
||||
// read video duration
|
||||
if (mVideoTrack.mSource != nullptr) {
|
||||
sp<MetaData> videoFormat = mVideoTrack.mSource->getFormat();
|
||||
if (videoFormat != nullptr) {
|
||||
int64_t videoDurationUs = 0LL;
|
||||
if (videoFormat->findInt64(kKeyDuration, &videoDurationUs) &&
|
||||
videoDurationUs > mVideoTrack.mDurationUs) {
|
||||
mVideoTrack.mDurationUs = videoDurationUs;
|
||||
int64_t duration = INT64_C(0);
|
||||
if (videoFormat->findInt64(kKeyDuration, &duration)) {
|
||||
MutexAutoLock al(mVideoTrack.mDurationLock);
|
||||
if (duration > mVideoTrack.mDurationUs) {
|
||||
mVideoTrack.mDurationUs = duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1396,7 +1684,7 @@ MediaCodecReader::EnsureCodecFormatParsed(Track& aTrack)
|
||||
size_t index = 0;
|
||||
size_t offset = 0;
|
||||
size_t size = 0;
|
||||
int64_t timeUs = 0LL;
|
||||
int64_t timeUs = INT64_C(0);
|
||||
uint32_t flags = 0;
|
||||
while ((status = aTrack.mCodec->dequeueOutputBuffer(&index, &offset, &size,
|
||||
&timeUs, &flags)) != INFO_FORMAT_CHANGED) {
|
||||
|
@ -9,7 +9,11 @@
|
||||
|
||||
#include <utils/threads.h>
|
||||
|
||||
#include <base/message_loop.h>
|
||||
|
||||
#include <mozilla/CheckedInt.h>
|
||||
#include <mozilla/Mutex.h>
|
||||
#include <mozilla/Monitor.h>
|
||||
|
||||
#include "MediaData.h"
|
||||
|
||||
@ -22,14 +26,15 @@ struct ALooper;
|
||||
struct AMessage;
|
||||
|
||||
class MOZ_EXPORT MediaExtractor;
|
||||
class MOZ_EXPORT MetaData;
|
||||
class MOZ_EXPORT MediaBuffer;
|
||||
struct MOZ_EXPORT MediaSource;
|
||||
struct MediaCodec;
|
||||
} // namespace android
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class MediaTaskQueue;
|
||||
class MP3FrameParser;
|
||||
|
||||
class MediaCodecReader : public MediaOmxCommonReader
|
||||
{
|
||||
@ -55,6 +60,11 @@ public:
|
||||
// irreversible, whereas ReleaseMediaResources() is reversible.
|
||||
virtual void Shutdown();
|
||||
|
||||
// Used to retrieve some special information that can only be retrieved after
|
||||
// all contents have been continuously parsed. (ex. total duration of some
|
||||
// variable-bit-rate MP3 files.)
|
||||
virtual void NotifyDataArrived(const char* aBuffer, uint32_t aLength, int64_t aOffset);
|
||||
|
||||
// Flush the MediaTaskQueue, flush MediaCodec and raise the mDiscontinuity.
|
||||
virtual nsresult ResetDecode() MOZ_OVERRIDE;
|
||||
|
||||
@ -109,6 +119,8 @@ protected:
|
||||
nsAutoPtr<TrackInputCopier> mInputCopier;
|
||||
|
||||
// media parameters
|
||||
Mutex mDurationLock; // mDurationUs might be read or updated from multiple
|
||||
// threads.
|
||||
int64_t mDurationUs;
|
||||
|
||||
// playback parameters
|
||||
@ -122,6 +134,11 @@ protected:
|
||||
bool mFlushed; // meaningless when mSeekTimeUs is invalid.
|
||||
bool mDiscontinuity;
|
||||
nsRefPtr<MediaTaskQueue> mTaskQueue;
|
||||
|
||||
private:
|
||||
// Forbidden
|
||||
Track(const Track &rhs) MOZ_DELETE;
|
||||
const Track &operator=(const Track&) MOZ_DELETE;
|
||||
};
|
||||
|
||||
// Receive a message from MessageHandler.
|
||||
@ -188,6 +205,11 @@ private:
|
||||
struct AudioTrack : public Track
|
||||
{
|
||||
AudioTrack();
|
||||
|
||||
private:
|
||||
// Forbidden
|
||||
AudioTrack(const AudioTrack &rhs) MOZ_DELETE;
|
||||
const AudioTrack &operator=(const AudioTrack &rhs) MOZ_DELETE;
|
||||
};
|
||||
|
||||
struct VideoTrack : public Track
|
||||
@ -203,6 +225,11 @@ private:
|
||||
nsIntSize mFrameSize;
|
||||
nsIntRect mPictureRect;
|
||||
gfx::IntRect mRelativePictureRect;
|
||||
|
||||
private:
|
||||
// Forbidden
|
||||
VideoTrack(const VideoTrack &rhs) MOZ_DELETE;
|
||||
const VideoTrack &operator=(const VideoTrack &rhs) MOZ_DELETE;
|
||||
};
|
||||
|
||||
struct CodecBufferInfo
|
||||
@ -217,6 +244,101 @@ private:
|
||||
uint32_t mFlags;
|
||||
};
|
||||
|
||||
class SignalObject
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SignalObject)
|
||||
|
||||
SignalObject(const char* aName);
|
||||
~SignalObject();
|
||||
void Wait();
|
||||
void Signal();
|
||||
|
||||
private:
|
||||
// Forbidden
|
||||
SignalObject() MOZ_DELETE;
|
||||
SignalObject(const SignalObject &rhs) MOZ_DELETE;
|
||||
const SignalObject &operator=(const SignalObject &rhs) MOZ_DELETE;
|
||||
|
||||
Monitor mMonitor;
|
||||
bool mSignaled;
|
||||
};
|
||||
|
||||
class ParseCachedDataRunnable : public nsRunnable
|
||||
{
|
||||
public:
|
||||
ParseCachedDataRunnable(nsRefPtr<MediaCodecReader> aReader,
|
||||
const char* aBuffer,
|
||||
uint32_t aLength,
|
||||
int64_t aOffset,
|
||||
nsRefPtr<SignalObject> aSignal);
|
||||
|
||||
NS_IMETHOD Run() MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
// Forbidden
|
||||
ParseCachedDataRunnable() MOZ_DELETE;
|
||||
ParseCachedDataRunnable(const ParseCachedDataRunnable &rhs) MOZ_DELETE;
|
||||
const ParseCachedDataRunnable &operator=(const ParseCachedDataRunnable &rhs) MOZ_DELETE;
|
||||
|
||||
nsRefPtr<MediaCodecReader> mReader;
|
||||
nsAutoArrayPtr<const char> mBuffer;
|
||||
uint32_t mLength;
|
||||
int64_t mOffset;
|
||||
nsRefPtr<SignalObject> mSignal;
|
||||
};
|
||||
friend class ParseCachedDataRunnable;
|
||||
|
||||
class ProcessCachedDataTask : public Task
|
||||
{
|
||||
public:
|
||||
ProcessCachedDataTask(nsRefPtr<MediaCodecReader> aReader,
|
||||
int64_t aOffset);
|
||||
|
||||
void Run() MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
// Forbidden
|
||||
ProcessCachedDataTask() MOZ_DELETE;
|
||||
ProcessCachedDataTask(const ProcessCachedDataTask &rhs) MOZ_DELETE;
|
||||
const ProcessCachedDataTask &operator=(const ProcessCachedDataTask &rhs) MOZ_DELETE;
|
||||
|
||||
nsRefPtr<MediaCodecReader> mReader;
|
||||
int64_t mOffset;
|
||||
};
|
||||
friend class ProcessCachedDataTask;
|
||||
|
||||
// This class is used to keep one reference count of T in it. And this class
|
||||
// can make sure the stored reference count will be released on the dispatched
|
||||
// thread. By using this class properly (ex. passing the pointer into this
|
||||
// runnable first, then releasing the original pointer held by ourselves, and
|
||||
// then dispatching this runnable onto the desired thread), we can avoid
|
||||
// running the destructor of the referenced object on any other threads
|
||||
// unexpectedly before this runnable has been executed.
|
||||
template<class T>
|
||||
class ReferenceKeeperRunnable : public nsRunnable
|
||||
{
|
||||
public:
|
||||
ReferenceKeeperRunnable(nsRefPtr<T> aPointer)
|
||||
: mPointer(aPointer)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHOD Run() MOZ_OVERRIDE
|
||||
{
|
||||
mPointer = nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
// Forbidden
|
||||
ReferenceKeeperRunnable() MOZ_DELETE;
|
||||
ReferenceKeeperRunnable(const ReferenceKeeperRunnable &rhs) MOZ_DELETE;
|
||||
const ReferenceKeeperRunnable &operator=(const ReferenceKeeperRunnable &rhs) MOZ_DELETE;
|
||||
|
||||
nsRefPtr<T> mPointer;
|
||||
};
|
||||
|
||||
// Forbidden
|
||||
MediaCodecReader() MOZ_DELETE;
|
||||
const MediaCodecReader& operator=(const MediaCodecReader& rhs) MOZ_DELETE;
|
||||
@ -260,6 +382,8 @@ private:
|
||||
mAudioTrack.mTaskQueue);
|
||||
}
|
||||
|
||||
bool TriggerIncrementalParser();
|
||||
|
||||
bool UpdateDuration();
|
||||
bool UpdateAudioInfo();
|
||||
bool UpdateVideoInfo();
|
||||
@ -275,10 +399,17 @@ private:
|
||||
uint8_t* GetColorConverterBuffer(int32_t aWidth, int32_t aHeight);
|
||||
void ClearColorConverterBuffer();
|
||||
|
||||
int64_t ProcessCachedData(int64_t aOffset,
|
||||
nsRefPtr<SignalObject> aSignal);
|
||||
bool ParseDataSegment(const char* aBuffer,
|
||||
uint32_t aLength,
|
||||
int64_t aOffset);
|
||||
|
||||
android::sp<MessageHandler> mHandler;
|
||||
android::sp<VideoResourceListener> mVideoListener;
|
||||
|
||||
android::sp<android::ALooper> mLooper;
|
||||
android::sp<android::MetaData> mMetaData;
|
||||
|
||||
// media tracks
|
||||
AudioTrack mAudioTrack;
|
||||
@ -289,6 +420,13 @@ private:
|
||||
android::I420ColorConverterHelper mColorConverter;
|
||||
nsAutoArrayPtr<uint8_t> mColorConverterBuffer;
|
||||
size_t mColorConverterBufferSize;
|
||||
|
||||
// incremental parser
|
||||
Monitor mParserMonitor;
|
||||
bool mParseDataFromCache;
|
||||
int64_t mNextParserPosition;
|
||||
int64_t mParsedDataLength;
|
||||
nsAutoPtr<MP3FrameParser> mMP3FrameParser;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -18,7 +18,7 @@ namespace dom {
|
||||
class MediaStreamAudioSourceNodeEngine : public AudioNodeEngine
|
||||
{
|
||||
public:
|
||||
MediaStreamAudioSourceNodeEngine(AudioNode* aNode)
|
||||
explicit MediaStreamAudioSourceNodeEngine(AudioNode* aNode)
|
||||
: AudioNodeEngine(aNode), mEnabled(false) {}
|
||||
|
||||
bool IsEnabled() const { return mEnabled; }
|
||||
|
@ -83,6 +83,11 @@ protected:
|
||||
class MediaEngineSource : public nsISupports
|
||||
{
|
||||
public:
|
||||
// code inside webrtc.org assumes these sizes; don't use anything smaller
|
||||
// without verifying it's ok
|
||||
static const unsigned int kMaxDeviceNameLength = 128;
|
||||
static const unsigned int kMaxUniqueIdLength = 256;
|
||||
|
||||
virtual ~MediaEngineSource() {}
|
||||
|
||||
/* Populate the human readable name of this device in the nsAString */
|
||||
|
@ -225,10 +225,8 @@ MediaEngineWebRTC::EnumerateVideoDevices(MediaSourceType aMediaSource,
|
||||
}
|
||||
|
||||
for (int i = 0; i < num; i++) {
|
||||
const unsigned int kMaxDeviceNameLength = 128; // XXX FIX!
|
||||
const unsigned int kMaxUniqueIdLength = 256;
|
||||
char deviceName[kMaxDeviceNameLength];
|
||||
char uniqueId[kMaxUniqueIdLength];
|
||||
char deviceName[MediaEngineSource::kMaxDeviceNameLength];
|
||||
char uniqueId[MediaEngineSource::kMaxUniqueIdLength];
|
||||
|
||||
// paranoia
|
||||
deviceName[0] = '\0';
|
||||
@ -246,10 +244,12 @@ MediaEngineWebRTC::EnumerateVideoDevices(MediaSourceType aMediaSource,
|
||||
LOG((" Capture Device Index %d, Name %s", i, deviceName));
|
||||
|
||||
webrtc::CaptureCapability cap;
|
||||
int numCaps = ptrViECapture->NumberOfCapabilities(uniqueId, kMaxUniqueIdLength);
|
||||
int numCaps = ptrViECapture->NumberOfCapabilities(uniqueId,
|
||||
MediaEngineSource::kMaxUniqueIdLength);
|
||||
LOG(("Number of Capabilities %d", numCaps));
|
||||
for (int j = 0; j < numCaps; j++) {
|
||||
if (ptrViECapture->GetCaptureCapability(uniqueId, kMaxUniqueIdLength,
|
||||
if (ptrViECapture->GetCaptureCapability(uniqueId,
|
||||
MediaEngineSource::kMaxUniqueIdLength,
|
||||
j, cap ) != 0 ) {
|
||||
break;
|
||||
}
|
||||
|
@ -220,9 +220,6 @@ protected:
|
||||
~MediaEngineWebRTCVideoSource() { Shutdown(); }
|
||||
|
||||
private:
|
||||
static const unsigned int KMaxDeviceNameLength = 128;
|
||||
static const unsigned int KMaxUniqueIdLength = 256;
|
||||
|
||||
// Initialize the needed Video engine interfaces.
|
||||
void Init();
|
||||
void Shutdown();
|
||||
@ -350,9 +347,6 @@ protected:
|
||||
int mSamples;
|
||||
|
||||
private:
|
||||
static const unsigned int KMaxDeviceNameLength = 128;
|
||||
static const unsigned int KMaxUniqueIdLength = 256;
|
||||
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
|
@ -218,7 +218,7 @@ MediaEngineWebRTCVideoSource::ChooseCapability(
|
||||
return GuessCapability(aConstraints, aPrefs);
|
||||
#else
|
||||
NS_ConvertUTF16toUTF8 uniqueId(mUniqueId);
|
||||
int num = mViECapture->NumberOfCapabilities(uniqueId.get(), KMaxUniqueIdLength);
|
||||
int num = mViECapture->NumberOfCapabilities(uniqueId.get(), kMaxUniqueIdLength);
|
||||
if (num <= 0) {
|
||||
// Mac doesn't support capabilities.
|
||||
return GuessCapability(aConstraints, aPrefs);
|
||||
@ -240,7 +240,7 @@ MediaEngineWebRTCVideoSource::ChooseCapability(
|
||||
|
||||
for (uint32_t i = 0; i < candidateSet.Length();) {
|
||||
webrtc::CaptureCapability cap;
|
||||
mViECapture->GetCaptureCapability(uniqueId.get(), KMaxUniqueIdLength,
|
||||
mViECapture->GetCaptureCapability(uniqueId.get(), kMaxUniqueIdLength,
|
||||
candidateSet[i], cap);
|
||||
if (!SatisfyConstraintSet(aConstraints.mRequired, cap)) {
|
||||
candidateSet.RemoveElementAt(i);
|
||||
@ -260,7 +260,7 @@ MediaEngineWebRTCVideoSource::ChooseCapability(
|
||||
SourceSet rejects;
|
||||
for (uint32_t j = 0; j < candidateSet.Length();) {
|
||||
webrtc::CaptureCapability cap;
|
||||
mViECapture->GetCaptureCapability(uniqueId.get(), KMaxUniqueIdLength,
|
||||
mViECapture->GetCaptureCapability(uniqueId.get(), kMaxUniqueIdLength,
|
||||
candidateSet[j], cap);
|
||||
if (!SatisfyConstraintSet(array[i], cap)) {
|
||||
rejects.AppendElement(candidateSet[j]);
|
||||
@ -288,7 +288,7 @@ MediaEngineWebRTCVideoSource::ChooseCapability(
|
||||
bool higher = true;
|
||||
for (uint32_t i = 0; i < candidateSet.Length(); i++) {
|
||||
mViECapture->GetCaptureCapability(NS_ConvertUTF16toUTF8(mUniqueId).get(),
|
||||
KMaxUniqueIdLength, candidateSet[i], cap);
|
||||
kMaxUniqueIdLength, candidateSet[i], cap);
|
||||
if (higher) {
|
||||
if (i == 0 ||
|
||||
(mCapability.width > cap.width && mCapability.height > cap.height)) {
|
||||
@ -451,7 +451,7 @@ MediaEngineWebRTCVideoSource::Allocate(const VideoTrackConstraintsN &aConstraint
|
||||
ChooseCapability(aConstraints, aPrefs);
|
||||
|
||||
if (mViECapture->AllocateCaptureDevice(NS_ConvertUTF16toUTF8(mUniqueId).get(),
|
||||
KMaxUniqueIdLength, mCaptureIndex)) {
|
||||
kMaxUniqueIdLength, mCaptureIndex)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
mState = kAllocated;
|
||||
@ -654,13 +654,11 @@ MediaEngineWebRTCVideoSource::Init()
|
||||
return;
|
||||
}
|
||||
|
||||
const uint32_t KMaxDeviceNameLength = 128;
|
||||
const uint32_t KMaxUniqueIdLength = 256;
|
||||
char deviceName[KMaxDeviceNameLength];
|
||||
char uniqueId[KMaxUniqueIdLength];
|
||||
char deviceName[kMaxDeviceNameLength];
|
||||
char uniqueId[kMaxUniqueIdLength];
|
||||
if (mViECapture->GetCaptureDevice(mCaptureIndex,
|
||||
deviceName, KMaxDeviceNameLength,
|
||||
uniqueId, KMaxUniqueIdLength)) {
|
||||
deviceName, kMaxDeviceNameLength,
|
||||
uniqueId, kMaxUniqueIdLength)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -707,15 +705,21 @@ void MediaEngineWebRTCVideoSource::Refresh(int aIndex) {
|
||||
// Caller looked up this source by uniqueId; since deviceName == uniqueId nothing else changes
|
||||
#else
|
||||
// Caller looked up this source by uniqueId, so it shouldn't change
|
||||
const uint32_t KMaxDeviceNameLength = 128;
|
||||
char deviceName[KMaxDeviceNameLength];
|
||||
char deviceName[kMaxDeviceNameLength];
|
||||
char uniqueId[kMaxUniqueIdLength];
|
||||
|
||||
if (mViECapture->GetCaptureDevice(aIndex,
|
||||
deviceName, KMaxDeviceNameLength,
|
||||
nullptr, 0)) {
|
||||
deviceName, sizeof(deviceName),
|
||||
uniqueId, sizeof(uniqueId))) {
|
||||
return;
|
||||
}
|
||||
|
||||
CopyUTF8toUTF16(deviceName, mDeviceName);
|
||||
#ifdef DEBUG
|
||||
nsString temp;
|
||||
CopyUTF8toUTF16(uniqueId, temp);
|
||||
MOZ_ASSERT(temp.Equals(mUniqueId));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -142,10 +142,11 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI, uint32_t aFixup
|
||||
nsresult rv;
|
||||
|
||||
nsAutoCString uriString(aStringURI);
|
||||
uriString.Trim(" "); // Cleanup the empty spaces that might be on each end.
|
||||
|
||||
// Eliminate embedded newlines, which single-line text fields now allow:
|
||||
uriString.StripChars("\r\n");
|
||||
// Cleanup the empty spaces that might be on each end:
|
||||
uriString.Trim(" ");
|
||||
|
||||
NS_ENSURE_TRUE(!uriString.IsEmpty(), NS_ERROR_FAILURE);
|
||||
|
||||
@ -950,7 +951,7 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString,
|
||||
(spaceLoc < qMarkLoc || quoteLoc < qMarkLoc)) ||
|
||||
qMarkLoc == 0)
|
||||
{
|
||||
rv = KeywordToURI(aURIString, aPostData,
|
||||
rv = KeywordToURI(aFixupInfo->mOriginalInput, aPostData,
|
||||
getter_AddRefs(aFixupInfo->mPreferredURI));
|
||||
if (NS_SUCCEEDED(rv) && aFixupInfo->mPreferredURI)
|
||||
{
|
||||
|
@ -60,6 +60,14 @@ let testcases = [
|
||||
[".test", "http://.test/", "http://www..test/", true, true],
|
||||
["mozilla is amazing", null, null, true, true],
|
||||
["mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true],
|
||||
[" mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true],
|
||||
["mozilla \\", null, null, true, true],
|
||||
["mozilla \\ foo.txt", null, null, true, true],
|
||||
["mozilla \\\r foo.txt", null, null, true, true],
|
||||
["mozilla\n", "http://mozilla/", "http://www.mozilla.com/", true, true],
|
||||
["mozilla \r\n", "http://mozilla/", "http://www.mozilla.com/", true, true],
|
||||
["moz\r\nfirefox\nos\r", "http://mozfirefoxos/", "http://www.mozfirefoxos.com/", true, true],
|
||||
["moz\r\n firefox\n", null, null, true, true],
|
||||
["", null, null, true, true],
|
||||
["[]", null, null, true, true]
|
||||
];
|
||||
@ -74,10 +82,13 @@ if (Services.appinfo.OS.toLowerCase().startsWith("win")) {
|
||||
testcases.push(["mozilla\\", "http://mozilla\\/", "http://www.mozilla/", true, true]);
|
||||
}
|
||||
|
||||
function sanitize(input) {
|
||||
return input.replace(/\r|\n/g, "").trim();
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
for (let [testInput, expectedFixedURI, alternativeURI,
|
||||
expectKeywordLookup, expectProtocolChange] of testcases) {
|
||||
testInput = testInput.trim();
|
||||
for (let flags of flagInputs) {
|
||||
let info;
|
||||
let fixupURIOnly = null;
|
||||
@ -121,7 +132,7 @@ function run_test() {
|
||||
|
||||
// Check the preferred URI
|
||||
if (couldDoKeywordLookup && expectKeywordLookup) {
|
||||
let urlparamInput = encodeURIComponent(testInput).replace("%20", "+", "g");
|
||||
let urlparamInput = encodeURIComponent(sanitize(testInput)).replace("%20", "+", "g");
|
||||
let searchURL = kSearchEngineURL.replace("{searchTerms}", urlparamInput);
|
||||
do_check_eq(info.preferredURI.spec, searchURL);
|
||||
} else {
|
||||
@ -129,7 +140,7 @@ function run_test() {
|
||||
// the fixed URI should be preferred:
|
||||
do_check_eq(info.preferredURI.spec, info.fixedURI.spec);
|
||||
}
|
||||
do_check_eq(testInput, info.originalInput);
|
||||
do_check_eq(sanitize(testInput), info.originalInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
return activity.forget();
|
||||
}
|
||||
|
||||
Activity(nsPIDOMWindow* aWindow);
|
||||
explicit Activity(nsPIDOMWindow* aWindow);
|
||||
|
||||
protected:
|
||||
nsresult Initialize(nsPIDOMWindow* aWindow,
|
||||
|
@ -18,7 +18,7 @@ namespace dom {
|
||||
class AnimationEffect MOZ_FINAL : public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
AnimationEffect(Animation* aAnimation)
|
||||
explicit AnimationEffect(Animation* aAnimation)
|
||||
: mAnimation(aAnimation)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
|
@ -54,7 +54,7 @@ class ArchiveReaderEvent : public nsRunnable
|
||||
public:
|
||||
NS_DECL_NSIRUNNABLE
|
||||
|
||||
ArchiveReaderEvent(ArchiveReader* aArchiveReader);
|
||||
explicit ArchiveReaderEvent(ArchiveReader* aArchiveReader);
|
||||
|
||||
protected:
|
||||
virtual ~ArchiveReaderEvent();
|
||||
|
@ -23,8 +23,8 @@ class ArchiveRequestEvent : public nsRunnable
|
||||
public:
|
||||
NS_DECL_NSIRUNNABLE
|
||||
|
||||
ArchiveRequestEvent(ArchiveRequest* request)
|
||||
: mRequest(request)
|
||||
explicit ArchiveRequestEvent(ArchiveRequest* aRequest)
|
||||
: mRequest(aRequest)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ArchiveRequestEvent);
|
||||
}
|
||||
|
@ -2670,48 +2670,23 @@ nsDOMWindowUtils::SetAsyncScrollOffset(nsIDOMNode* aNode,
|
||||
if (!element) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
nsIFrame* frame = element->GetPrimaryFrame();
|
||||
if (!frame) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
nsIScrollableFrame* scrollable = do_QueryFrame(frame);
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
|
||||
if (!scrollable) {
|
||||
if (rootScrollFrame && rootScrollFrame->GetContent() == element) {
|
||||
frame = rootScrollFrame;
|
||||
scrollable = do_QueryFrame(frame);
|
||||
}
|
||||
}
|
||||
if (!scrollable) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
Layer* layer = FrameLayerBuilder::GetDedicatedLayer(scrollable->GetScrolledFrame(),
|
||||
nsDisplayItem::TYPE_SCROLL_LAYER);
|
||||
if (!layer) {
|
||||
if (rootScrollFrame == frame && !presContext->GetParentPresContext()) {
|
||||
nsIWidget* widget = GetWidget();
|
||||
if (widget) {
|
||||
LayerManager* manager = widget->GetLayerManager();
|
||||
if (manager) {
|
||||
layer = manager->GetRoot();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!layer) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
}
|
||||
FrameMetrics::ViewID viewId;
|
||||
if (!nsLayoutUtils::FindIDFor(element, &viewId)) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
ShadowLayerForwarder* forwarder = layer->Manager()->AsShadowForwarder();
|
||||
nsIWidget* widget = GetWidget();
|
||||
if (!widget) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
LayerManager* manager = widget->GetLayerManager();
|
||||
if (!manager) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
ShadowLayerForwarder* forwarder = manager->AsShadowForwarder();
|
||||
if (!forwarder || !forwarder->HasShadowManager()) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
forwarder->GetShadowManager()->SendSetAsyncScrollOffset(
|
||||
layer->AsShadowableLayer()->GetShadow(), viewId, aX, aY);
|
||||
forwarder->GetShadowManager()->SendSetAsyncScrollOffset(viewId, aX, aY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -14544,7 +14544,7 @@ class CGEventClass(CGBindingImplClass):
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(${nativeType}, ${parentType})
|
||||
protected:
|
||||
virtual ~${nativeType}();
|
||||
${nativeType}(mozilla::dom::EventTarget* aOwner);
|
||||
explicit ${nativeType}(mozilla::dom::EventTarget* aOwner);
|
||||
|
||||
""",
|
||||
nativeType=self.descriptor.nativeType.split('::')[-1],
|
||||
|
@ -269,7 +269,7 @@ public:
|
||||
StackFrame)
|
||||
|
||||
// aStack must not be null.
|
||||
JSStackFrame(JS::Handle<JSObject*> aStack);
|
||||
explicit JSStackFrame(JS::Handle<JSObject*> aStack);
|
||||
|
||||
static already_AddRefed<nsIStackFrame>
|
||||
CreateStack(JSContext* aCx, int32_t aMaxDepth = -1);
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "nsTArrayForwardDeclare.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
|
||||
class nsCycleCollectionTraversalCallback;
|
||||
|
||||
@ -21,73 +22,66 @@ template <typename T>
|
||||
struct Nullable
|
||||
{
|
||||
private:
|
||||
// mIsNull MUST COME FIRST because otherwise the casting in our array
|
||||
// conversion operators would shift where it is found in the struct.
|
||||
bool mIsNull;
|
||||
T mValue;
|
||||
Maybe<T> mValue;
|
||||
|
||||
public:
|
||||
Nullable()
|
||||
: mIsNull(true)
|
||||
: mValue()
|
||||
{}
|
||||
|
||||
explicit Nullable(T aValue)
|
||||
: mIsNull(false)
|
||||
, mValue(aValue)
|
||||
{}
|
||||
: mValue()
|
||||
{
|
||||
mValue.emplace(aValue);
|
||||
}
|
||||
|
||||
explicit Nullable(Nullable<T>&& aOther)
|
||||
: mIsNull(aOther.mIsNull)
|
||||
, mValue(mozilla::Move(aOther.mValue))
|
||||
: mValue(mozilla::Move(aOther.mValue))
|
||||
{}
|
||||
|
||||
Nullable(const Nullable<T>& aOther)
|
||||
: mIsNull(aOther.mIsNull)
|
||||
, mValue(aOther.mValue)
|
||||
: mValue(aOther.mValue)
|
||||
{}
|
||||
|
||||
void operator=(const Nullable<T>& aOther)
|
||||
{
|
||||
mIsNull = aOther.mIsNull;
|
||||
mValue = aOther.mValue;
|
||||
}
|
||||
|
||||
void SetValue(T aValue) {
|
||||
mValue = aValue;
|
||||
mIsNull = false;
|
||||
mValue.reset();
|
||||
mValue.emplace(aValue);
|
||||
}
|
||||
|
||||
// For cases when |T| is some type with nontrivial copy behavior, we may want
|
||||
// to get a reference to our internal copy of T and work with it directly
|
||||
// instead of relying on the copying version of SetValue().
|
||||
T& SetValue() {
|
||||
mIsNull = false;
|
||||
return mValue;
|
||||
if (mValue.isNothing()) {
|
||||
mValue.emplace();
|
||||
}
|
||||
return mValue.ref();
|
||||
}
|
||||
|
||||
void SetNull() {
|
||||
mIsNull = true;
|
||||
mValue.reset();
|
||||
}
|
||||
|
||||
const T& Value() const {
|
||||
MOZ_ASSERT(!mIsNull);
|
||||
return mValue;
|
||||
return mValue.ref();
|
||||
}
|
||||
|
||||
T& Value() {
|
||||
MOZ_ASSERT(!mIsNull);
|
||||
return mValue;
|
||||
return mValue.ref();
|
||||
}
|
||||
|
||||
bool IsNull() const {
|
||||
return mIsNull;
|
||||
return mValue.isNothing();
|
||||
}
|
||||
|
||||
bool Equals(const Nullable<T>& aOtherNullable) const
|
||||
{
|
||||
return (mIsNull && aOtherNullable.mIsNull) ||
|
||||
(!mIsNull && !aOtherNullable.mIsNull &&
|
||||
mValue == aOtherNullable.mValue);
|
||||
return mValue == aOtherNullable.mValue;
|
||||
}
|
||||
|
||||
bool operator==(const Nullable<T>& aOtherNullable) const
|
||||
@ -99,23 +93,6 @@ public:
|
||||
{
|
||||
return !Equals(aOtherNullable);
|
||||
}
|
||||
|
||||
// Make it possible to use a const Nullable of an array type with other
|
||||
// array types.
|
||||
template<typename U>
|
||||
operator const Nullable< nsTArray<U> >&() const {
|
||||
// Make sure that T is ok to reinterpret to nsTArray<U>
|
||||
const nsTArray<U>& arr = mValue;
|
||||
(void)arr;
|
||||
return *reinterpret_cast<const Nullable< nsTArray<U> >*>(this);
|
||||
}
|
||||
template<typename U>
|
||||
operator const Nullable< FallibleTArray<U> >&() const {
|
||||
// Make sure that T is ok to reinterpret to FallibleTArray<U>
|
||||
const FallibleTArray<U>& arr = mValue;
|
||||
(void)arr;
|
||||
return *reinterpret_cast<const Nullable< FallibleTArray<U> >*>(this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ class TestCImplementedInterface2 : public nsISupports,
|
||||
public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
TestCImplementedInterface2(nsPIDOMWindow* aParent)
|
||||
explicit TestCImplementedInterface2(nsPIDOMWindow* aParent)
|
||||
{}
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestCImplementedInterface2)
|
||||
|
@ -362,6 +362,10 @@ enum ControlPlayStatus {
|
||||
PLAYSTATUS_ERROR = 0xFF,
|
||||
};
|
||||
|
||||
enum {
|
||||
AVRCP_UID_SIZE = 8
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpMediaAttribute {
|
||||
AVRCP_MEDIA_ATTRIBUTE_TITLE,
|
||||
AVRCP_MEDIA_ATTRIBUTE_ARTIST,
|
||||
|
@ -31,12 +31,9 @@ namespace {
|
||||
StaticRefPtr<BluetoothA2dpManager> sBluetoothA2dpManager;
|
||||
bool sInShutdown = false;
|
||||
static BluetoothA2dpInterface* sBtA2dpInterface;
|
||||
#if ANDROID_VERSION > 17
|
||||
static BluetoothAvrcpInterface* sBtAvrcpInterface;
|
||||
#endif
|
||||
} // anonymous namespace
|
||||
|
||||
#if ANDROID_VERSION > 17
|
||||
/*
|
||||
* This function maps attribute id and returns corresponding values
|
||||
*/
|
||||
@ -72,7 +69,6 @@ ConvertAttributeString(BluetoothAvrcpMediaAttribute aAttrId,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
BluetoothA2dpManager::Observe(nsISupports* aSubject,
|
||||
@ -105,20 +101,25 @@ BluetoothA2dpManager::Reset()
|
||||
static void
|
||||
AvStatusToSinkString(BluetoothA2dpConnectionState aState, nsAString& aString)
|
||||
{
|
||||
static const nsLiteralString sString[] = {
|
||||
[A2DP_CONNECTION_STATE_DISCONNECTED] = NS_LITERAL_STRING("disconnected"),
|
||||
[A2DP_CONNECTION_STATE_CONNECTING] = NS_LITERAL_STRING("connecting"),
|
||||
[A2DP_CONNECTION_STATE_CONNECTED] = NS_LITERAL_STRING("connected"),
|
||||
[A2DP_CONNECTION_STATE_DISCONNECTING] = NS_LITERAL_STRING("disconnecting")
|
||||
};
|
||||
if (aState >= MOZ_ARRAY_LENGTH(sString)) {
|
||||
BT_WARNING("Unknown sink state %d", static_cast<int>(aState));
|
||||
return;
|
||||
switch (aState) {
|
||||
case A2DP_CONNECTION_STATE_DISCONNECTED:
|
||||
aString.AssignLiteral("disconnected");
|
||||
break;
|
||||
case A2DP_CONNECTION_STATE_CONNECTING:
|
||||
aString.AssignLiteral("connecting");
|
||||
break;
|
||||
case A2DP_CONNECTION_STATE_CONNECTED:
|
||||
aString.AssignLiteral("connected");
|
||||
break;
|
||||
case A2DP_CONNECTION_STATE_DISCONNECTING:
|
||||
aString.AssignLiteral("disconnecting");
|
||||
break;
|
||||
default:
|
||||
BT_WARNING("Unknown sink state %d", static_cast<int>(aState));
|
||||
return;
|
||||
}
|
||||
aString = sString[aState];
|
||||
}
|
||||
|
||||
#if ANDROID_VERSION > 17
|
||||
class InitAvrcpResultHandler MOZ_FINAL : public BluetoothAvrcpResultHandler
|
||||
{
|
||||
public:
|
||||
@ -131,7 +132,15 @@ public:
|
||||
BT_WARNING("BluetoothAvrcpInterface::Init failed: %d",
|
||||
(int)aStatus);
|
||||
if (mRes) {
|
||||
mRes->OnError(NS_ERROR_FAILURE);
|
||||
if (aStatus == STATUS_UNSUPPORTED) {
|
||||
/* Not all versions of Bluedroid support AVRCP. So if the
|
||||
* initialization fails with STATUS_UNSUPPORTED, we still
|
||||
* signal success.
|
||||
*/
|
||||
mRes->Init();
|
||||
} else {
|
||||
mRes->OnError(NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,7 +154,6 @@ public:
|
||||
private:
|
||||
nsRefPtr<BluetoothProfileResultHandler> mRes;
|
||||
};
|
||||
#endif
|
||||
|
||||
class InitA2dpResultHandler MOZ_FINAL : public BluetoothA2dpResultHandler
|
||||
{
|
||||
@ -165,22 +173,20 @@ public:
|
||||
|
||||
void Init() MOZ_OVERRIDE
|
||||
{
|
||||
#if ANDROID_VERSION > 17
|
||||
/* Also init AVRCP if it's available, ... */
|
||||
BluetoothInterface* btInf = BluetoothInterface::GetInstance();
|
||||
NS_ENSURE_TRUE_VOID(btInf);
|
||||
if (NS_WARN_IF(!btInf)) {
|
||||
mRes->OnError(NS_ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
sBtAvrcpInterface = btInf->GetBluetoothAvrcpInterface();
|
||||
NS_ENSURE_TRUE_VOID(sBtAvrcpInterface);
|
||||
if (NS_WARN_IF(!sBtAvrcpInterface)) {
|
||||
mRes->OnError(NS_ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
BluetoothA2dpManager* a2dpManager = BluetoothA2dpManager::Get();
|
||||
sBtAvrcpInterface->Init(a2dpManager, new InitAvrcpResultHandler(mRes));
|
||||
#else
|
||||
/* ...or signal success otherwise. */
|
||||
if (mRes) {
|
||||
mRes->Init();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
@ -278,7 +284,6 @@ BluetoothA2dpManager::Get()
|
||||
return sBluetoothA2dpManager;
|
||||
}
|
||||
|
||||
#if ANDROID_VERSION > 17
|
||||
class CleanupAvrcpResultHandler MOZ_FINAL : public BluetoothAvrcpResultHandler
|
||||
{
|
||||
public:
|
||||
@ -291,7 +296,15 @@ public:
|
||||
BT_WARNING("BluetoothAvrcpInterface::Cleanup failed: %d",
|
||||
(int)aStatus);
|
||||
if (mRes) {
|
||||
mRes->OnError(NS_ERROR_FAILURE);
|
||||
if (aStatus == STATUS_UNSUPPORTED) {
|
||||
/* Not all versions of Bluedroid support AVRCP. So if the
|
||||
* cleanup fails with STATUS_UNSUPPORTED, we still signal
|
||||
* success.
|
||||
*/
|
||||
mRes->Deinit();
|
||||
} else {
|
||||
mRes->OnError(NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -306,7 +319,6 @@ public:
|
||||
private:
|
||||
nsRefPtr<BluetoothProfileResultHandler> mRes;
|
||||
};
|
||||
#endif
|
||||
|
||||
class CleanupA2dpResultHandler MOZ_FINAL : public BluetoothA2dpResultHandler
|
||||
{
|
||||
@ -327,15 +339,8 @@ public:
|
||||
void Cleanup() MOZ_OVERRIDE
|
||||
{
|
||||
sBtA2dpInterface = nullptr;
|
||||
#if ANDROID_VERSION > 17
|
||||
/* Cleanup AVRCP if it's available and initialized, ...*/
|
||||
if (sBtAvrcpInterface) {
|
||||
sBtAvrcpInterface->Cleanup(new CleanupAvrcpResultHandler(mRes));
|
||||
} else
|
||||
#endif
|
||||
if (mRes) {
|
||||
/* ...or simply signal success from here. */
|
||||
mRes->Deinit();
|
||||
}
|
||||
}
|
||||
|
||||
@ -353,15 +358,8 @@ public:
|
||||
NS_IMETHOD Run() MOZ_OVERRIDE
|
||||
{
|
||||
sBtA2dpInterface = nullptr;
|
||||
#if ANDROID_VERSION > 17
|
||||
/* Cleanup AVRCP if it's available and initialized, ...*/
|
||||
if (sBtAvrcpInterface) {
|
||||
sBtAvrcpInterface->Cleanup(new CleanupAvrcpResultHandler(mRes));
|
||||
} else
|
||||
#endif
|
||||
if (mRes) {
|
||||
/* ...or simply signal success from here. */
|
||||
mRes->Deinit();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -718,7 +716,6 @@ BluetoothA2dpManager::UpdateMetaData(const nsAString& aTitle,
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
#if ANDROID_VERSION > 17
|
||||
NS_ENSURE_TRUE_VOID(sBtAvrcpInterface);
|
||||
|
||||
// Send track changed and position changed if track num is not the same.
|
||||
@ -728,8 +725,8 @@ BluetoothA2dpManager::UpdateMetaData(const nsAString& aTitle,
|
||||
BluetoothAvrcpNotificationParam param;
|
||||
// convert to network big endian format
|
||||
// since track stores as uint8[8]
|
||||
// 56 = 8 * (BTRC_UID_SIZE -1)
|
||||
for (int i = 0; i < BTRC_UID_SIZE; ++i) {
|
||||
// 56 = 8 * (AVRCP_UID_SIZE -1)
|
||||
for (int i = 0; i < AVRCP_UID_SIZE; ++i) {
|
||||
param.mTrack[i] = (aMediaNumber >> (56 - 8 * i));
|
||||
}
|
||||
mTrackChangedNotifyType = AVRCP_NTF_CHANGED;
|
||||
@ -752,7 +749,6 @@ BluetoothA2dpManager::UpdateMetaData(const nsAString& aTitle,
|
||||
mMediaNumber = aMediaNumber;
|
||||
mTotalMediaCount = aTotalMediaCount;
|
||||
mDuration = aDuration;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -766,7 +762,6 @@ BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration,
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
#if ANDROID_VERSION > 17
|
||||
NS_ENSURE_TRUE_VOID(sBtAvrcpInterface);
|
||||
// always update playstatus first
|
||||
sBtAvrcpInterface->GetPlayStatusRsp(aPlayStatus, aDuration,
|
||||
@ -795,7 +790,6 @@ BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration,
|
||||
mDuration = aDuration;
|
||||
mPosition = aPosition;
|
||||
mPlayStatus = aPlayStatus;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -811,7 +805,6 @@ BluetoothA2dpManager::UpdateRegisterNotification(BluetoothAvrcpEvent aEvent,
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
#if ANDROID_VERSION > 17
|
||||
NS_ENSURE_TRUE_VOID(sBtAvrcpInterface);
|
||||
|
||||
BluetoothAvrcpNotificationParam param;
|
||||
@ -832,7 +825,7 @@ BluetoothA2dpManager::UpdateRegisterNotification(BluetoothAvrcpEvent aEvent,
|
||||
mTrackChangedNotifyType = AVRCP_NTF_INTERIM;
|
||||
// needs to convert to network big endian format since track stores
|
||||
// as uint8[8]. 56 = 8 * (BTRC_UID_SIZE -1).
|
||||
for (int index = 0; index < BTRC_UID_SIZE; ++index) {
|
||||
for (int index = 0; index < AVRCP_UID_SIZE; ++index) {
|
||||
// We cannot easily check if a track is selected, so whenever A2DP is
|
||||
// streaming, we assume a track is selected.
|
||||
if (mSinkState == BluetoothA2dpManager::SinkState::SINK_PLAYING) {
|
||||
@ -858,7 +851,6 @@ BluetoothA2dpManager::UpdateRegisterNotification(BluetoothAvrcpEvent aEvent,
|
||||
|
||||
sBtAvrcpInterface->RegisterNotificationRsp(aEvent, AVRCP_NTF_INTERIM,
|
||||
param, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@ -1052,10 +1044,8 @@ BluetoothA2dpManager::GetElementAttrNotification(
|
||||
attrs[i].mValue);
|
||||
}
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
MOZ_ASSERT(sBtAvrcpInterface);
|
||||
sBtAvrcpInterface->GetElementAttrRsp(aNumAttrs, attrs, nullptr);
|
||||
#endif // ANDROID_VERSION >= 18
|
||||
}
|
||||
|
||||
void
|
||||
@ -1069,9 +1059,7 @@ BluetoothA2dpManager::RegisterNotificationNotification(
|
||||
return;
|
||||
}
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
a2dp->UpdateRegisterNotification(aEvent, aParam);
|
||||
#endif // ANDROID_VERSION >= 18
|
||||
}
|
||||
|
||||
/* This method is used to get CT features from the Feature Bit Mask. If
|
||||
|
@ -4,11 +4,11 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "BluetoothInterface.h"
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include "base/message_loop.h"
|
||||
#include "BluetoothInterface.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
@ -2986,6 +2986,7 @@ struct interface_traits<BluetoothAvrcpInterface>
|
||||
return BT_PROFILE_AV_RC_ID;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
typedef
|
||||
BluetoothInterfaceRunnable0<BluetoothAvrcpResultHandler, void>
|
||||
@ -3018,7 +3019,6 @@ DispatchBluetoothAvrcpResult(
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Notification handling
|
||||
//
|
||||
@ -3026,7 +3026,6 @@ DispatchBluetoothAvrcpResult(
|
||||
BluetoothAvrcpNotificationHandler::~BluetoothAvrcpNotificationHandler()
|
||||
{ }
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
static BluetoothAvrcpNotificationHandler* sAvrcpNotificationHandler;
|
||||
|
||||
struct BluetoothAvrcpCallback
|
||||
@ -3092,7 +3091,6 @@ struct BluetoothAvrcpCallback
|
||||
BluetoothAvrcpEvent, uint32_t>
|
||||
RegisterNotificationNotification;
|
||||
|
||||
#if ANDROID_VERSION >= 19
|
||||
typedef BluetoothNotificationRunnable2<AvrcpNotificationHandlerWrapper,
|
||||
void,
|
||||
nsString, unsigned long,
|
||||
@ -3108,10 +3106,10 @@ struct BluetoothAvrcpCallback
|
||||
void,
|
||||
int, int>
|
||||
PassthroughCmdNotification;
|
||||
#endif // ANDROID_VERSION >= 19
|
||||
|
||||
// Bluedroid AVRCP callbacks
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
static void
|
||||
GetPlayStatus()
|
||||
{
|
||||
@ -3181,6 +3179,7 @@ struct BluetoothAvrcpCallback
|
||||
&BluetoothAvrcpNotificationHandler::RegisterNotificationNotification,
|
||||
aEvent, aParam);
|
||||
}
|
||||
#endif // ANDROID_VERSION >= 18
|
||||
|
||||
#if ANDROID_VERSION >= 19
|
||||
static void
|
||||
@ -3213,10 +3212,17 @@ struct BluetoothAvrcpCallback
|
||||
//
|
||||
|
||||
BluetoothAvrcpInterface::BluetoothAvrcpInterface(
|
||||
const btrc_interface_t* aInterface)
|
||||
#if ANDROID_VERSION >= 18
|
||||
const btrc_interface_t* aInterface
|
||||
#endif
|
||||
)
|
||||
#if ANDROID_VERSION >= 18
|
||||
: mInterface(aInterface)
|
||||
#endif
|
||||
{
|
||||
#if ANDROID_VERSION >= 18
|
||||
MOZ_ASSERT(mInterface);
|
||||
#endif
|
||||
}
|
||||
|
||||
BluetoothAvrcpInterface::~BluetoothAvrcpInterface()
|
||||
@ -3227,6 +3233,7 @@ BluetoothAvrcpInterface::Init(
|
||||
BluetoothAvrcpNotificationHandler* aNotificationHandler,
|
||||
BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
#if ANDROID_VERSION >= 18
|
||||
static btrc_callbacks_t sCallbacks = {
|
||||
sizeof(sCallbacks),
|
||||
#if ANDROID_VERSION >= 19
|
||||
@ -3247,10 +3254,15 @@ BluetoothAvrcpInterface::Init(
|
||||
BluetoothAvrcpCallback::PassthroughCmd
|
||||
#endif
|
||||
};
|
||||
#endif // ANDROID_VERSION >= 18
|
||||
|
||||
sAvrcpNotificationHandler = aNotificationHandler;
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
bt_status_t status = mInterface->init(&sCallbacks);
|
||||
#else
|
||||
bt_status_t status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(aRes, &BluetoothAvrcpResultHandler::Init,
|
||||
@ -3261,7 +3273,9 @@ BluetoothAvrcpInterface::Init(
|
||||
void
|
||||
BluetoothAvrcpInterface::Cleanup(BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
#if ANDROID_VERSION >= 18
|
||||
mInterface->cleanup();
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(aRes, &BluetoothAvrcpResultHandler::Cleanup,
|
||||
@ -3275,6 +3289,8 @@ BluetoothAvrcpInterface::GetPlayStatusRsp(ControlPlayStatus aPlayStatus,
|
||||
BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status;
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
btrc_play_status_t playStatus = BTRC_PLAYSTATE_STOPPED;
|
||||
|
||||
if (!(NS_FAILED(Convert(aPlayStatus, playStatus)))) {
|
||||
@ -3282,6 +3298,9 @@ BluetoothAvrcpInterface::GetPlayStatusRsp(ControlPlayStatus aPlayStatus,
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#else
|
||||
status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(
|
||||
@ -3296,6 +3315,8 @@ BluetoothAvrcpInterface::ListPlayerAppAttrRsp(
|
||||
BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status;
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
ConvertArray<BluetoothAvrcpPlayerAttribute> pAttrsArray(aPAttrs, aNumAttr);
|
||||
nsAutoArrayPtr<btrc_player_attr_t> pAttrs;
|
||||
|
||||
@ -3304,6 +3325,9 @@ BluetoothAvrcpInterface::ListPlayerAppAttrRsp(
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#else
|
||||
status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(
|
||||
@ -3316,7 +3340,11 @@ void
|
||||
BluetoothAvrcpInterface::ListPlayerAppValueRsp(
|
||||
int aNumVal, uint8_t* aPVals, BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
#if ANDROID_VERSION >= 18
|
||||
bt_status_t status = mInterface->list_player_app_value_rsp(aNumVal, aPVals);
|
||||
#else
|
||||
bt_status_t status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(
|
||||
@ -3331,6 +3359,8 @@ BluetoothAvrcpInterface::GetPlayerAppValueRsp(
|
||||
BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status;
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
btrc_player_settings_t pVals;
|
||||
|
||||
/* FIXME: you need to implement the missing conversion functions */
|
||||
@ -3341,6 +3371,9 @@ BluetoothAvrcpInterface::GetPlayerAppValueRsp(
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#else
|
||||
status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(
|
||||
@ -3355,6 +3388,8 @@ BluetoothAvrcpInterface::GetPlayerAppAttrTextRsp(
|
||||
BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status;
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
btrc_player_setting_text_t* aPAttrs;
|
||||
|
||||
/* FIXME: you need to implement the missing conversion functions */
|
||||
@ -3365,6 +3400,9 @@ BluetoothAvrcpInterface::GetPlayerAppAttrTextRsp(
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#else
|
||||
status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(
|
||||
@ -3379,6 +3417,8 @@ BluetoothAvrcpInterface::GetPlayerAppValueTextRsp(
|
||||
BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status;
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
btrc_player_setting_text_t* pVals;
|
||||
|
||||
/* FIXME: you need to implement the missing conversion functions */
|
||||
@ -3389,6 +3429,9 @@ BluetoothAvrcpInterface::GetPlayerAppValueTextRsp(
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#else
|
||||
status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(
|
||||
@ -3403,6 +3446,8 @@ BluetoothAvrcpInterface::GetElementAttrRsp(
|
||||
BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status;
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
ConvertArray<BluetoothAvrcpElementAttribute> pAttrsArray(aAttrs, aNumAttr);
|
||||
nsAutoArrayPtr<btrc_element_attr_val_t> pAttrs;
|
||||
|
||||
@ -3411,6 +3456,9 @@ BluetoothAvrcpInterface::GetElementAttrRsp(
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#else
|
||||
status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(
|
||||
@ -3424,6 +3472,8 @@ BluetoothAvrcpInterface::SetPlayerAppValueRsp(
|
||||
BluetoothAvrcpStatus aRspStatus, BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status;
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
btrc_status_t rspStatus = BTRC_STS_BAD_CMD; // silences compiler warning
|
||||
|
||||
if (NS_SUCCEEDED(Convert(aRspStatus, rspStatus))) {
|
||||
@ -3431,6 +3481,9 @@ BluetoothAvrcpInterface::SetPlayerAppValueRsp(
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#else
|
||||
status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(
|
||||
@ -3445,8 +3498,10 @@ BluetoothAvrcpInterface::RegisterNotificationRsp(
|
||||
const BluetoothAvrcpNotificationParam& aParam,
|
||||
BluetoothAvrcpResultHandler* aRes)
|
||||
{
|
||||
nsresult rv;
|
||||
bt_status_t status;
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
nsresult rv;
|
||||
btrc_event_id_t event = { };
|
||||
btrc_notification_type_t type = BTRC_NOTIFICATION_TYPE_INTERIM;
|
||||
btrc_register_notification_t param;
|
||||
@ -3489,6 +3544,9 @@ BluetoothAvrcpInterface::RegisterNotificationRsp(
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#else
|
||||
status = BT_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
|
||||
if (aRes) {
|
||||
DispatchBluetoothAvrcpResult(
|
||||
@ -3513,7 +3571,6 @@ BluetoothAvrcpInterface::SetVolume(uint8_t aVolume,
|
||||
ConvertDefault(status, STATUS_FAIL));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Bluetooth Core Interface
|
||||
@ -4292,14 +4349,8 @@ BluetoothInterface::LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
|
||||
template <class T>
|
||||
T*
|
||||
BluetoothInterface::GetProfileInterface()
|
||||
BluetoothInterface::CreateProfileInterface()
|
||||
{
|
||||
static T* sBluetoothProfileInterface;
|
||||
|
||||
if (sBluetoothProfileInterface) {
|
||||
return sBluetoothProfileInterface;
|
||||
}
|
||||
|
||||
typename interface_traits<T>::const_interface_type* interface =
|
||||
reinterpret_cast<typename interface_traits<T>::const_interface_type*>(
|
||||
mInterface->get_profile_interface(interface_traits<T>::profile_id()));
|
||||
@ -4315,7 +4366,36 @@ BluetoothInterface::GetProfileInterface()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
sBluetoothProfileInterface = new T(interface);
|
||||
return new T(interface);
|
||||
}
|
||||
|
||||
#if ANDROID_VERSION < 18
|
||||
/*
|
||||
* Bluedroid versions that don't support AVRCP will call this function
|
||||
* to create an AVRCP interface. All interface methods will fail with
|
||||
* the error constant STATUS_UNSUPPORTED.
|
||||
*/
|
||||
template <>
|
||||
BluetoothAvrcpInterface*
|
||||
BluetoothInterface::CreateProfileInterface<BluetoothAvrcpInterface>()
|
||||
{
|
||||
BT_WARNING("Bluetooth profile 'avrcp' is not supported");
|
||||
|
||||
return new BluetoothAvrcpInterface();
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
T*
|
||||
BluetoothInterface::GetProfileInterface()
|
||||
{
|
||||
static T* sBluetoothProfileInterface;
|
||||
|
||||
if (sBluetoothProfileInterface) {
|
||||
return sBluetoothProfileInterface;
|
||||
}
|
||||
|
||||
sBluetoothProfileInterface = CreateProfileInterface<T>();
|
||||
|
||||
return sBluetoothProfileInterface;
|
||||
}
|
||||
@ -4341,11 +4421,7 @@ BluetoothInterface::GetBluetoothA2dpInterface()
|
||||
BluetoothAvrcpInterface*
|
||||
BluetoothInterface::GetBluetoothAvrcpInterface()
|
||||
{
|
||||
#if ANDROID_VERSION >= 18
|
||||
return GetProfileInterface<BluetoothAvrcpInterface>();
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
@ -427,7 +427,6 @@ public:
|
||||
|
||||
class BluetoothAvrcpInterface
|
||||
{
|
||||
#if ANDROID_VERSION >= 18
|
||||
public:
|
||||
friend class BluetoothInterface;
|
||||
|
||||
@ -473,10 +472,15 @@ public:
|
||||
void SetVolume(uint8_t aVolume, BluetoothAvrcpResultHandler* aRes);
|
||||
|
||||
protected:
|
||||
BluetoothAvrcpInterface(const btrc_interface_t* aInterface);
|
||||
BluetoothAvrcpInterface(
|
||||
#if ANDROID_VERSION >= 18
|
||||
const btrc_interface_t* aInterface
|
||||
#endif
|
||||
);
|
||||
~BluetoothAvrcpInterface();
|
||||
|
||||
private:
|
||||
#if ANDROID_VERSION >= 18
|
||||
const btrc_interface_t* mInterface;
|
||||
#endif
|
||||
};
|
||||
@ -657,6 +661,9 @@ protected:
|
||||
~BluetoothInterface();
|
||||
|
||||
private:
|
||||
template <class T>
|
||||
T* CreateProfileInterface();
|
||||
|
||||
template <class T>
|
||||
T* GetProfileInterface();
|
||||
|
||||
|
@ -201,8 +201,8 @@ BluetoothHfpManager::Cleanup()
|
||||
mReceiveVgsFlag = false;
|
||||
mDialingRequestProcessed = true;
|
||||
|
||||
mConnectionState = BTHF_CONNECTION_STATE_DISCONNECTED;
|
||||
mPrevConnectionState = BTHF_CONNECTION_STATE_DISCONNECTED;
|
||||
mConnectionState = HFP_CONNECTION_STATE_DISCONNECTED;
|
||||
mPrevConnectionState = HFP_CONNECTION_STATE_DISCONNECTED;
|
||||
mBattChg = 5;
|
||||
mService = HFP_NETWORK_STATE_NOT_AVAILABLE;
|
||||
mRoam = HFP_SERVICE_TYPE_HOME;
|
||||
@ -217,7 +217,7 @@ BluetoothHfpManager::Reset()
|
||||
// Phone & Device CIND
|
||||
ResetCallArray();
|
||||
// Clear Sco state
|
||||
mAudioState = BTHF_AUDIO_STATE_DISCONNECTED;
|
||||
mAudioState = HFP_AUDIO_STATE_DISCONNECTED;
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
@ -522,9 +522,9 @@ BluetoothHfpManager::NotifyConnectionStateChanged(const nsAString& aType)
|
||||
mListener->EnumerateCalls();
|
||||
|
||||
OnConnect(EmptyString());
|
||||
} else if (mConnectionState == BTHF_CONNECTION_STATE_DISCONNECTED) {
|
||||
} else if (mConnectionState == HFP_CONNECTION_STATE_DISCONNECTED) {
|
||||
mDeviceAddress.AssignLiteral(BLUETOOTH_ADDRESS_NONE);
|
||||
if (mPrevConnectionState == BTHF_CONNECTION_STATE_DISCONNECTED) {
|
||||
if (mPrevConnectionState == HFP_CONNECTION_STATE_DISCONNECTED) {
|
||||
// Bug 979160: This implies the outgoing connection failure.
|
||||
// When the outgoing hfp connection fails, state changes to disconnected
|
||||
// state. Since bluedroid would not report connecting state, but only
|
||||
@ -1114,13 +1114,13 @@ BluetoothHfpManager::DisconnectSco()
|
||||
bool
|
||||
BluetoothHfpManager::IsScoConnected()
|
||||
{
|
||||
return (mAudioState == BTHF_AUDIO_STATE_CONNECTED);
|
||||
return (mAudioState == HFP_AUDIO_STATE_CONNECTED);
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothHfpManager::IsConnected()
|
||||
{
|
||||
return (mConnectionState == BTHF_CONNECTION_STATE_SLC_CONNECTED);
|
||||
return (mConnectionState == HFP_CONNECTION_STATE_SLC_CONNECTED);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1433,13 +1433,18 @@ void BluetoothHfpManager::DialCallNotification(const nsAString& aNumber)
|
||||
void
|
||||
BluetoothHfpManager::CnumNotification()
|
||||
{
|
||||
static const uint8_t sAddressType[] {
|
||||
[HFP_CALL_ADDRESS_TYPE_UNKNOWN] = 0x81,
|
||||
[HFP_CALL_ADDRESS_TYPE_INTERNATIONAL] = 0x91 // for completeness
|
||||
};
|
||||
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!mMsisdn.IsEmpty()) {
|
||||
nsAutoCString message("+CNUM: ,\"");
|
||||
message.Append(NS_ConvertUTF16toUTF8(mMsisdn).get());
|
||||
message.AppendLiteral("\",");
|
||||
message.AppendInt(BTHF_CALL_ADDRTYPE_UNKNOWN);
|
||||
message.AppendInt(sAddressType[HFP_CALL_ADDRESS_TYPE_UNKNOWN]);
|
||||
message.AppendLiteral(",,4");
|
||||
|
||||
SendLine(message.get());
|
||||
|
@ -170,9 +170,9 @@ private:
|
||||
void SendLine(const char* aMessage);
|
||||
void SendResponse(BluetoothHandsfreeAtResponse aResponseCode);
|
||||
|
||||
int mConnectionState;
|
||||
int mPrevConnectionState;
|
||||
int mAudioState;
|
||||
BluetoothHandsfreeConnectionState mConnectionState;
|
||||
BluetoothHandsfreeConnectionState mPrevConnectionState;
|
||||
BluetoothHandsfreeAudioState mAudioState;
|
||||
// Device CIND
|
||||
int mBattChg;
|
||||
BluetoothHandsfreeNetworkState mService;
|
||||
|
@ -194,6 +194,101 @@ enum BluetoothStatus {
|
||||
STATUS_RMT_DEV_DOWN
|
||||
};
|
||||
|
||||
enum BluetoothBondState {
|
||||
BOND_STATE_NONE,
|
||||
BOND_STATE_BONDING,
|
||||
BOND_STATE_BONDED
|
||||
};
|
||||
|
||||
enum BluetoothDeviceType {
|
||||
DEVICE_TYPE_BREDR,
|
||||
DEVICE_TYPE_BLE,
|
||||
DEVICE_TYPE_DUAL
|
||||
};
|
||||
|
||||
enum BluetoothPropertyType {
|
||||
PROPERTY_BDNAME,
|
||||
PROPERTY_BDADDR,
|
||||
PROPERTY_UUIDS,
|
||||
PROPERTY_CLASS_OF_DEVICE,
|
||||
PROPERTY_TYPE_OF_DEVICE,
|
||||
PROPERTY_SERVICE_RECORD,
|
||||
PROPERTY_ADAPTER_SCAN_MODE,
|
||||
PROPERTY_ADAPTER_BONDED_DEVICES,
|
||||
PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
|
||||
PROPERTY_REMOTE_FRIENDLY_NAME,
|
||||
PROPERTY_REMOTE_RSSI,
|
||||
PROPERTY_REMOTE_VERSION_INFO,
|
||||
PROPERTY_REMOTE_DEVICE_TIMESTAMP
|
||||
};
|
||||
|
||||
enum BluetoothScanMode {
|
||||
SCAN_MODE_NONE,
|
||||
SCAN_MODE_CONNECTABLE,
|
||||
SCAN_MODE_CONNECTABLE_DISCOVERABLE
|
||||
};
|
||||
|
||||
enum BluetoothSspVariant {
|
||||
SSP_VARIANT_PASSKEY_CONFIRMATION,
|
||||
SSP_VARIANT_PASSKEY_ENTRY,
|
||||
SSP_VARIANT_CONSENT,
|
||||
SSP_VARIANT_PASSKEY_NOTIFICATION
|
||||
};
|
||||
|
||||
struct BluetoothUuid {
|
||||
uint8_t mUuid[16];
|
||||
};
|
||||
|
||||
struct BluetoothServiceRecord {
|
||||
BluetoothUuid mUuid;
|
||||
uint16_t mChannel;
|
||||
char mName[256];
|
||||
};
|
||||
|
||||
struct BluetoothRemoteInfo {
|
||||
int mVerMajor;
|
||||
int mVerMinor;
|
||||
int mManufacturer;
|
||||
};
|
||||
|
||||
struct BluetoothProperty {
|
||||
/* Type */
|
||||
BluetoothPropertyType mType;
|
||||
|
||||
/* Value
|
||||
*/
|
||||
|
||||
/* PROPERTY_BDNAME
|
||||
PROPERTY_BDADDR
|
||||
PROPERTY_REMOTE_FRIENDLY_NAME */
|
||||
nsString mString;
|
||||
|
||||
/* PROPERTY_UUIDS */
|
||||
nsTArray<BluetoothUuid> mUuidArray;
|
||||
|
||||
/* PROPERTY_ADAPTER_BONDED_DEVICES */
|
||||
nsTArray<nsString> mStringArray;
|
||||
|
||||
/* PROPERTY_CLASS_OF_DEVICE
|
||||
PROPERTY_ADAPTER_DISCOVERY_TIMEOUT */
|
||||
uint32_t mUint32;
|
||||
|
||||
/* PROPERTY_RSSI_VALUE */
|
||||
int32_t mInt32;
|
||||
|
||||
/* PROPERTY_DEVICE_TYPE */
|
||||
BluetoothDeviceType mDeviceType;
|
||||
|
||||
/* PROPERTY_SERVICE_RECORD */
|
||||
BluetoothServiceRecord mServiceRecord;
|
||||
|
||||
/* PROPERTY_SCAN_MODE */
|
||||
BluetoothScanMode mScanMode;
|
||||
|
||||
/* PROPERTY_REMOTE_VERSION_INFO */
|
||||
BluetoothRemoteInfo mRemoteInfo;
|
||||
};
|
||||
|
||||
enum BluetoothSocketType {
|
||||
RFCOMM = 1,
|
||||
SCO = 2,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -326,6 +326,50 @@ private:
|
||||
// Bluetooth Core Interface
|
||||
//
|
||||
|
||||
class BluetoothNotificationHandler
|
||||
{
|
||||
public:
|
||||
virtual ~BluetoothNotificationHandler();
|
||||
|
||||
virtual void AdapterStateChangedNotification(bool aState) { }
|
||||
virtual void AdapterPropertiesNotification(
|
||||
BluetoothStatus aStatus, int aNumProperties,
|
||||
const BluetoothProperty* aProperties) { }
|
||||
|
||||
virtual void RemoteDevicePropertiesNotification(
|
||||
BluetoothStatus aStatus, const nsAString& aBdAddr,
|
||||
int aNumProperties, const BluetoothProperty* aProperties) { }
|
||||
|
||||
virtual void DeviceFoundNotification(
|
||||
int aNumProperties, const BluetoothProperty* aProperties) { }
|
||||
|
||||
virtual void DiscoveryStateChangedNotification(bool aState) { }
|
||||
|
||||
virtual void PinRequestNotification(const nsAString& aRemoteBdAddr,
|
||||
const nsAString& aBdName, uint32_t aCod) { }
|
||||
virtual void SspRequestNotification(const nsAString& aRemoteBdAddr,
|
||||
const nsAString& aBdName,
|
||||
uint32_t aCod,
|
||||
BluetoothSspVariant aPairingVariant,
|
||||
uint32_t aPassKey) { }
|
||||
|
||||
virtual void BondStateChangedNotification(BluetoothStatus aStatus,
|
||||
const nsAString& aRemoteBdAddr,
|
||||
BluetoothBondState aState) { }
|
||||
virtual void AclStateChangedNotification(BluetoothStatus aStatus,
|
||||
const nsAString& aRemoteBdAddr,
|
||||
bool aState) { }
|
||||
|
||||
virtual void DutModeRecvNotification(uint16_t aOpcode,
|
||||
const uint8_t* aBuf, uint8_t aLen) { }
|
||||
virtual void LeTestModeNotification(BluetoothStatus aStatus,
|
||||
uint16_t aNumPackets) { }
|
||||
|
||||
protected:
|
||||
BluetoothNotificationHandler()
|
||||
{ }
|
||||
};
|
||||
|
||||
class BluetoothResultHandler
|
||||
{
|
||||
public:
|
||||
@ -375,7 +419,8 @@ class BluetoothInterface
|
||||
public:
|
||||
static BluetoothInterface* GetInstance();
|
||||
|
||||
void Init(bt_callbacks_t* aCallbacks, BluetoothResultHandler* aRes);
|
||||
void Init(BluetoothNotificationHandler* aNotificationHandler,
|
||||
BluetoothResultHandler* aRes);
|
||||
void Cleanup(BluetoothResultHandler* aRes);
|
||||
|
||||
void Enable(BluetoothResultHandler* aRes);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -10,11 +10,13 @@
|
||||
#include <hardware/bluetooth.h>
|
||||
|
||||
#include "BluetoothCommon.h"
|
||||
#include "BluetoothInterface.h"
|
||||
#include "BluetoothService.h"
|
||||
|
||||
BEGIN_BLUETOOTH_NAMESPACE
|
||||
|
||||
class BluetoothServiceBluedroid : public BluetoothService
|
||||
, public BluetoothNotificationHandler
|
||||
{
|
||||
public:
|
||||
static const bt_interface_t* GetBluetoothInterface();
|
||||
@ -155,6 +157,46 @@ public:
|
||||
virtual nsresult
|
||||
SendInputMessage(const nsAString& aDeviceAddresses,
|
||||
const nsAString& aMessage) MOZ_OVERRIDE;
|
||||
|
||||
//
|
||||
// Bluetooth notifications
|
||||
//
|
||||
|
||||
virtual void AdapterStateChangedNotification(bool aState) MOZ_OVERRIDE;
|
||||
virtual void AdapterPropertiesNotification(
|
||||
BluetoothStatus aStatus, int aNumProperties,
|
||||
const BluetoothProperty* aProperties) MOZ_OVERRIDE;
|
||||
|
||||
virtual void RemoteDevicePropertiesNotification(
|
||||
BluetoothStatus aStatus, const nsAString& aBdAddr,
|
||||
int aNumProperties, const BluetoothProperty* aProperties) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DeviceFoundNotification(
|
||||
int aNumProperties, const BluetoothProperty* aProperties) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DiscoveryStateChangedNotification(bool aState) MOZ_OVERRIDE;
|
||||
|
||||
virtual void PinRequestNotification(const nsAString& aRemoteBdAddr,
|
||||
const nsAString& aBdName,
|
||||
uint32_t aCod) MOZ_OVERRIDE;
|
||||
virtual void SspRequestNotification(const nsAString& aRemoteBdAddr,
|
||||
const nsAString& aBdName,
|
||||
uint32_t aCod,
|
||||
BluetoothSspVariant aPairingVariant,
|
||||
uint32_t aPasskey) MOZ_OVERRIDE;
|
||||
|
||||
virtual void BondStateChangedNotification(
|
||||
BluetoothStatus aStatus, const nsAString& aRemoteBdAddr,
|
||||
BluetoothBondState aState) MOZ_OVERRIDE;
|
||||
virtual void AclStateChangedNotification(BluetoothStatus aStatus,
|
||||
const nsAString& aRemoteBdAddr,
|
||||
bool aState) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DutModeRecvNotification(uint16_t aOpcode,
|
||||
const uint8_t* aBuf,
|
||||
uint8_t aLen) MOZ_OVERRIDE;
|
||||
virtual void LeTestModeNotification(BluetoothStatus aStatus,
|
||||
uint16_t aNumPackets) MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
@ -23,19 +23,6 @@
|
||||
|
||||
BEGIN_BLUETOOTH_NAMESPACE
|
||||
|
||||
void
|
||||
StringToBdAddressType(const nsAString& aBdAddress,
|
||||
bt_bdaddr_t *aRetBdAddressType)
|
||||
{
|
||||
NS_ConvertUTF16toUTF8 bdAddressUTF8(aBdAddress);
|
||||
const char* str = bdAddressUTF8.get();
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
aRetBdAddressType->address[i] = (uint8_t) strtoul(str, (char **)&str, 16);
|
||||
str++;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BdAddressTypeToString(bt_bdaddr_t* aBdAddressType, nsAString& aRetBdAddress)
|
||||
{
|
||||
@ -50,18 +37,18 @@ BdAddressTypeToString(bt_bdaddr_t* aBdAddressType, nsAString& aRetBdAddress)
|
||||
}
|
||||
|
||||
void
|
||||
UuidToString(bt_uuid_t* aUuid, nsAString& aString) {
|
||||
UuidToString(const BluetoothUuid& aUuid, nsAString& aString)
|
||||
{
|
||||
char uuidStr[37];
|
||||
|
||||
uint32_t uuid0, uuid4;
|
||||
uint16_t uuid1, uuid2, uuid3, uuid5;
|
||||
|
||||
memcpy(&uuid0, &(aUuid->uu[0]), sizeof(uint32_t));
|
||||
memcpy(&uuid1, &(aUuid->uu[4]), sizeof(uint16_t));
|
||||
memcpy(&uuid2, &(aUuid->uu[6]), sizeof(uint16_t));
|
||||
memcpy(&uuid3, &(aUuid->uu[8]), sizeof(uint16_t));
|
||||
memcpy(&uuid4, &(aUuid->uu[10]), sizeof(uint32_t));
|
||||
memcpy(&uuid5, &(aUuid->uu[14]), sizeof(uint16_t));
|
||||
memcpy(&uuid0, &aUuid.mUuid[0], sizeof(uint32_t));
|
||||
memcpy(&uuid1, &aUuid.mUuid[4], sizeof(uint16_t));
|
||||
memcpy(&uuid2, &aUuid.mUuid[6], sizeof(uint16_t));
|
||||
memcpy(&uuid3, &aUuid.mUuid[8], sizeof(uint16_t));
|
||||
memcpy(&uuid4, &aUuid.mUuid[10], sizeof(uint32_t));
|
||||
memcpy(&uuid5, &aUuid.mUuid[14], sizeof(uint16_t));
|
||||
|
||||
sprintf(uuidStr, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x",
|
||||
ntohl(uuid0), ntohs(uuid1),
|
||||
|
@ -27,7 +27,7 @@ BdAddressTypeToString(bt_bdaddr_t* aBdAddressType,
|
||||
nsAString& aRetBdAddress);
|
||||
|
||||
void
|
||||
UuidToString(bt_uuid_t* aUuid, nsAString& aString);
|
||||
UuidToString(const BluetoothUuid& aUuid, nsAString& aString);
|
||||
|
||||
bool
|
||||
SetJsObject(JSContext* aContext,
|
||||
|
@ -11,7 +11,7 @@
|
||||
class RwLockAutoEnterRead
|
||||
{
|
||||
public:
|
||||
RwLockAutoEnterRead(PRRWLock* aRwLock)
|
||||
explicit RwLockAutoEnterRead(PRRWLock* aRwLock)
|
||||
: mRwLock(aRwLock)
|
||||
{
|
||||
MOZ_ASSERT(mRwLock);
|
||||
@ -30,7 +30,7 @@ protected:
|
||||
class RwLockAutoEnterWrite
|
||||
{
|
||||
public:
|
||||
RwLockAutoEnterWrite(PRRWLock* aRwLock)
|
||||
explicit RwLockAutoEnterWrite(PRRWLock* aRwLock)
|
||||
: mRwLock(aRwLock)
|
||||
{
|
||||
MOZ_ASSERT(mRwLock);
|
||||
|
@ -30,7 +30,7 @@ class RecorderProfileManager;
|
||||
class CameraControlImpl : public ICameraControl
|
||||
{
|
||||
public:
|
||||
CameraControlImpl(uint32_t aCameraId);
|
||||
explicit CameraControlImpl(uint32_t aCameraId);
|
||||
virtual void AddListener(CameraControlListener* aListener) MOZ_OVERRIDE;
|
||||
virtual void RemoveListener(CameraControlListener* aListener) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -23,7 +23,7 @@ class CameraPreviewMediaStream : public MediaStream
|
||||
typedef mozilla::layers::Image Image;
|
||||
|
||||
public:
|
||||
CameraPreviewMediaStream(DOMMediaStream* aWrapper);
|
||||
explicit CameraPreviewMediaStream(DOMMediaStream* aWrapper);
|
||||
|
||||
virtual void AddAudioOutput(void* aKey) MOZ_OVERRIDE;
|
||||
virtual void SetAudioOutputVolume(void* aKey, float aVolume) MOZ_OVERRIDE;
|
||||
|
@ -262,7 +262,7 @@ public:
|
||||
nsresult GetJsObject(JSContext* aCx, JSObject** aObject) const;
|
||||
|
||||
protected:
|
||||
RecorderProfileManager(uint32_t aCameraId);
|
||||
explicit RecorderProfileManager(uint32_t aCameraId);
|
||||
virtual ~RecorderProfileManager();
|
||||
|
||||
uint32_t mCameraId;
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
// Great Renaming proposed in bug 983177.
|
||||
static bool HasSupport(JSContext* aCx, JSObject* aGlobal);
|
||||
|
||||
CameraCapabilities(nsPIDOMWindow* aWindow);
|
||||
explicit CameraCapabilities(nsPIDOMWindow* aWindow);
|
||||
|
||||
// Populate the camera capabilities interface from the specific
|
||||
// camera control object.
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMEVENTLISTENER
|
||||
|
||||
StartRecordingHelper(nsDOMCameraControl* aDOMCameraControl)
|
||||
explicit StartRecordingHelper(nsDOMCameraControl* aDOMCameraControl)
|
||||
: mDOMCameraControl(aDOMCameraControl)
|
||||
{
|
||||
MOZ_COUNT_CTOR(StartRecordingHelper);
|
||||
|
@ -145,7 +145,7 @@ protected:
|
||||
NS_INLINE_DECL_REFCOUNTING(DOMCameraConfiguration)
|
||||
|
||||
DOMCameraConfiguration();
|
||||
DOMCameraConfiguration(const dom::CameraConfiguration& aConfiguration);
|
||||
explicit DOMCameraConfiguration(const dom::CameraConfiguration& aConfiguration);
|
||||
|
||||
// Additional configuration options that aren't exposed to the DOM
|
||||
uint32_t mMaxFocusAreas;
|
||||
|
@ -31,7 +31,7 @@ DOMCameraControlListener::~DOMCameraControlListener()
|
||||
class DOMCameraControlListener::DOMCallback : public nsRunnable
|
||||
{
|
||||
public:
|
||||
DOMCallback(nsMainThreadPtrHandle<nsDOMCameraControl> aDOMCameraControl)
|
||||
explicit DOMCallback(nsMainThreadPtrHandle<nsDOMCameraControl> aDOMCameraControl)
|
||||
: mDOMCameraControl(aDOMCameraControl)
|
||||
{
|
||||
MOZ_COUNT_CTOR(DOMCameraControlListener::DOMCallback);
|
||||
@ -276,7 +276,7 @@ DOMCameraControlListener::OnShutter()
|
||||
class Callback : public DOMCallback
|
||||
{
|
||||
public:
|
||||
Callback(nsMainThreadPtrHandle<nsDOMCameraControl> aDOMCameraControl)
|
||||
explicit Callback(nsMainThreadPtrHandle<nsDOMCameraControl> aDOMCameraControl)
|
||||
: DOMCallback(aDOMCameraControl)
|
||||
{ }
|
||||
|
||||
|
@ -22,7 +22,7 @@ namespace mozilla {
|
||||
class FallbackCameraControl : public CameraControlImpl
|
||||
{
|
||||
public:
|
||||
FallbackCameraControl(uint32_t aCameraId) : CameraControlImpl(aCameraId) { }
|
||||
explicit FallbackCameraControl(uint32_t aCameraId) : CameraControlImpl(aCameraId) { }
|
||||
|
||||
virtual nsresult Set(uint32_t aKey, const nsAString& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
virtual nsresult Get(uint32_t aKey, nsAString& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
|
@ -240,7 +240,7 @@ protected:
|
||||
class ICameraControlParameterSetAutoEnter
|
||||
{
|
||||
public:
|
||||
ICameraControlParameterSetAutoEnter(ICameraControl* aCameraControl)
|
||||
explicit ICameraControlParameterSetAutoEnter(ICameraControl* aCameraControl)
|
||||
: mCameraControl(aCameraControl)
|
||||
{
|
||||
mCameraControl->BeginBatchParameterSet();
|
||||
|
@ -35,7 +35,7 @@ struct ImageCacheEntryData {
|
||||
, mSourceSurface(aOther.mSourceSurface)
|
||||
, mSize(aOther.mSize)
|
||||
{}
|
||||
ImageCacheEntryData(const ImageCacheKey& aKey)
|
||||
explicit ImageCacheEntryData(const ImageCacheKey& aKey)
|
||||
: mImage(aKey.mImage)
|
||||
, mILC(nullptr)
|
||||
, mCanvas(aKey.mCanvas)
|
||||
@ -61,8 +61,8 @@ public:
|
||||
typedef ImageCacheKey KeyType;
|
||||
typedef const ImageCacheKey* KeyTypePointer;
|
||||
|
||||
ImageCacheEntry(const KeyType *key) :
|
||||
mData(new ImageCacheEntryData(*key)) {}
|
||||
explicit ImageCacheEntry(const KeyType* aKey) :
|
||||
mData(new ImageCacheEntryData(*aKey)) {}
|
||||
ImageCacheEntry(const ImageCacheEntry &toCopy) :
|
||||
mData(new ImageCacheEntryData(*toCopy.mData)) {}
|
||||
~ImageCacheEntry() {}
|
||||
@ -115,7 +115,7 @@ class ImageCacheObserver MOZ_FINAL : public nsIObserver
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
ImageCacheObserver(ImageCache* aImageCache)
|
||||
explicit ImageCacheObserver(ImageCache* aImageCache)
|
||||
: mImageCache(aImageCache)
|
||||
{
|
||||
RegisterMemoryPressureEvent();
|
||||
|
@ -298,7 +298,7 @@ class AdjustedTarget
|
||||
public:
|
||||
typedef CanvasRenderingContext2D::ContextState ContextState;
|
||||
|
||||
AdjustedTarget(CanvasRenderingContext2D *ctx,
|
||||
explicit AdjustedTarget(CanvasRenderingContext2D* ctx,
|
||||
mgfx::Rect *aBounds = nullptr)
|
||||
: mCtx(nullptr)
|
||||
{
|
||||
@ -438,7 +438,7 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CanvasPattern, mContext)
|
||||
|
||||
class CanvasRenderingContext2DUserData : public LayerUserData {
|
||||
public:
|
||||
CanvasRenderingContext2DUserData(CanvasRenderingContext2D *aContext)
|
||||
explicit CanvasRenderingContext2DUserData(CanvasRenderingContext2D *aContext)
|
||||
: mContext(aContext)
|
||||
{
|
||||
aContext->mUserDatas.AppendElement(this);
|
||||
|
@ -15,7 +15,7 @@ namespace dom {
|
||||
class TextMetrics MOZ_FINAL : public NonRefcountedDOMObject
|
||||
{
|
||||
public:
|
||||
TextMetrics(float w) : width(w)
|
||||
explicit TextMetrics(float aValue) : width(aValue)
|
||||
{
|
||||
MOZ_COUNT_CTOR(TextMetrics);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ class WebGLBuffer MOZ_FINAL
|
||||
, public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
WebGLBuffer(WebGLContext *context);
|
||||
explicit WebGLBuffer(WebGLContext* aContext);
|
||||
|
||||
void Delete();
|
||||
|
||||
|
@ -1129,7 +1129,7 @@ namespace mozilla {
|
||||
|
||||
class WebGLContextUserData : public LayerUserData {
|
||||
public:
|
||||
WebGLContextUserData(HTMLCanvasElement *aContent)
|
||||
explicit WebGLContextUserData(HTMLCanvasElement* aContent)
|
||||
: mContent(aContent)
|
||||
{}
|
||||
|
||||
@ -1510,8 +1510,8 @@ class UpdateContextLossStatusTask : public nsRunnable
|
||||
nsRefPtr<WebGLContext> mContext;
|
||||
|
||||
public:
|
||||
UpdateContextLossStatusTask(WebGLContext* context)
|
||||
: mContext(context)
|
||||
explicit UpdateContextLossStatusTask(WebGLContext* aContext)
|
||||
: mContext(aContext)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class WebGLContextLossHandler
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(WebGLContextLossHandler)
|
||||
|
||||
WebGLContextLossHandler(WebGLContext* webgl);
|
||||
explicit WebGLContextLossHandler(WebGLContext* aWebgl);
|
||||
~WebGLContextLossHandler();
|
||||
|
||||
void RunTimer();
|
||||
|
@ -36,7 +36,7 @@ struct GLComponents
|
||||
: mComponents(0)
|
||||
{ }
|
||||
|
||||
GLComponents(GLenum format);
|
||||
explicit GLComponents(GLenum aFormat);
|
||||
|
||||
// Returns true iff other has all (or more) of
|
||||
// the components present in this GLComponents
|
||||
|
@ -144,8 +144,8 @@ public:
|
||||
// Constructor. Takes a reference to the WebGLElementArrayCache that is to be
|
||||
// the parent. Does not initialize the tree. Should be followed by a call
|
||||
// to Update() to attempt initializing the tree.
|
||||
WebGLElementArrayCacheTree(WebGLElementArrayCache& p)
|
||||
: mParent(p)
|
||||
explicit WebGLElementArrayCacheTree(WebGLElementArrayCache& aValue)
|
||||
: mParent(aValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ class WebGLExtensionBase
|
||||
, public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
WebGLExtensionBase(WebGLContext*);
|
||||
explicit WebGLExtensionBase(WebGLContext* aValue);
|
||||
|
||||
WebGLContext *GetParentObject() const {
|
||||
return Context();
|
||||
@ -288,7 +288,7 @@ class WebGLExtensionVertexArray
|
||||
: public WebGLExtensionBase
|
||||
{
|
||||
public:
|
||||
WebGLExtensionVertexArray(WebGLContext*);
|
||||
explicit WebGLExtensionVertexArray(WebGLContext* aValue);
|
||||
virtual ~WebGLExtensionVertexArray();
|
||||
|
||||
already_AddRefed<WebGLVertexArray> CreateVertexArrayOES();
|
||||
@ -305,7 +305,7 @@ class WebGLExtensionInstancedArrays
|
||||
: public WebGLExtensionBase
|
||||
{
|
||||
public:
|
||||
WebGLExtensionInstancedArrays(WebGLContext* context);
|
||||
explicit WebGLExtensionInstancedArrays(WebGLContext* aContext);
|
||||
virtual ~WebGLExtensionInstancedArrays();
|
||||
|
||||
void DrawArraysInstancedANGLE(GLenum mode, GLint first,
|
||||
@ -324,7 +324,7 @@ class WebGLExtensionBlendMinMax
|
||||
: public WebGLExtensionBase
|
||||
{
|
||||
public:
|
||||
WebGLExtensionBlendMinMax(WebGLContext*);
|
||||
explicit WebGLExtensionBlendMinMax(WebGLContext* aValue);
|
||||
virtual ~WebGLExtensionBlendMinMax();
|
||||
|
||||
static bool IsSupported(const WebGLContext*);
|
||||
|
@ -31,7 +31,7 @@ class WebGLProgram MOZ_FINAL
|
||||
, public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
WebGLProgram(WebGLContext *context);
|
||||
explicit WebGLProgram(WebGLContext* aContext);
|
||||
|
||||
void Delete();
|
||||
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// CONSTRUCTOR
|
||||
|
||||
WebGLQuery(WebGLContext *context);
|
||||
explicit WebGLQuery(WebGLContext* aContext);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// MEMBER FUNCTIONS
|
||||
|
@ -35,7 +35,7 @@ class WebGLTexture MOZ_FINAL
|
||||
, public WebGLFramebufferAttachable
|
||||
{
|
||||
public:
|
||||
WebGLTexture(WebGLContext *context);
|
||||
explicit WebGLTexture(WebGLContext* aContext);
|
||||
|
||||
void Delete();
|
||||
|
||||
|
@ -15,7 +15,7 @@ struct WebGLUniformInfo {
|
||||
bool isArray;
|
||||
ShDataType type;
|
||||
|
||||
WebGLUniformInfo(uint32_t s = 0, bool a = false, ShDataType t = SH_NONE)
|
||||
explicit WebGLUniformInfo(uint32_t s = 0, bool a = false, ShDataType t = SH_NONE)
|
||||
: arraySize(s), isArray(a), type(t) {}
|
||||
|
||||
int ElementSize() const {
|
||||
|
@ -58,13 +58,13 @@ namespace mozilla {
|
||||
// implementations not expecting characters outside the GLSL ES set.
|
||||
class StripComments {
|
||||
public:
|
||||
StripComments(const nsAString& str)
|
||||
explicit StripComments(const nsAString& aStr)
|
||||
: m_parseState(BeginningOfLine)
|
||||
, m_end(str.EndReading())
|
||||
, m_current(str.BeginReading())
|
||||
, m_end(aStr.EndReading())
|
||||
, m_current(aStr.BeginReading())
|
||||
, m_position(0)
|
||||
{
|
||||
m_result.SetLength(str.Length());
|
||||
m_result.SetLength(aStr.Length());
|
||||
parse();
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user