]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_keychain/lib/CCallbackMgr.h
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / lib / CCallbackMgr.h
index 52ea8d1171b7513222ff3ddb6e6d3434c51eec0a..841a95df75ab01c23535d14f2d2b807033103110 100644 (file)
@@ -51,7 +51,8 @@ class CallbackInfo
 public:
        ~CallbackInfo();
        CallbackInfo();
-       CallbackInfo(SecKeychainCallback inCallbackFunction,SecKeychainEventMask inEventMask,void *inContext);
+       CallbackInfo(SecKeychainCallback inCallbackFunction,SecKeychainEventMask inEventMask,void *inContext, CFRunLoopRef runLoop);
+    CallbackInfo(const CallbackInfo& cb);
        
        bool operator ==(const CallbackInfo& other) const;
        bool operator !=(const CallbackInfo& other) const;
@@ -59,6 +60,8 @@ public:
        SecKeychainCallback mCallback;
        SecKeychainEventMask mEventMask;
        void *mContext;
+    CFRunLoopRef mRunLoop;
+    bool mActive;
 };
 
 // typedefs
@@ -89,9 +92,15 @@ private:
        void consume (SecurityServer::NotificationDomain domain, SecurityServer::NotificationEvent whichEvent,
                                  const CssmData &data);
        
-       static void AlertClients(const list<CallbackInfo> &eventCallbacks, SecKeychainEvent inEvent, pid_t inPid,
+    void AlertClients(const list<CallbackInfo> &eventCallbacks, SecKeychainEvent inEvent, pid_t inPid,
                                                         const Keychain& inKeychain, const Item &inItem);
 
+    // Use these as a CFRunLoop callback
+    static void tellClient(CFRunLoopTimerRef timer, void* ctx);
+    static void cfrunLoopActive(CFRunLoopTimerRef timer, void* info);
+
+    bool initialized() { return mInitialized; }
+
        list<CallbackInfo>              mEventCallbacks;
 };