Bug 1299500 - Get rid of DeviceStorage API - part 1 - DeviceStorageAreaChangedEvent, r=ehsan, a=lizzard
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 08 Mar 2017 20:15:44 +0100
changeset 379239 188a791aec8b47c1ca529856833f0a6bf0752746
parent 379238 f2b55ce343c61eaa04d66ad014145645498e2fe5
child 379240 71d55c22894809ad6f7efddea305dcfe38cd357d
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, lizzard
bugs1299500
milestone53.0
Bug 1299500 - Get rid of DeviceStorage API - part 1 - DeviceStorageAreaChangedEvent, r=ehsan, a=lizzard
dom/devicestorage/DeviceStorageAreaListener.cpp
dom/events/test/test_all_synthetic_events.html
dom/webidl/DeviceStorageAreaChangedEvent.webidl
dom/webidl/moz.build
--- a/dom/devicestorage/DeviceStorageAreaListener.cpp
+++ b/dom/devicestorage/DeviceStorageAreaListener.cpp
@@ -127,28 +127,15 @@ DeviceStorageAreaListener::DispatchStora
     return;
   }
   if (iter != mStorageAreaStateMap.end() &&
       iter->second == aOperation) {
     // No need to disptach the event if the state is unchanged.
     return;
   }
 
-  DeviceStorageAreaChangedEventInit init;
-  init.mOperation = aOperation;
-  init.mStorageName = aStorageName;
-
-  RefPtr<DeviceStorageAreaChangedEvent> event =
-    DeviceStorageAreaChangedEvent::Constructor(this,
-                                               NS_LITERAL_STRING("storageareachanged"),
-                                               init);
-  event->SetTrusted(true);
-
   mStorageAreaStateMap[aStorageName] = aOperation;
 
   nsDOMDeviceStorage::InvalidateVolumeCaches();
-
-  bool ignore;
-  DOMEventTargetHelper::DispatchEvent(event, &ignore);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/events/test/test_all_synthetic_events.html
+++ b/dom/events/test/test_all_synthetic_events.html
@@ -111,20 +111,16 @@ const kEventConstructors = {
   DeviceOrientationEvent:                    { create: function (aName, aProps) {
                                                          return new DeviceOrientationEvent(aName, aProps);
                                                        },
                                              },
   DeviceProximityEvent:                      { create: function (aName, aProps) {
                                                          return new DeviceProximityEvent(aName, aProps);
                                                        },
                                              },
-  DeviceStorageAreaChangedEvent:             { create: function (aName, aProps) {
-                                                         return new DeviceStorageAreaChangedEvent(aName, aProps);
-                                                       },
-                                             },
   DeviceStorageChangeEvent:                  { create: function (aName, aProps) {
                                                          return new DeviceStorageChangeEvent(aName, aProps);
                                                        },
                                              },
   DownloadEvent:                             { create: function (aName, aProps) {
                                                          return new DownloadEvent(aName, aProps);
                                                        },
                                              },
deleted file mode 100644
--- a/dom/webidl/DeviceStorageAreaChangedEvent.webidl
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- 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/. */
-
-enum DeviceStorageAreaChangedEventOperation {
-  "added",
-  "removed",
-  "unknown"
-};
-
-/*
- * For the EventHandler - onstorageareachanged, new event is introduced and called
- * DeviceStorageAreaChangedEvent.
- * The attribute - operation indicates that there is a storage area has been
- * added or removed.
- * 1. If a storage area is added, then the 'storageName' attribute will contain the
- * name of the storage area. To access this new storage area, a user needs to pass
- * storageName to navigator.getDeviceStorageByNameAndType to get a DeviceStorage object.
- * 2. If a storage area is removed, then the 'storageName' attribute indicates
- * which storage area was removed.
- */
-[Pref="device.storage.enabled",
- Constructor(DOMString type, optional DeviceStorageAreaChangedEventInit eventInitDict)]
-interface DeviceStorageAreaChangedEvent : Event {
-  readonly attribute DeviceStorageAreaChangedEventOperation operation;
-  readonly attribute DOMString                              storageName;
-};
-
-dictionary DeviceStorageAreaChangedEventInit : EventInit {
-  DeviceStorageAreaChangedEventOperation operation = "unknown";
-  DOMString                              storageName = "";
-};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -694,17 +694,16 @@ GENERATED_EVENTS_WEBIDL_FILES = [
     'AnimationPlaybackEvent.webidl',
     'AutocompleteErrorEvent.webidl',
     'BlobEvent.webidl',
     'CaretStateChangedEvent.webidl',
     'CloseEvent.webidl',
     'DeviceLightEvent.webidl',
     'DeviceOrientationEvent.webidl',
     'DeviceProximityEvent.webidl',
-    'DeviceStorageAreaChangedEvent.webidl',
     'DeviceStorageChangeEvent.webidl',
     'ErrorEvent.webidl',
     'FontFaceSetLoadEvent.webidl',
     'GamepadAxisMoveEvent.webidl',
     'GamepadButtonEvent.webidl',
     'GamepadEvent.webidl',
     'GroupedHistoryEvent.webidl',
     'HashChangeEvent.webidl',