Bug 1126694 - IDL changes for DeviceStorageAreaListener. r=bz
authorKershaw Chang <kechang@mozilla.com>
Mon, 04 May 2015 08:10:00 +0200
changeset 242319 bf66afc999a26a905f4701d2385c6df877a9728d
parent 242318 0241a6b50e7b94a6e2c99a105a461439ac1f48f1
child 242320 aaa4487657420dfdade7210a7599e07bcf52d2be
push id59376
push usercbook@mozilla.com
push dateTue, 05 May 2015 07:09:04 +0000
treeherdermozilla-inbound@1163109f2895 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1126694
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1126694 - IDL changes for DeviceStorageAreaListener. r=bz
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/DeviceStorageAreaListener.webidl
dom/webidl/Navigator.webidl
dom/webidl/moz.build
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -338,16 +338,18 @@ var interfaceNamesInGlobalScope =
     "DeviceMotionEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "DeviceOrientationEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "DeviceProximityEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     { name: "DeviceStorageAreaChangedEvent", desktop: false},
 // IMPORTANT: Do not change this list without review from a DOM peer!
+    { name: "DeviceStorageAreaListener", desktop: false},
+// IMPORTANT: Do not change this list without review from a DOM peer!
     { name: "DeviceStorage", desktop: false},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     { name: "DeviceStorageChangeEvent", desktop: false},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "DisplayPortInputPort", b2g: true, permission: ["inputport"]},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "Document",
 // IMPORTANT: Do not change this list without review from a DOM peer!
new file mode 100644
--- /dev/null
+++ b/dom/webidl/DeviceStorageAreaListener.webidl
@@ -0,0 +1,10 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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/. */
+
+[Pref="device.storage.enabled"]
+interface DeviceStorageAreaListener : EventTarget {
+  // Fired when a storage area is added or removed.
+  attribute EventHandler onstorageareachanged;
+};
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -240,22 +240,29 @@ partial interface Navigator {
    * automatically when its associated window is unloaded.
    *
    * @param aTopic resource name
    */
   [Throws, Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport", UnsafeInPrerendering]
   MozWakeLock requestWakeLock(DOMString aTopic);
 };
 
+partial interface Navigator {
+  [Throws, Pref="device.storage.enabled"]
+  readonly attribute DeviceStorageAreaListener deviceStorageAreaListener;
+};
+
 // nsIDOMNavigatorDeviceStorage
 partial interface Navigator {
   [Throws, Pref="device.storage.enabled"]
   DeviceStorage? getDeviceStorage(DOMString type);
   [Throws, Pref="device.storage.enabled"]
   sequence<DeviceStorage> getDeviceStorages(DOMString type);
+  [Throws, Pref="device.storage.enabled"]
+  DeviceStorage? getDeviceStorageByNameAndType(DOMString name, DOMString type);
 };
 
 // nsIDOMNavigatorDesktopNotification
 partial interface Navigator {
   [Throws, Pref="notification.feature.enabled", UnsafeInPrerendering]
   readonly attribute DesktopNotificationCenter mozNotification;
 };
 
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -98,16 +98,17 @@ WEBIDL_FILES = [
     'DataStore.webidl',
     'DataStoreImpl.webidl',
     'DataTransfer.webidl',
     'DedicatedWorkerGlobalScope.webidl',
     'DelayNode.webidl',
     'DesktopNotification.webidl',
     'DeviceMotionEvent.webidl',
     'DeviceStorage.webidl',
+    'DeviceStorageAreaListener.webidl',
     'Directory.webidl',
     'DisplayPortInputPort.webidl',
     'Document.webidl',
     'DocumentFragment.webidl',
     'DocumentTimeline.webidl',
     'DocumentType.webidl',
     'DOMCursor.webidl',
     'DOMError.webidl',