mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 707883 - Make nsITelephonyWorker more generic in preparation for more workers. r=bent
This commit is contained in:
parent
e3765103cc
commit
8bb538e4be
@ -138,6 +138,7 @@
|
|||||||
@BINPATH@/components/dom_base.xpt
|
@BINPATH@/components/dom_base.xpt
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
@BINPATH@/components/dom_telephony.xpt
|
@BINPATH@/components/dom_telephony.xpt
|
||||||
|
@BINPATH@/components/dom_system_b2g.xpt
|
||||||
#endif
|
#endif
|
||||||
@BINPATH@/components/dom_battery.xpt
|
@BINPATH@/components/dom_battery.xpt
|
||||||
@BINPATH@/components/dom_canvas.xpt
|
@BINPATH@/components/dom_canvas.xpt
|
||||||
|
@ -70,6 +70,7 @@ components/pluginGlue.js
|
|||||||
components/sidebar.xpt
|
components/sidebar.xpt
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
components/dom_telephony.xpt
|
components/dom_telephony.xpt
|
||||||
|
components/dom_system_b2g.xpt
|
||||||
#endif
|
#endif
|
||||||
components/WeaveCrypto.js
|
components/WeaveCrypto.js
|
||||||
components/WeaveCrypto.manifest
|
components/WeaveCrypto.manifest
|
||||||
@ -1141,6 +1142,7 @@ xpicleanup@BIN_SUFFIX@
|
|||||||
components/dom_base.xpt
|
components/dom_base.xpt
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
components/dom_telephony.xpt
|
components/dom_telephony.xpt
|
||||||
|
components/dom_system_b2g.xpt
|
||||||
#endif
|
#endif
|
||||||
components/dom_canvas.xpt
|
components/dom_canvas.xpt
|
||||||
components/dom_core.xpt
|
components/dom_core.xpt
|
||||||
|
@ -44,6 +44,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||||||
|
|
||||||
MODULE = dom
|
MODULE = dom
|
||||||
LIBRARY_NAME = domsystemb2g_s
|
LIBRARY_NAME = domsystemb2g_s
|
||||||
|
XPIDL_MODULE = dom_system_b2g
|
||||||
LIBXUL_LIBRARY = 1
|
LIBXUL_LIBRARY = 1
|
||||||
FORCE_STATIC_LIB = 1
|
FORCE_STATIC_LIB = 1
|
||||||
|
|
||||||
@ -53,8 +54,11 @@ CPPSRCS = \
|
|||||||
RadioManager.cpp \
|
RadioManager.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
XPIDLSRCS = nsIRadioWorker.idl
|
||||||
|
|
||||||
LOCAL_INCLUDES = \
|
LOCAL_INCLUDES = \
|
||||||
-I$(topsrcdir)/dom/base \
|
-I$(topsrcdir)/dom/base \
|
||||||
|
-I$(topsrcdir)/dom/telephony \
|
||||||
-I$(topsrcdir)/content/events/src \
|
-I$(topsrcdir)/content/events/src \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
@ -38,13 +38,14 @@
|
|||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
#include "RadioManager.h"
|
#include "RadioManager.h"
|
||||||
#include "nsITelephonyWorker.h"
|
#include "nsIRadioWorker.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsIXPConnect.h"
|
#include "nsIXPConnect.h"
|
||||||
#include "nsIJSContextStack.h"
|
#include "nsIJSContextStack.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "mozilla/dom/workers/Workers.h"
|
#include "mozilla/dom/workers/Workers.h"
|
||||||
#include "jstypedarray.h"
|
#include "jstypedarray.h"
|
||||||
|
#include "nsTelephonyWorker.h"
|
||||||
|
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
|
|
||||||
@ -226,7 +227,7 @@ RadioManager::Init()
|
|||||||
|
|
||||||
// The telephony worker component is a hack that gives us a global object for
|
// The telephony worker component is a hack that gives us a global object for
|
||||||
// our own functions and makes creating the worker possible.
|
// our own functions and makes creating the worker possible.
|
||||||
nsCOMPtr<nsITelephonyWorker> worker(do_CreateInstance(kTelephonyWorkerCID));
|
nsCOMPtr<nsIRadioWorker> worker(do_CreateInstance(kTelephonyWorkerCID));
|
||||||
NS_ENSURE_TRUE(worker, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(worker, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
jsval workerval;
|
jsval workerval;
|
||||||
|
43
dom/system/b2g/nsIRadioWorker.idl
Normal file
43
dom/system/b2g/nsIRadioWorker.idl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* License.
|
||||||
|
*
|
||||||
|
* The Original Code is Telephony.
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is
|
||||||
|
* The Mozilla Foundation.
|
||||||
|
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* Ben Turner <bent.mozilla@gmail.com> (Original Author)
|
||||||
|
*
|
||||||
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
|
* the provisions above, a recipient may use your version of this file under
|
||||||
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
#include "nsISupports.idl"
|
||||||
|
|
||||||
|
[scriptable, uuid(8f031451-ac25-4816-a09e-a075bb704e63)]
|
||||||
|
interface nsIRadioWorker : nsISupports {
|
||||||
|
readonly attribute jsval worker;
|
||||||
|
};
|
@ -52,7 +52,6 @@ include $(topsrcdir)/dom/dom-config.mk
|
|||||||
|
|
||||||
XPIDLSRCS = \
|
XPIDLSRCS = \
|
||||||
mozIDOMTelephony.idl \
|
mozIDOMTelephony.idl \
|
||||||
nsITelephonyWorker.idl \
|
|
||||||
nsITelephone.idl \
|
nsITelephone.idl \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
@ -35,17 +35,6 @@
|
|||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
#include "nsISupports.idl"
|
|
||||||
|
|
||||||
[scriptable, uuid(8f031451-ac25-4816-a09e-a075bb704e63)]
|
|
||||||
interface nsITelephonyWorker : nsISupports {
|
|
||||||
readonly attribute jsval worker;
|
|
||||||
};
|
|
||||||
|
|
||||||
%{ C++
|
|
||||||
|
|
||||||
#define NS_TELEPHONYWORKER_CID \
|
#define NS_TELEPHONYWORKER_CID \
|
||||||
{ 0x2d831c8d, 0x6017, 0x435b, \
|
{ 0x2d831c8d, 0x6017, 0x435b, \
|
||||||
{ 0xa8, 0x0c, 0xe5, 0xd4, 0x22, 0x81, 0x0c, 0xea } }
|
{ 0xa8, 0x0c, 0xe5, 0xd4, 0x22, 0x81, 0x0c, 0xea } }
|
||||||
|
|
||||||
%}
|
|
@ -60,10 +60,10 @@ nsTelephonyWorker.prototype = {
|
|||||||
classInfo: XPCOMUtils.generateCI({classID: TELEPHONYWORKER_CID,
|
classInfo: XPCOMUtils.generateCI({classID: TELEPHONYWORKER_CID,
|
||||||
contractID: TELEPHONYWORKER_CONTRACTID,
|
contractID: TELEPHONYWORKER_CONTRACTID,
|
||||||
classDescription: "TelephonyWorker",
|
classDescription: "TelephonyWorker",
|
||||||
interfaces: [Ci.nsITelephonyWorker,
|
interfaces: [Ci.nsIRadioWorker,
|
||||||
Ci.nsITelephone]}),
|
Ci.nsITelephone]}),
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyWorker,
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsIRadioWorker,
|
||||||
Ci.nsITelephone]),
|
Ci.nsITelephone]),
|
||||||
|
|
||||||
onerror: function onerror(event) {
|
onerror: function onerror(event) {
|
||||||
@ -118,7 +118,7 @@ nsTelephonyWorker.prototype = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// nsITelephonyWorker
|
// nsIRadioWorker
|
||||||
|
|
||||||
worker: null,
|
worker: null,
|
||||||
|
|
||||||
|
@ -153,6 +153,7 @@
|
|||||||
@BINPATH@/components/dom_base.xpt
|
@BINPATH@/components/dom_base.xpt
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
@BINPATH@/components/dom_telephony.xpt
|
@BINPATH@/components/dom_telephony.xpt
|
||||||
|
@BINPATH@/components/dom_system_b2g.xpt
|
||||||
#endif
|
#endif
|
||||||
@BINPATH@/components/dom_battery.xpt
|
@BINPATH@/components/dom_battery.xpt
|
||||||
@BINPATH@/components/dom_canvas.xpt
|
@BINPATH@/components/dom_canvas.xpt
|
||||||
|
Loading…
Reference in New Issue
Block a user