Files
palemoon27/widget/nsPrimitiveHelpers.h
roytam1 21cd830e68 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 586587 - support kHTMLMime in the Windows clipboard as CF_HTML. r=jimm (6af5a0d7fa)
- Bug 1159604: Use a fallible allocation in nsClipboard::GetGlobalData. r=bbondy (c9645301a4)
- Bug 1048624 - Cleanup and refactor the media crashtest manifests and re-enable some disabled tests that now pass. (d712e08056)
- crashtest for bug 1020370 r=padenot (c0900de1df)
- crashtest for bug 1206362 r=padenot (07ace6a42f)
- Bug 1207546 - Integrate WebRTC with audio channels, r=roc (0ecafba529)
- Bug 1219478: Replace PRLogModuleInfo usage with LazyLogModule in dom folders except media.r=amerchesini (2e67bd7308)
- Bug 1198422 - CSP: Allow nonce to load if default-src is not specified in second policy (r=dveditz) (8a8bca1eb3)
- Bug 1187152 (part 1) - Replace nsBaseHashtable::Enumerate() calls in modules/ with iterators. r=mwu. (85cea6dce7)
- Bug 1187152 (part 2) - Replace nsBaseHashtable::Enumerate() calls in modules/ with iterators. r=froydnj. (e909442934)
- Bug 1187152 (part 3) - Replace nsBaseHashtable::Enumerate() calls in modules/ with iterators. r=froydnj. (48c78d75e6)
2023-03-23 10:03:31 +08:00

56 lines
2.1 KiB
C++

/* -*- 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/. */
#ifndef nsPrimitiveHelpers_h___
#define nsPrimitiveHelpers_h___
#include "nsError.h"
#include "nscore.h"
class nsISupports;
class nsPrimitiveHelpers
{
public:
// Given some data and the flavor it corresponds to, creates the appropriate
// nsISupports* wrapper for passing across IDL boundaries. The length parameter
// should not include the null if the data is null terminated.
static void CreatePrimitiveForData ( const char* aFlavor, const void* aDataBuff,
uint32_t aDataLen, nsISupports** aPrimitive ) ;
// A specific case of CreatePrimitive for windows CF_HTML handling in DataTransfer
static void CreatePrimitiveForCFHTML ( const void* aDataBuff,
uint32_t* aDataLen, nsISupports** aPrimitive ) ;
// Given a nsISupports* primitive and the flavor it represents, creates a new data
// buffer with the data in it. This data will be null terminated, but the length
// parameter does not reflect that.
static void CreateDataFromPrimitive ( const char* aFlavor, nsISupports* aPrimitive,
void** aDataBuff, uint32_t aDataLen ) ;
}; // class nsPrimitiveHelpers
class nsLinebreakHelpers
{
public:
// Given some data, convert from the platform linebreaks into the LF expected by the
// DOM. This will attempt to convert the data in place, but the buffer may still need to
// be reallocated regardless (disposing the old buffer is taken care of internally, see
// the note below).
//
// NOTE: this assumes that it can use 'free' to dispose of the old buffer.
static nsresult ConvertPlatformToDOMLinebreaks ( const char* inFlavor, void** ioData, int32_t* ioLengthInBytes ) ;
}; // class nsLinebreakHelpers
#endif // nsPrimitiveHelpers_h___