Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/network/bearer/qsharednetworksession.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | QThreadStorage<QSharedNetworkSessionManager *> tls; | - | ||||||
7 | - | |||||||
8 | inline QSharedNetworkSessionManager* sharedNetworkSessionManager() | - | ||||||
9 | { | - | ||||||
10 | QSharedNetworkSessionManager* rv = tls.localData(); | - | ||||||
11 | if (!rv
| 9-213 | ||||||
12 | rv = new QSharedNetworkSessionManager; | - | ||||||
13 | tls.setLocalData(rv); | - | ||||||
14 | } executed 9 times by 9 tests: end of block Executed by:
| 9 | ||||||
15 | return executed 222 times by 9 tests: rv;return rv; Executed by:
executed 222 times by 9 tests: return rv; Executed by:
| 222 | ||||||
16 | } | - | ||||||
17 | - | |||||||
18 | static void doDeleteLater(QObject* obj) | - | ||||||
19 | { | - | ||||||
20 | obj->deleteLater(); | - | ||||||
21 | } executed 59 times by 9 tests: end of block Executed by:
| 59 | ||||||
22 | - | |||||||
23 | QSharedPointer<QNetworkSession> QSharedNetworkSessionManager::getSession(const QNetworkConfiguration &config) | - | ||||||
24 | { | - | ||||||
25 | QSharedNetworkSessionManager *m(sharedNetworkSessionManager()); | - | ||||||
26 | const auto it = m->sessions.constFind(config); | - | ||||||
27 | - | |||||||
28 | if (it != m->sessions.cend()
| 11-211 | ||||||
29 | QSharedPointer<QNetworkSession> p = it.value().toStrongRef(); | - | ||||||
30 | if (!p.isNull()
| 49-162 | ||||||
31 | return executed 162 times by 4 tests: p;return p; Executed by:
executed 162 times by 4 tests: return p; Executed by:
| 162 | ||||||
32 | } executed 49 times by 4 tests: end of block Executed by:
| 49 | ||||||
33 | - | |||||||
34 | QSharedPointer<QNetworkSession> session(new QNetworkSession(config), doDeleteLater); | - | ||||||
35 | m->sessions[config] = session; | - | ||||||
36 | return executed 60 times by 9 tests: session;return session; Executed by:
executed 60 times by 9 tests: return session; Executed by:
| 60 | ||||||
37 | } | - | ||||||
38 | - | |||||||
39 | void QSharedNetworkSessionManager::setSession(const QNetworkConfiguration &config, QSharedPointer<QNetworkSession> session) | - | ||||||
40 | { | - | ||||||
41 | QSharedNetworkSessionManager *m(sharedNetworkSessionManager()); | - | ||||||
42 | m->sessions[config] = session; | - | ||||||
43 | } never executed: end of block | 0 | ||||||
44 | - | |||||||
45 | uint qHash(const QNetworkConfiguration& config) | - | ||||||
46 | { | - | ||||||
47 | return executed 282 times by 9 tests: ((uint)config.type()) | (((uint)config.bearerType()) << 8) | (((uint)config.purpose()) << 16);return ((uint)config.type()) | (((uint)config.bearerType()) << 8) | (((uint)config.purpose()) << 16); Executed by:
executed 282 times by 9 tests: return ((uint)config.type()) | (((uint)config.bearerType()) << 8) | (((uint)config.purpose()) << 16); Executed by:
| 282 | ||||||
48 | } | - | ||||||
49 | - | |||||||
50 | - | |||||||
Switch to Source code | Preprocessed file |