зеркало из https://github.com/mozilla/gecko-dev.git
Bug 677166 - Part 2 - Add .mozConnection to Navigator object. r=sicking
This commit is contained in:
Родитель
5ccd06bfcd
Коммит
7d104eee5a
|
@ -156,6 +156,7 @@
|
|||
@BINPATH@/components/dom_css.xpt
|
||||
@BINPATH@/components/dom_events.xpt
|
||||
@BINPATH@/components/dom_geolocation.xpt
|
||||
@BINPATH@/components/dom_network.xpt
|
||||
@BINPATH@/components/dom_notification.xpt
|
||||
@BINPATH@/components/dom_html.xpt
|
||||
@BINPATH@/components/dom_indexeddb.xpt
|
||||
|
|
|
@ -146,6 +146,7 @@
|
|||
@BINPATH@/components/dom_css.xpt
|
||||
@BINPATH@/components/dom_events.xpt
|
||||
@BINPATH@/components/dom_geolocation.xpt
|
||||
@BINPATH@/components/dom_network.xpt
|
||||
@BINPATH@/components/dom_notification.xpt
|
||||
@BINPATH@/components/dom_html.xpt
|
||||
@BINPATH@/components/dom_indexeddb.xpt
|
||||
|
|
|
@ -130,6 +130,7 @@ NS_INTERFACE_MAP_BEGIN(Navigator)
|
|||
#ifdef MOZ_B2G_RIL
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNavigatorTelephony)
|
||||
#endif
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMozNavigatorNetwork)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Navigator)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
@ -1063,6 +1064,17 @@ Navigator::GetMozTelephony(nsIDOMTelephony** aTelephony)
|
|||
|
||||
#endif // MOZ_B2G_RIL
|
||||
|
||||
//*****************************************************************************
|
||||
// Navigator::nsIDOMNavigatorNetwork
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMETHODIMP
|
||||
Navigator::GetMozConnection(nsIDOMMozConnection** aConnection)
|
||||
{
|
||||
*aConnection = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt64
|
||||
Navigator::SizeOf() const
|
||||
{
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "nsIDOMClientInformation.h"
|
||||
#include "nsIDOMNavigatorBattery.h"
|
||||
#include "nsIDOMNavigatorSms.h"
|
||||
#include "nsIDOMNavigatorNetwork.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
|
@ -78,15 +79,16 @@ namespace sms {
|
|||
class SmsManager;
|
||||
} // namespace sms
|
||||
|
||||
class Navigator : public nsIDOMNavigator,
|
||||
public nsIDOMClientInformation,
|
||||
public nsIDOMNavigatorGeolocation,
|
||||
public nsIDOMNavigatorDesktopNotification,
|
||||
public nsIDOMMozNavigatorBattery,
|
||||
public nsIDOMMozNavigatorSms
|
||||
class Navigator : public nsIDOMNavigator
|
||||
, public nsIDOMClientInformation
|
||||
, public nsIDOMNavigatorGeolocation
|
||||
, public nsIDOMNavigatorDesktopNotification
|
||||
, public nsIDOMMozNavigatorBattery
|
||||
, public nsIDOMMozNavigatorSms
|
||||
#ifdef MOZ_B2G_RIL
|
||||
, public nsIDOMNavigatorTelephony
|
||||
#endif
|
||||
, public nsIDOMMozNavigatorNetwork
|
||||
{
|
||||
public:
|
||||
Navigator(nsPIDOMWindow *aInnerWindow);
|
||||
|
@ -99,10 +101,10 @@ public:
|
|||
NS_DECL_NSIDOMNAVIGATORDESKTOPNOTIFICATION
|
||||
NS_DECL_NSIDOMMOZNAVIGATORBATTERY
|
||||
NS_DECL_NSIDOMMOZNAVIGATORSMS
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
NS_DECL_NSIDOMNAVIGATORTELEPHONY
|
||||
#endif
|
||||
NS_DECL_NSIDOMMOZNAVIGATORNETWORK
|
||||
|
||||
static void Init();
|
||||
|
||||
|
|
|
@ -2372,6 +2372,7 @@ nsDOMClassInfo::Init()
|
|||
#ifdef MOZ_B2G_RIL
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNavigatorTelephony)
|
||||
#endif
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozNavigatorNetwork)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(Plugin, nsIDOMPlugin)
|
||||
|
|
|
@ -46,6 +46,8 @@ XPIDL_MODULE = dom_network
|
|||
include $(topsrcdir)/dom/dom-config.mk
|
||||
|
||||
XPIDLSRCS = \
|
||||
nsIDOMNavigatorNetwork.idl \
|
||||
nsIDOMConnection.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
/* ***** 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 mozilla.org.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Foundation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Mounir Lamouri <mounir.lamouri@mozilla.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(0bd0bcc8-ca92-43fa-97bd-aec8d79edb24)]
|
||||
interface nsIDOMMozConnection : nsISupports
|
||||
{
|
||||
};
|
|
@ -0,0 +1,45 @@
|
|||
/* ***** 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 mozilla.org.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Foundation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Mounir Lamouri <mounir.lamouri@mozilla.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"
|
||||
|
||||
interface nsIDOMMozConnection;
|
||||
|
||||
[scriptable, uuid(1dd6773e-30dc-419b-9766-b05458fd96c8)]
|
||||
interface nsIDOMMozNavigatorNetwork : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMMozConnection mozConnection;
|
||||
};
|
|
@ -49,13 +49,14 @@ DIRS = \
|
|||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES = \
|
||||
test_network_basics.html \
|
||||
$(NULL)
|
||||
|
||||
_CHROME_TEST_FILES = \
|
||||
$(NULL)
|
||||
|
||||
#libs:: $(_TEST_FILES)
|
||||
# $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
libs:: $(_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
#libs:: $(_CHROME_TEST_FILES)
|
||||
# $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for Network API</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Network API **/
|
||||
|
||||
ok('mozConnection' in navigator, "navigator.mozConnection should exist");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -93,6 +93,7 @@ SHARED_LIBRARY_LIBS = \
|
|||
$(DEPTH)/view/src/$(LIB_PREFIX)gkview_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/dom/base/$(LIB_PREFIX)jsdombase_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/dom/battery/$(LIB_PREFIX)dom_battery_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/dom/network/src/$(LIB_PREFIX)dom_network_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/dom/sms/src/$(LIB_PREFIX)dom_sms_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/dom/src/events/$(LIB_PREFIX)jsdomevents_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/dom/src/json/$(LIB_PREFIX)json_s.$(LIB_SUFFIX) \
|
||||
|
|
|
@ -157,6 +157,7 @@
|
|||
@BINPATH@/components/dom_css.xpt
|
||||
@BINPATH@/components/dom_events.xpt
|
||||
@BINPATH@/components/dom_geolocation.xpt
|
||||
@BINPATH@/components/dom_network.xpt
|
||||
@BINPATH@/components/dom_notification.xpt
|
||||
@BINPATH@/components/dom_html.xpt
|
||||
@BINPATH@/components/dom_indexeddb.xpt
|
||||
|
|
|
@ -162,6 +162,7 @@
|
|||
@BINPATH@/components/dom_css.xpt
|
||||
@BINPATH@/components/dom_events.xpt
|
||||
@BINPATH@/components/dom_geolocation.xpt
|
||||
@BINPATH@/components/dom_network.xpt
|
||||
@BINPATH@/components/dom_notification.xpt
|
||||
@BINPATH@/components/dom_html.xpt
|
||||
@BINPATH@/components/dom_indexeddb.xpt
|
||||
|
|
Загрузка…
Ссылка в новой задаче