• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/DiskArbitration-268/DiskArbitration/

Lines Matching refs:session

84 __private_extern__ void _DADispatchCallback( DASessionRef    session,
95 DASessionRef session = ( DASessionRef ) object;
102 session->_name,
103 session->_pid,
104 session->_server );
109 DASessionRef session = ( DASessionRef ) object;
114 session->_name,
115 session->_pid,
116 session->_server );
121 __DASession * session;
123 session = ( void * ) _CFRuntimeCreateInstance( allocator, __kDASessionTypeID, sizeof( __DASession ) - sizeof( CFRuntimeBase ), NULL );
125 if ( session )
127 session->_authorization = NULL;
128 session->_client = NULL;
129 session->_name = NULL;
130 session->_pid = 0;
131 session->_server = MACH_PORT_NULL;
132 session->_source = NULL;
133 session->_source2 = NULL;
134 session->_sourceCount = 0;
137 return session;
142 DASessionRef session = ( DASessionRef ) object;
144 assert( session->_client == NULL );
145 assert( session->_source == NULL );
146 assert( session->_source2 == NULL );
148 if ( session->_authorization ) AuthorizationFree( session->_authorization, kAuthorizationFlagDefaults );
149 if ( session->_name ) free( session->_name );
150 if ( session->_server ) mach_port_deallocate( mach_task_self( ), session->_server );
163 DASessionRef session = ( DASessionRef ) object;
165 return ( CFHashCode ) session->_server;
172 DASessionRef session = info;
175 status = _DAServerSessionCopyCallbackQueue( session->_server, &_queue, &_queueSize );
181 queue = _DAUnserializeWithBytes( CFGetAllocator( session ), _queue, _queueSize );
210 _DADispatchCallback( session, address, context, ___CFDictionaryGetIntegerValue( callback, _kDACallbackKindKey ), argument0, argument1 );
221 __private_extern__ AuthorizationRef _DASessionGetAuthorization( DASessionRef session )
227 authorization = session->_authorization;
234 * Create the session's authorization reference.
244 * Create the session's authorization reference representation.
251 _DAServerSessionSetAuthorization( session->_server, _authorization );
253 session->_authorization = authorization;
271 __private_extern__ mach_port_t _DASessionGetClientPort( DASessionRef session )
277 if ( session->_client )
279 client = CFMachPortGetPort( session->_client );
287 __private_extern__ mach_port_t _DASessionGetID( DASessionRef session )
289 return session->_server;
297 __private_extern__ void _DASessionScheduleWithRunLoop( DASessionRef session )
299 session->_sourceCount++;
301 if ( session->_sourceCount == 1 )
307 * Create the session's client port.
319 * Set up the session's client port. It requires no more than one queue element.
334 clientContext.info = session;
340 * Create the session's client port run loop source.
343 client = CFMachPortCreateWithPort( CFGetAllocator( session ), clientPort, _DASessionCallback, &clientContext, NULL );
349 source = CFMachPortCreateRunLoopSource( CFGetAllocator( session ), client, 0 );
353 session->_client = client;
354 session->_source = source;
356 _DAServerSessionSetClientPort( session->_server, CFMachPortGetPort( client ) );
372 __private_extern__ void _DASessionUnscheduleFromRunLoop( DASessionRef session )
374 if ( session->_sourceCount == 1 )
376 if ( session->_source )
378 CFRunLoopSourceInvalidate( session->_source );
380 CFRelease( session->_source );
382 session->_source = NULL;
385 if ( session->_client )
389 clientPort = CFMachPortGetPort( session->_client );
391 CFMachPortInvalidate( session->_client );
393 CFRelease( session->_client );
397 session->_client = NULL;
401 if ( session->_sourceCount )
403 session->_sourceCount--;
417 void DAApprovalSessionScheduleWithRunLoop( DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode )
419 DASessionScheduleWithRunLoop( session, runLoop, kDAApprovalRunLoopMode );
421 DASessionScheduleWithRunLoop( session, runLoop, runLoopMode );
424 void DAApprovalSessionUnscheduleFromRunLoop( DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode )
426 DASessionUnscheduleFromRunLoop( session, runLoop, kDAApprovalRunLoopMode );
428 DASessionUnscheduleFromRunLoop( session, runLoop, runLoopMode );
433 DASessionRef session;
442 * Create the session.
445 session = __DASessionCreate( allocator );
447 if ( session )
475 * Create the session at the server.
487 session->_name = strdup( basename( ( char * ) _dyld_get_image_name( 0 ) ) );
488 session->_pid = getpid( );
489 session->_server = server;
492 if ( strcmp( session->_name, "SystemUIServer" ) == 0 )
494 _DASessionGetAuthorization( session );
497 return session;
502 CFRelease( session );
513 void DASessionScheduleWithRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode )
515 if ( session )
517 _DASessionScheduleWithRunLoop( session );
519 if ( session->_source )
521 CFRunLoopAddSource( runLoop, session->_source, runLoopMode );
526 void DASessionSetDispatchQueue( DASessionRef session, dispatch_queue_t queue )
528 if ( session )
530 if ( session->_source2 )
532 dispatch_source_cancel( session->_source2 );
534 dispatch_release( session->_source2 );
536 session->_source2 = NULL;
545 * Create the session's client port.
557 * Set up the session's client port. It requires no more than one queue element.
571 * Create the session's client port dispatch source.
578 session->_source2 = source;
580 CFRetain( session );
582 dispatch_source_set_cancel_handler( session->_source2, ^
586 CFRelease( session );
589 dispatch_source_set_event_handler( session->_source2, ^
595 _DASessionCallback( NULL, NULL, 0, session );
598 dispatch_resume( session->_source2 );
600 _DAServerSessionSetClientPort( session->_server, client );
612 void DASessionUnscheduleFromRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode )
614 if ( session )
616 if ( session->_source )
618 CFRunLoopRemoveSource( runLoop, session->_source, runLoopMode );
621 _DASessionUnscheduleFromRunLoop( session );