Bug 1388709 - Remove console `originAttributes` property. r=kmag,baku draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 08 Aug 2017 14:30:44 +0200
changeset 651962 426007d82f276c7c2a55c45684f8d4a55f3acfb2
parent 651826 d1c70c20e7b52f7295411343e4dc5db8ee7c92b9
child 651981 3060f3a1d05bfb10c7d37bb736778ab9893a1f73
child 652090 38799203aa4d56bd44b7220ba12a5932fecf8bcf
push id75901
push userbmo:poirot.alex@gmail.com
push dateThu, 24 Aug 2017 09:06:27 +0000
reviewerskmag, baku
bugs1388709
milestone57.0a1
Bug 1388709 - Remove console `originAttributes` property. r=kmag,baku MozReview-Commit-ID: jwUAKSEgZE
devtools/server/actors/webconsole.js
dom/console/Console.cpp
dom/console/ConsoleAPIStorage.js
dom/webidl/Console.webidl
--- a/devtools/server/actors/webconsole.js
+++ b/devtools/server/actors/webconsole.js
@@ -1797,17 +1797,16 @@ WebConsoleActor.prototype =
     let result = WebConsoleUtils.cloneObject(message);
 
     result.workerType = WebConsoleUtils.getWorkerType(result) || "none";
 
     delete result.wrappedJSObject;
     delete result.ID;
     delete result.innerID;
     delete result.consoleID;
-    delete result.originAttributes;
 
     result.arguments = Array.map(message.arguments || [], (obj) => {
       let dbgObj = this.makeDebuggeeValue(obj, useObjectGlobal);
       return this.createValueGrip(dbgObj);
     });
 
     result.styles = Array.map(message.styles || [], (string) => {
       return this.createValueGrip(string);
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -1502,23 +1502,16 @@ Console::PopulateConsoleNotificationInTh
   ConsoleStackEntry frame;
   if (aData->mTopStackFrame) {
     frame = *aData->mTopStackFrame;
   }
 
   ClearException ce(aCx);
   RootedDictionary<ConsoleEvent> event(aCx);
 
-  // Save the principal's OriginAttributes in the console event data
-  // so that we will be able to filter messages by origin attributes.
-  JS::Rooted<JS::Value> originAttributesValue(aCx);
-  if (ToJSValue(aCx, aData->mOriginAttributes, &originAttributesValue)) {
-    event.mOriginAttributes = originAttributesValue;
-  }
-
   event.mAddonId = aData->mAddonId;
 
   event.mID.Construct();
   event.mInnerID.Construct();
 
   if (aData->mIDType == ConsoleCallData::eString) {
     event.mID.Value().SetAsString() = aData->mOuterIDString;
     event.mInnerID.Value().SetAsString() = aData->mInnerIDString;
--- a/dom/console/ConsoleAPIStorage.js
+++ b/dom/console/ConsoleAPIStorage.js
@@ -124,21 +124,16 @@ ConsoleAPIStorageService.prototype = {
   recordEvent: function CS_recordEvent(aId, aOuterId, aEvent)
   {
     if (!_consoleStorage.has(aId)) {
       _consoleStorage.set(aId, []);
     }
 
     let storage = _consoleStorage.get(aId);
 
-    // Clone originAttributes to prevent "TypeError: can't access dead object"
-    // exceptions when cached console messages are retrieved/filtered
-    // by the devtools webconsole actor.
-    aEvent.originAttributes = Cu.cloneInto(aEvent.originAttributes, {});
-
     storage.push(aEvent);
 
     // truncate
     if (storage.length > STORAGE_MAX_EVENTS) {
       storage.shift();
     }
 
     Services.obs.notifyObservers(aEvent, "console-api-log-event", aOuterId);
--- a/dom/webidl/Console.webidl
+++ b/dom/webidl/Console.webidl
@@ -46,17 +46,16 @@ namespace console {
   [ChromeOnly]
   const boolean IS_NATIVE_CONSOLE = true;
 };
 
 // This is used to propagate console events to the observers.
 dictionary ConsoleEvent {
   (unsigned long long or DOMString) ID;
   (unsigned long long or DOMString) innerID;
-  any originAttributes = null;
   DOMString addonId = "";
   DOMString level = "";
   DOMString filename = "";
   unsigned long lineNumber = 0;
   unsigned long columnNumber = 0;
   DOMString functionName = "";
   double timeStamp = 0;
   sequence<any> arguments;