Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | QThreadStorage<QSharedNetworkSessionManager *> tls; | - |
7 | | - |
8 | inline QSharedNetworkSessionManager* sharedNetworkSessionManager() | - |
9 | { | - |
10 | QSharedNetworkSessionManager* rv = tls.localData(); | - |
11 | if (!rv) { evaluated: !rv 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 | | - |
18 | static void doDeleteLater(QObject* obj) | - |
19 | { | - |
20 | obj->deleteLater(); | - |
21 | } executed: } Execution Count:5 | 5 |
22 | | - |
23 | QSharedPointer<QNetworkSession> QSharedNetworkSessionManager::getSession(QNetworkConfiguration config) | - |
24 | { | - |
25 | QSharedNetworkSessionManager *m(sharedNetworkSessionManager()); | - |
26 | | - |
27 | if (m->sessions.contains(config)) { partially evaluated: m->sessions.contains(config) 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 | } | 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 | | - |
38 | void QSharedNetworkSessionManager::setSession(QNetworkConfiguration config, QSharedPointer<QNetworkSession> session) | - |
39 | { | - |
40 | QSharedNetworkSessionManager *m(sharedNetworkSessionManager()); | - |
41 | m->sessions[config] = session; | - |
42 | } | 0 |
43 | | - |
44 | uint 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 | | - |
| | |