- Timestamp:
- Apr 30, 2007 3:55:21 PM (18 years ago)
- Location:
- trunk/src/libs/xpcom18a4/ipc/ipcd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcd.cpp
r1 r2440 118 118 IPC_NotifyClientUp(ipcClient *client) 119 119 { 120 LOG(("IPC_NotifyClientUp: clientID=%d\n", client->ID())); 121 120 122 // notify modules before other clients 121 123 IPC_NotifyModulesClientUp(client); … … 131 133 IPC_NotifyClientDown(ipcClient *client) 132 134 { 135 LOG(("IPC_NotifyClientDown: clientID=%d\n", client->ID())); 136 133 137 // notify modules before other clients 134 138 IPC_NotifyModulesClientDown(client); -
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp
r2109 r2440 68 68 69 69 // XXX TODO: 70 // 1. add a client observer and prune mInstances when a peer disconnects 71 // 2. add thread affinity field to SETUP messages 72 // 3. support array parameters 70 // 1. add thread affinity field to SETUP messages 71 // 2. support array parameters 73 72 74 73 //----------------------------------------------------------------------------- … … 213 212 nsISupports *RealInstance() { return mInstance; } 214 213 nsIInterfaceInfo *InterfaceInfo() { return mIInfo; } 214 PRUint32 Peer() { return mPeer; } 215 215 216 216 DConnectInstanceKey::Key GetKey() { … … 2220 2220 { 2221 2221 // this method is to be called on ipcDConnectService shutdown only 2222 // (after which no DConnectInstance 's may exist), so forcedly delete them2222 // (after which no DConnectInstances may exist), so forcibly delete them 2223 2223 // disregarding the reference counter 2224 2224 … … 2646 2646 } 2647 2647 2648 struct PruneInstanceMapForPeerArgs 2649 { 2650 PRUint32 clientID; 2651 DConnectInstanceMap &instances; 2652 DConnectInstanceSet &instanceSet; 2653 }; 2654 2655 PR_STATIC_CALLBACK(PLDHashOperator) 2656 PruneInstanceMapForPeer (const DConnectInstanceKey::Key &aKey, 2657 DConnectInstance *aData, 2658 void *userArg) 2659 { 2660 PruneInstanceMapForPeerArgs *args = (PruneInstanceMapForPeerArgs *)userArg; 2661 NS_ASSERTION(args, "PruneInstanceMapForPeerArgs is NULL"); 2662 2663 if (args && args->clientID == aData->Peer()) 2664 { 2665 #ifdef IPC_LOGGING 2666 const char *name; 2667 aData->InterfaceInfo()->GetNameShared(&name); 2668 LOG(("PruneInstanceMapForClient(): instance=%p iface=%p {%s} peer=%d\n", 2669 aData, aData->RealInstance(), name, args->clientID)); 2670 #endif 2671 args->instances.Remove(aKey); 2672 args->instanceSet.Remove(aData); 2673 /* ignore the reference counter: the client is officially dead */ 2674 delete aData; 2675 } 2676 return PL_DHASH_NEXT; 2677 } 2678 2648 2679 NS_IMETHODIMP 2649 2680 ipcDConnectService::OnClientStateChange(PRUint32 aClientID, 2650 2681 PRUint32 aClientState) 2651 2682 { 2652 LOG (("ipcDConnectService::OnClientStateChange: aClientID=%d, aClientState=%d\n", 2653 aClientID, aClientState)); 2654 2655 if (aClientID == IPC_SENDER_ANY) 2656 { 2683 LOG(("ipcDConnectService::OnClientStateChange: aClientID=%d, aClientState=%d\n", 2684 aClientID, aClientState)); 2685 2686 if (aClientState == ipcIClientObserver::CLIENT_DOWN) 2687 { 2688 if (aClientID == IPC_SENDER_ANY) 2689 { 2657 2690 // a special case: our IPC system is being shutdown, try to safely 2658 2691 // uninitialize everything... 2659 2692 Shutdown(); 2693 } 2694 else 2695 { 2696 LOG(("ipcDConnectService::OnClientStateChange: " 2697 "pruning all instances created for peer %d...\n", aClientID)); 2698 2699 nsAutoLock lock (mLock); 2700 2701 // make sure we have released all instances 2702 PruneInstanceMapForPeerArgs args = { aClientID, mInstances, mInstanceSet }; 2703 mInstances.EnumerateRead(PruneInstanceMapForPeer, (void *)&args); 2704 } 2660 2705 } 2661 2706
Note:
See TracChangeset
for help on using the changeset viewer.