bearer/qsharednetworksession.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6QThreadStorage<QSharedNetworkSessionManager *> tls; -
7 -
8inline QSharedNetworkSessionManager* sharedNetworkSessionManager() -
9{ -
10 QSharedNetworkSessionManager* rv = tls.localData(); -
11 if (!rv) {
evaluated: !rv
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-3
12 rv = new QSharedNetworkSessionManager; -
13 tls.setLocalData(rv); -
14 }
executed: }
Execution Count:2
2
15 return rv;
executed: return rv;
Execution Count:5
5
16} -
17 -
18static void doDeleteLater(QObject* obj) -
19{ -
20 obj->deleteLater(); -
21}
executed: }
Execution Count:5
5
22 -
23QSharedPointer<QNetworkSession> QSharedNetworkSessionManager::getSession(QNetworkConfiguration config) -
24{ -
25 QSharedNetworkSessionManager *m(sharedNetworkSessionManager()); -
26 -
27 if (m->sessions.contains(config)) {
partially evaluated: m->sessions.contains(config)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
28 QSharedPointer<QNetworkSession> p = m->sessions.value(config).toStrongRef(); -
29 if (!p.isNull())
never evaluated: !p.isNull()
0
30 return p;
never executed: return p;
0
31 }
never executed: }
0
32 -
33 QSharedPointer<QNetworkSession> session(new QNetworkSession(config), doDeleteLater); -
34 m->sessions[config] = session; -
35 return session;
executed: return session;
Execution Count:5
5
36} -
37 -
38void QSharedNetworkSessionManager::setSession(QNetworkConfiguration config, QSharedPointer<QNetworkSession> session) -
39{ -
40 QSharedNetworkSessionManager *m(sharedNetworkSessionManager()); -
41 m->sessions[config] = session; -
42}
never executed: }
0
43 -
44uint qHash(const QNetworkConfiguration& config) -
45{ -
46 return ((uint)config.type()) | (((uint)config.bearerType()) << 8) | (((uint)config.purpose()) << 16);
executed: return ((uint)config.type()) | (((uint)config.bearerType()) << 8) | (((uint)config.purpose()) << 16);
Execution Count:10
10
47} -
48 -
49 -
50 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial