| 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 blockExecuted 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 blockExecuted by:
| 59 | ||||||
| 22 | - | |||||||
| 23 | QSharedPointer<QNetworkSession> QSharedNetworkSessionManager::getSession(QNetworkConfiguration config) | - | ||||||
| 24 | { | - | ||||||
| 25 | QSharedNetworkSessionManager *m(sharedNetworkSessionManager()); | - | ||||||
| 26 | - | |||||||
| 27 | if (m->sessions.contains(config)
| 11-211 | ||||||
| 28 | QSharedPointer<QNetworkSession> p = m->sessions.value(config).toStrongRef(); | - | ||||||
| 29 | if (!p.isNull()
| 49-162 | ||||||
| 30 | return executed 162 times by 4 tests: p;return p;Executed by:
executed 162 times by 4 tests: return p;Executed by:
| 162 | ||||||
| 31 | } executed 49 times by 4 tests: end of blockExecuted by:
| 49 | ||||||
| 32 | - | |||||||
| 33 | QSharedPointer<QNetworkSession> session(new QNetworkSession(config), doDeleteLater); | - | ||||||
| 34 | m->sessions[config] = session; | - | ||||||
| 35 | return executed 60 times by 9 tests: session;return session;Executed by:
executed 60 times by 9 tests: return session;Executed by:
| 60 | ||||||
| 36 | } | - | ||||||
| 37 | - | |||||||
| 38 | void QSharedNetworkSessionManager::setSession(QNetworkConfiguration config, QSharedPointer<QNetworkSession> session) | - | ||||||
| 39 | { | - | ||||||
| 40 | QSharedNetworkSessionManager *m(sharedNetworkSessionManager()); | - | ||||||
| 41 | m->sessions[config] = session; | - | ||||||
| 42 | } never executed: end of block | 0 | ||||||
| 43 | - | |||||||
| 44 | uint qHash(const QNetworkConfiguration& config) | - | ||||||
| 45 | { | - | ||||||
| 46 | return executed 493 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 493 times by 9 tests: return ((uint)config.type()) | (((uint)config.bearerType()) << 8) | (((uint)config.purpose()) << 16);Executed by:
| 493 | ||||||
| 47 | } | - | ||||||
| 48 | - | |||||||
| 49 | - | |||||||
| Switch to Source code | Preprocessed file |