xpcom/io/nsIStringStream.idl
author Aki Sasaki <asasaki@mozilla.com>
Thu, 15 Feb 2018 18:14:26 -0800
changeset 405423 42a3b4c113542cee47b388879e27163091eed356
parent 363742 3611ff7a79e6b616088bc4bf14e7ba8cdfe8bebf
child 471909 e1927f1c0f1e3c3eed9bde2a1bdd6ac0a434458a
permissions -rw-r--r--
bug 1438735 - balrog scriptworker push and schedule support. r=bhearsum - add balrog submit-toplevel - this replaces the final portion of the updates builder. - rename balrog transform to balrog_submit, because it's for balrog locale submission - make this default to the 'promote' phase. balrog and beetmover currently take the current phase, which isn't always the wanted behavior. - rename balrog publish to balrog schedule - add balrog secondary push and secondary scheduling, for RCs - remove the release_updates transforms - make the task.py balrog transforms smarter - get rid of the release_balrog_publishing transforms; ad a generic worker_type transform - add BALROG_ACTIONS to scriptworker.py - add get_balrog_action_scope() - remove the unused balrog channel scopes MozReview-Commit-ID: 369ACiOAd5F

/* -*- Mode: C++; 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/. */

#include "nsIInputStream.idl"

%{C++
#include "mozilla/MemoryReporting.h"
%}

native MallocSizeOf(mozilla::MallocSizeOf);

/**
 * nsIStringInputStream
 *
 * Provides scriptable and specialized C++-only methods for initializing a
 * nsIInputStream implementation with a simple character array.
 */
[scriptable, builtinclass, uuid(450cd2d4-f0fd-424d-b365-b1251f80fd53)]
interface nsIStringInputStream : nsIInputStream
{
    /**
     * SetData - assign data to the input stream (copied on assignment).
     *
     * @param data    - stream data
     * @param dataLen - stream data length (-1 if length should be computed)
     *
     * NOTE: C++ code should consider using AdoptData or ShareData to avoid
     * making an extra copy of the stream data.
     *
     * NOTE: For JS callers, the given data must not contain null characters
     * (other than a null terminator) because a null character in the middle of
     * the data string will be seen as a terminator when the data is converted
     * from a JS string to a C++ character array.
     */
    void setData(in string data, in long dataLen);

    /**
     * NOTE: the following methods are designed to give C++ code added control
     * over the ownership and lifetime of the stream data.  Use with care :-)
     */

    /**
     * AdoptData - assign data to the input stream.  the input stream takes
     * ownership of the given data buffer and will free it when
     * the input stream is destroyed.
     *
     * @param data      - stream data
     * @param dataLen   - stream data length (-1 if length should be computed)
     */
    [noscript] void adoptData(in charPtr data, in long dataLen);

    /**
     * ShareData - assign data to the input stream.  the input stream references
     * the given data buffer until the input stream is destroyed.  the given
     * data buffer must outlive the input stream.
     *
     * @param data      - stream data
     * @param dataLen   - stream data length (-1 if length should be computed)
     */
    [noscript] void shareData(in string data, in long dataLen);

    [noscript, notxpcom]
    size_t SizeOfIncludingThis(in MallocSizeOf aMallocSizeOf);
};