Bug 1853320 [wpt PR 41940] - [FLEDGE] Split up runs of /trusted-scoring-signals.https...
[gecko.git] / storage / mozIStorageBindingParams.idl
blob6a5279e07dac3fcfdc655ee7dec495c36240d2bb
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=2 sts=2 et
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 interface nsIVariant;
11 [ptr] native octetPtr(uint8_t);
13 [scriptable, builtinclass, uuid(2d09f42f-966e-4663-b4b3-b0c8676bf2bf)]
14 interface mozIStorageBindingParams : nsISupports {
15 /**
16 * Binds aValue to the parameter with the name aName.
18 * @param aName
19 * The name of the parameter to bind aValue to.
20 * @param aValue
21 * The value to bind.
23 void bindByName(in AUTF8String aName,
24 in nsIVariant aValue);
25 [noscript] void bindUTF8StringByName(in AUTF8String aName,
26 in AUTF8String aValue);
27 [noscript] void bindStringByName(in AUTF8String aName,
28 in AString aValue);
29 [noscript] void bindDoubleByName(in AUTF8String aName,
30 in double aValue);
31 [noscript] void bindInt32ByName(in AUTF8String aName,
32 in long aValue);
33 [noscript] void bindInt64ByName(in AUTF8String aName,
34 in long long aValue);
35 [noscript] void bindNullByName(in AUTF8String aName);
37 // The noscript version of bindBlobByName can be used with any (const
38 // uint8_t*, length) pair. The scriptable version is meant for use with
39 // nsTArray<uint8_t>, which is what xpconnect has to work with.
40 [noscript, binaryname(BindBlobByName)]
41 void bindBlobByNameNoscript(in AUTF8String aName,
42 [const] in octetPtr aValue,
43 in unsigned long aValueSize);
44 [binaryname(BindBlobArrayByName)]
45 void bindBlobByName(in AUTF8String aName, in Array<octet> aValue);
47 // Convenience routines for storing strings as blobs.
48 void bindStringAsBlobByName(in AUTF8String aName, in AString aValue);
49 void bindUTF8StringAsBlobByName(in AUTF8String aName, in AUTF8String aValue);
51 // The function adopts the storage for the provided blob. After calling
52 // this function, mozStorage will ensure that free is called on the
53 // underlying pointer.
54 [noscript]
55 void bindAdoptedBlobByName(in AUTF8String aName,
56 in octetPtr aValue,
57 in unsigned long aValueSize);
59 /**
60 * Binds aValue to the parameter with the index aIndex.
62 * @param aIndex
63 * The zero-based index of the parameter to bind aValue to.
64 * @param aValue
65 * The value to bind.
67 void bindByIndex(in unsigned long aIndex,
68 in nsIVariant aValue);
69 [noscript] void bindUTF8StringByIndex(in unsigned long aIndex,
70 in AUTF8String aValue);
71 [noscript] void bindStringByIndex(in unsigned long aIndex,
72 in AString aValue);
73 [noscript] void bindDoubleByIndex(in unsigned long aIndex,
74 in double aValue);
75 [noscript] void bindInt32ByIndex(in unsigned long aIndex,
76 in long aValue);
77 [noscript] void bindInt64ByIndex(in unsigned long aIndex,
78 in long long aValue);
79 [noscript] void bindNullByIndex(in unsigned long aIndex);
81 // The noscript version of bindBlobByIndex can be used with any (const
82 // uint8_t*, length) pair. The scriptable version is meant for use with
83 // nsTArray<uint8_t>, which is what xpconnect has to work with.
84 [noscript, binaryname(BindBlobByIndex)]
85 void bindBlobByIndexNoscript(in unsigned long aIndex,
86 [const] in octetPtr aValue,
87 in unsigned long aValueSize);
88 [binaryname(BindBlobArrayByIndex)]
89 void bindBlobByIndex(in unsigned long aIndex,
90 in Array<octet> aValue);
92 // Convenience routines for storing strings as blobs.
93 void bindStringAsBlobByIndex(in unsigned long aIndex, in AString aValue);
94 void bindUTF8StringAsBlobByIndex(in unsigned long aIndex, in AUTF8String aValue);
96 // The function adopts the storage for the provided blob. After calling
97 // this function, mozStorage will ensure that free is called on the
98 // underlying pointer.
99 [noscript]
100 void bindAdoptedBlobByIndex(in unsigned long aIndex,
101 in octetPtr aValue,
102 in unsigned long aValueSize);