Bug 1100398 P1 Add the nsICloneableInputStream interface. r=froydnj
authorBen Kelly <ben@wanderview.com>
Tue, 10 Feb 2015 23:55:43 -0500
changeset 228675 f14875d011dccf4e4c923012cc7eef4ca2712670
parent 228674 0fb6d729cd221e491d7aacf43917a48c369fa25f
child 228676 507718807f6d78af80a493ecbdef21fcd5108631
push id55493
push userbkelly@mozilla.com
push dateWed, 11 Feb 2015 19:57:53 +0000
treeherdermozilla-inbound@48906d15a28e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1100398
milestone38.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 1100398 P1 Add the nsICloneableInputStream interface. r=froydnj
xpcom/io/moz.build
xpcom/io/nsICloneableInputStream.idl
--- a/xpcom/io/moz.build
+++ b/xpcom/io/moz.build
@@ -4,16 +4,17 @@
 # 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/.
 
 XPIDL_SOURCES += [
     'nsIAsyncInputStream.idl',
     'nsIAsyncOutputStream.idl',
     'nsIBinaryInputStream.idl',
     'nsIBinaryOutputStream.idl',
+    'nsICloneableInputStream.idl',
     'nsIConverterInputStream.idl',
     'nsIConverterOutputStream.idl',
     'nsIDirectoryEnumerator.idl',
     'nsIDirectoryService.idl',
     'nsIFile.idl',
     'nsIInputStream.idl',
     'nsIInputStreamTee.idl',
     'nsIIOUtil.idl',
new file mode 100644
--- /dev/null
+++ b/xpcom/io/nsICloneableInputStream.idl
@@ -0,0 +1,22 @@
+/* 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/. */
+
+#include "nsIInputStream.idl"
+
+[scriptable, builtinclass, uuid(8149be1f-44d3-4f14-8b65-a57a5fbbeb97)]
+interface nsICloneableInputStream : nsISupports
+{
+  // Allow streams that implement the interface to determine if cloning
+  // possible at runtime.  For example, this allows wrappers to check if
+  // their base stream supports cloning.
+  [infallible] readonly attribute boolean cloneable;
+
+  // Produce a copy of the current stream in the most efficient way possible.
+  // In this case "copy" means that both the original and cloned streams
+  // should produce the same bytes for all future reads.  Bytes that have
+  // already been consumed from the original stream are not copied to the
+  // clone.  Operations on the two streams should be completely independent
+  // after the clone() occurs.
+  nsIInputStream clone();
+};