Attachment #8768064: 0004-bug-1218576-Remove-requestChildPayloads.patch for bug #1218576

View | Details | Raw Unified | Return to bug 1218576
Collapse All | Expand All

(-)a/toolkit/components/telemetry/TelemetrySession.jsm (-29 lines)
Line     Link Here 
 Lines 57-63   const PREF_UNIFIED = PREF_BRANCH + "unified"; Link Here 
57
57
58
58
59
const MESSAGE_TELEMETRY_PAYLOAD = "Telemetry:Payload";
59
const MESSAGE_TELEMETRY_PAYLOAD = "Telemetry:Payload";
60
const MESSAGE_TELEMETRY_GET_CHILD_PAYLOAD = "Telemetry:GetChildPayload";
61
const MESSAGE_TELEMETRY_THREAD_HANGS = "Telemetry:ChildThreadHangs";
60
const MESSAGE_TELEMETRY_THREAD_HANGS = "Telemetry:ChildThreadHangs";
62
const MESSAGE_TELEMETRY_GET_CHILD_THREAD_HANGS = "Telemetry:GetChildThreadHangs";
61
const MESSAGE_TELEMETRY_GET_CHILD_THREAD_HANGS = "Telemetry:GetChildThreadHangs";
63
const MESSAGE_TELEMETRY_USS = "Telemetry:USS";
62
const MESSAGE_TELEMETRY_USS = "Telemetry:USS";
 Lines 541-553   this.TelemetrySession = Object.freeze({ Link Here 
541
    return Impl.getPayload(reason, clearSubsession);
540
    return Impl.getPayload(reason, clearSubsession);
542
  },
541
  },
543
  /**
542
  /**
544
   * Asks the content processes to send their payloads.
545
   * @returns Object
546
   */
547
  requestChildPayloads: function() {
548
    return Impl.requestChildPayloads();
549
  },
550
  /**
551
   * Returns a promise that resolves to an array of thread hang stats from content processes, one entry per process.
543
   * Returns a promise that resolves to an array of thread hang stats from content processes, one entry per process.
552
   * The structure of each entry is identical to that of "threadHangStats" in nsITelemetry.
544
   * The structure of each entry is identical to that of "threadHangStats" in nsITelemetry.
553
   * While thread hang stats are also part of the child payloads, this function is useful for cheaply getting this information,
545
   * While thread hang stats are also part of the child payloads, this function is useful for cheaply getting this information,
 Lines 1511-1517   var Impl = { Link Here 
1511
    }
1503
    }
1512
1504
1513
    Services.obs.addObserver(this, "content-child-shutdown", false);
1505
    Services.obs.addObserver(this, "content-child-shutdown", false);
1514
    cpml.addMessageListener(MESSAGE_TELEMETRY_GET_CHILD_PAYLOAD, this);
1515
    cpml.addMessageListener(MESSAGE_TELEMETRY_GET_CHILD_THREAD_HANGS, this);
1506
    cpml.addMessageListener(MESSAGE_TELEMETRY_GET_CHILD_THREAD_HANGS, this);
1516
    cpml.addMessageListener(MESSAGE_TELEMETRY_GET_CHILD_USS, this);
1507
    cpml.addMessageListener(MESSAGE_TELEMETRY_GET_CHILD_USS, this);
1517
1508
 Lines 1549-1562   var Impl = { Link Here 
1549
      let source = message.data.childUUID;
1540
      let source = message.data.childUUID;
1550
      delete message.data.childUUID;
1541
      delete message.data.childUUID;
1551
1542
1552
      for (let child of this._childTelemetry) {
1553
        if (child.source === source) {
1554
          // Update existing telemetry data.
1555
          child.payload = message.data;
1556
          return;
1557
        }
1558
      }
1559
      // Did not find existing child in this._childTelemetry.
1560
      this._childTelemetry.push({
1543
      this._childTelemetry.push({
1561
        source: source,
1544
        source: source,
1562
        payload: message.data,
1545
        payload: message.data,
 Lines 1569-1580   var Impl = { Link Here 
1569
1552
1570
      break;
1553
      break;
1571
    }
1554
    }
1572
    case MESSAGE_TELEMETRY_GET_CHILD_PAYLOAD:
1573
    {
1574
      // In child process, send the requested Telemetry payload
1575
      this.sendContentProcessPing("saved-session");
1576
      break;
1577
    }
1578
    case MESSAGE_TELEMETRY_THREAD_HANGS:
1555
    case MESSAGE_TELEMETRY_THREAD_HANGS:
1579
    {
1556
    {
1580
      // Accumulate child thread hang stats from this child
1557
      // Accumulate child thread hang stats from this child
 Lines 1754-1764   var Impl = { Link Here 
1754
    return this.getSessionPayload(reason, clearSubsession);
1731
    return this.getSessionPayload(reason, clearSubsession);
1755
  },
1732
  },
1756
1733
1757
  requestChildPayloads: function() {
1758
    this._log.trace("requestChildPayloads");
1759
    ppmm.broadcastAsyncMessage(MESSAGE_TELEMETRY_GET_CHILD_PAYLOAD, {});
1760
  },
1761
1762
  getChildThreadHangs: function getChildThreadHangs() {
1734
  getChildThreadHangs: function getChildThreadHangs() {
1763
    return new Promise((resolve) => {
1735
    return new Promise((resolve) => {
1764
      // Return immediately if there are no child processes to get stats from
1736
      // Return immediately if there are no child processes to get stats from
1765
- 

Return to bug 1218576