Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 // make sure to include all the required file headers
7 #include "nsISupports.idl"
9 interface nsIObserver;
11 /**
12 * nsIKeygenThread
13 * This is used to communicate with the thread generating a key pair,
14 * to be used by the dialog displaying status information.
15 */
16 [scriptable, uuid(8712a243-5539-447c-9f47-8653f40c3a09)]
17 interface nsIKeygenThread : nsISupports
18 {
19 /**
20 * startKeyGeneration - run the thread
21 * A user interface using this interface needs to
22 * call this method as soon as the status information
23 * is displaying. This will trigger key generation.
24 * To allow the closure of the status information,
25 * the thread needs a handle to an observer.
26 *
27 * observer will be called on the UI thread.
28 * When the key generation is done, the observe method will
29 * be called with a topic of "keygen-finished" and null data
30 * and subject.
31 */
32 void startKeyGeneration(in nsIObserver observer);
34 /**
35 * userCanceled - notify the thread
36 * If the user canceled, the thread is no longer allowed to
37 * close the dialog. However, if the thread already closed
38 * it, we are not allowed to close it.
39 */
40 void userCanceled(out boolean threadAlreadyClosedDialog);
41 };
43 %{ C++
44 // {195763b8-1dd2-11b2-a843-eb44e44aaa37}
45 #define NS_KEYGENTHREAD_CID \
46 { 0x195763b8, 0x1dd2, 0x11b2, { 0xa8, 0x43, 0xeb, 0x44, 0xe4, 0x4a, 0xaa, 0x37 } }
47 #define NS_KEYGENTHREAD_CONTRACTID "@mozilla.org/security/keygenthread;1"
48 %}