author Nathan Froyd <froydnj@mozilla.com>
Thu, 18 Feb 2016 14:35:21 -0500
changeset 285452 2a3bc10a643708d268364d928c2342bb5930f8d7
parent 24763 5558583f428771f5798cf9e8c19def522b14d700
child 329664 7b434711753b98a87603453caaa0945791ffe12b
permissions -rw-r--r--
Bug 1249389 - part 6 - provide UniquePtr overload for nsIStartupCache::GetBuffer; r=erahm The lone remaining startup cache-related uses of nsAutoArrayPtr are both in TestStartupCache.cpp, for use with nsIStartupCache::GetBuffer. The uses can't use StartupCache::GetBuffer because StartupCache::GetBuffer isn't visible outside of libxul, and TestStartupCache is a normal C++ unit test. The Right Thing is to convert TestStartupCache to a gtest so we can see libxul internal symbols and then delete nsIStartupCache entirely. That's a bit complicated, as TestStartupCache doesn't fit nicely into gtest's framework. The simpler solution is to add a UniquePtr overload in the interface that hides the XPCOM outparam management details.

<script type="text/javascript">

function boom()
  document.execCommand("inserthtml", false, "AB");
  document.execCommand("delete", false, null);
  document.execCommand("undo", false, null);

  document.addEventListener("DOMCharacterDataModified", f, false);
  document.execCommand("redo", false, null);
  document.removeEventListener("DOMCharacterDataModified", f, false);

  function f()
    document.removeEventListener("DOMCharacterDataModified", f, false);
    document.execCommand("formatBlock", false, "<h3>");


<body onload="boom();"><div id="d" contenteditable="true"></div></body>