1710 // called, which means that such provider may be removed from |
1710 // called, which means that such provider may be removed from |
1711 // the map and destroyed. Otherwise, such hostlets are destroyed, |
1711 // the map and destroyed. Otherwise, such hostlets are destroyed, |
1712 // when server (main thread) goes down. |
1712 // when server (main thread) goes down. |
1713 |
1713 |
1714 pLookupInfo = NULL; |
1714 pLookupInfo = NULL; |
1715 if(pHostlet && pHostlet->Threadsafe()) |
1715 if(pHostlet->Threadsafe()) |
1716 { |
1716 { |
1717 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel,"- Adding new threadsafe, unsharable provider into cache."); |
1717 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMaxLogLevel,"- Adding new threadsafe, unsharable provider into cache."); |
1718 pLookupInfo = CSenHostletLookupInfo::NewLC(aReqThreadId, aReqConsumerId); |
1718 pLookupInfo = CSenHostletLookupInfo::NewLC(aReqThreadId, aReqConsumerId); |
1719 } |
1719 } |
1720 else |
1720 else |
1721 { |
1721 { |
1722 // Any non-threadsafe provider should compare whether consumer ID |
1722 // Any non-threadsafe provider should compare whether consumer ID |
1723 // is equal. The thread ID is irrelevant in the matching. |
1723 // is equal. The thread ID is irrelevant in the matching. |
1724 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel,"- Adding new non-threadsafe, unsharable provider into cache."); |
1724 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMaxLogLevel,"- Adding new non-threadsafe, unsharable provider into cache."); |
1725 pLookupInfo = CSenHostletLookupInfo::NewLC(KNullDesC, aReqConsumerId); |
1725 pLookupInfo = CSenHostletLookupInfo::NewLC(KNullDesC, aReqConsumerId); |
1726 } |
1726 } |
1727 |
1727 |
1728 pLookupInfo->IncrementLookupCount(); |
1728 pLookupInfo->IncrementLookupCount(); |
1729 append = iUnsharableProviders.Append(pLookupInfo, pHostlet); |
1729 append = iUnsharableProviders.Append(pLookupInfo, pHostlet); |
1730 if(append==KErrNone) |
1730 if(append==KErrNone) |
1731 { |
1731 { |
1732 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KMinLogLevel, _L8("- Loaded new unsharable hostlet instance: 0x%X, lookup info: 0x%X, lookup count: %d"), pHostlet, pLookupInfo, pLookupInfo->LookupCount())); |
1732 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KMaxLogLevel, _L8("- Loaded new unsharable hostlet instance: 0x%X, lookup info: 0x%X, lookup count: %d"), pHostlet, pLookupInfo, pLookupInfo->LookupCount())); |
1733 CleanupStack::Pop(2); // pLookupInfo, pHostlet |
1733 CleanupStack::Pop(2); // pLookupInfo, pHostlet |
1734 } |
1734 } |
1735 else |
1735 else |
1736 { |
1736 { |
1737 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel,"- iUnsharableProviders.Append failed."); // OOM case |
1737 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel,"- iUnsharableProviders.Append failed."); // OOM case |
1931 delete ipLookupCount; |
1931 delete ipLookupCount; |
1932 } |
1932 } |
1933 |
1933 |
1934 TPtrC CSenHostletLookupInfo::ThreadId() const |
1934 TPtrC CSenHostletLookupInfo::ThreadId() const |
1935 { |
1935 { |
1936 if(ipFullThreadName) |
1936 return *ipFullThreadName; |
1937 { |
|
1938 return *ipFullThreadName; |
|
1939 } |
|
1940 else |
|
1941 { |
|
1942 return KNullDesC(); |
|
1943 } |
|
1944 } |
1937 } |
1945 |
1938 |
1946 TPtrC8 CSenHostletLookupInfo::ConsumerId() const |
1939 TPtrC8 CSenHostletLookupInfo::ConsumerId() const |
1947 { |
1940 { |
1948 if(ipUniqueConsumerId) |
1941 return *ipUniqueConsumerId; |
1949 { |
|
1950 return *ipUniqueConsumerId; |
|
1951 } |
|
1952 else |
|
1953 { |
|
1954 return KNullDesC8(); |
|
1955 } |
|
1956 } |
1942 } |
1957 |
1943 |
1958 |
1944 |
1959 TInt CSenHostletLookupInfo::LookupCount() const |
1945 TInt CSenHostletLookupInfo::LookupCount() const |
1960 { |
1946 { |
1972 } |
1958 } |
1973 |
1959 |
1974 |
1960 |
1975 TBool CSenHostletLookupInfo::operator==(const CSenHostletLookupInfo& aHostletRequestor) |
1961 TBool CSenHostletLookupInfo::operator==(const CSenHostletLookupInfo& aHostletRequestor) |
1976 { |
1962 { |
1977 if(ipFullThreadName && ipUniqueConsumerId) |
1963 return((ipFullThreadName->Length()==0 || aHostletRequestor.ThreadId() == *ipFullThreadName) |
1978 { |
|
1979 return((ipFullThreadName->Length()==0 || aHostletRequestor.ThreadId() == *ipFullThreadName) |
|
1980 && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId); |
1964 && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId); |
1981 } |
1965 |
1982 else |
|
1983 { |
|
1984 return EFalse; |
|
1985 } |
|
1986 // return (aHostletRequestor.ThreadId() == *ipFullThreadName |
1966 // return (aHostletRequestor.ThreadId() == *ipFullThreadName |
1987 // && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId); |
1967 // && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId); |
1988 } |
1968 } |
1989 |
1969 |
1990 |
1970 |