Changeset 58423 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 26, 2015 6:00:31 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103679
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/net
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloader.cpp
r58394 r58423 48 48 49 49 /* Create network request set: */ 50 createNetworkRequest( requests, UINetworkRequestType_HEAD);50 createNetworkRequest(UINetworkRequestType_HEAD, requests); 51 51 } 52 52 … … 61 61 62 62 /* Create network request: */ 63 createNetworkRequest( request, UINetworkRequestType_GET);63 createNetworkRequest(UINetworkRequestType_GET, QList<QNetworkRequest>() << request); 64 64 } 65 65 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.cpp
r58394 r58423 42 42 } 43 43 44 void UINetworkCustomer::createNetworkRequest( const QNetworkRequest &request, UINetworkRequestType type)44 void UINetworkCustomer::createNetworkRequest(UINetworkRequestType type, const QList<QNetworkRequest> requests) 45 45 { 46 gNetworkManager->createNetworkRequest( request, type, this);46 gNetworkManager->createNetworkRequest(type, requests, this); 47 47 } 48 48 49 void UINetworkCustomer::createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type)50 {51 gNetworkManager->createNetworkRequest(requests, type, this);52 }53 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.h
r58394 r58423 55 55 protected: 56 56 57 /* Network-request wrapper: */ 58 void createNetworkRequest(const QNetworkRequest &request, UINetworkRequestType type); 59 /* Network-request wrapper (set): */ 60 void createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type); 57 /** Creates network-request of the passed @a type on the basis of the passed @a requests. */ 58 void createNetworkRequest(UINetworkRequestType type, const QList<QNetworkRequest> requests); 61 59 62 60 private: -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.cpp
r58394 r58423 107 107 } 108 108 109 void UINetworkManager::createNetworkRequest( const QNetworkRequest &request, UINetworkRequestType type,109 void UINetworkManager::createNetworkRequest(UINetworkRequestType type, const QList<QNetworkRequest> &requests, 110 110 UINetworkCustomer *pCustomer) 111 111 { 112 112 /* Create network-request: */ 113 UINetworkRequest *pNetworkRequest = new UINetworkRequest(request, type, pCustomer, this); 114 /* Prepare created network-request: */ 115 prepareNetworkRequest(pNetworkRequest); 116 } 117 118 void UINetworkManager::createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type, 119 UINetworkCustomer *pCustomer) 120 { 121 /* Create network-request: */ 122 UINetworkRequest *pNetworkRequest = new UINetworkRequest(requests, type, pCustomer, this); 113 UINetworkRequest *pNetworkRequest = new UINetworkRequest(type, requests, pCustomer, this); 123 114 /* Prepare created network-request: */ 124 115 prepareNetworkRequest(pNetworkRequest); -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.h
r58394 r58423 81 81 /* Allow UINetworkCustomer to create network-request: */ 82 82 friend class UINetworkCustomer; 83 /* Network-request creation wrappers for UINetworkCustomer: */ 84 void createNetworkRequest(const QNetworkRequest &request, UINetworkRequestType type, 85 UINetworkCustomer *pCustomer); 86 void createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type, 83 /** Creates network-request of the passed @a type 84 * on the basis of the passed @a requests for the @a pCustomer specified. */ 85 void createNetworkRequest(UINetworkRequestType type, const QList<QNetworkRequest> &requests, 87 86 UINetworkCustomer *pCustomer); 88 87 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp
r58422 r58423 70 70 public: 71 71 72 /** Constructs reply thread for the passed @a request of the passed @a type. */73 UINetworkReplyPrivateThread( const QNetworkRequest &request, UINetworkRequestType type);72 /** Constructs network-reply thread of the passed @a type for the passed @a request. */ 73 UINetworkReplyPrivateThread(UINetworkRequestType type, const QNetworkRequest &request); 74 74 75 75 /** @name APIs … … 189 189 } CERTINFO; 190 190 191 /** Holds the request type. */ 192 const UINetworkRequestType m_type; 191 193 /** Holds the request instance. */ 192 194 QNetworkRequest m_request; 193 /** Holds the request type. */194 UINetworkRequestType m_type;195 195 196 196 /** Holds the IPRT HTTP client instance handle. */ … … 242 242 public: 243 243 244 /** Constructs reply private data for the passed @a request of the passed @a type. */245 UINetworkReplyPrivate( const QNetworkRequest &request, UINetworkRequestType type);244 /** Constructs network-reply private data of the passed @a type for the passed @a request. */ 245 UINetworkReplyPrivate(UINetworkRequestType type, const QNetworkRequest &request); 246 246 /** Destructs reply private data. */ 247 247 ~UINetworkReplyPrivate(); … … 342 342 const QString UINetworkReplyPrivateThread::s_strCertificateFileName = QString("vbox-ssl-cacertificate.crt"); 343 343 344 UINetworkReplyPrivateThread::UINetworkReplyPrivateThread( const QNetworkRequest &request, UINetworkRequestType type)345 : m_ request(request)346 , m_ type(type)344 UINetworkReplyPrivateThread::UINetworkReplyPrivateThread(UINetworkRequestType type, const QNetworkRequest &request) 345 : m_type(type) 346 , m_request(request) 347 347 , m_hHttp(NIL_RTHTTP) 348 348 , m_iError(VINF_SUCCESS) … … 918 918 *********************************************************************************************************************************/ 919 919 920 UINetworkReplyPrivate::UINetworkReplyPrivate( const QNetworkRequest &request, UINetworkRequestType type)920 UINetworkReplyPrivate::UINetworkReplyPrivate(UINetworkRequestType type, const QNetworkRequest &request) 921 921 : m_error(UINetworkReply::NoError) 922 922 , m_pThread(0) … … 926 926 927 927 /* Create and run reply thread: */ 928 m_pThread = new UINetworkReplyPrivateThread( request, type);928 m_pThread = new UINetworkReplyPrivateThread(type, request); 929 929 connect(m_pThread, SIGNAL(sigDownloadProgress(qint64, qint64)), 930 930 this, SIGNAL(downloadProgress(qint64, qint64)), Qt::QueuedConnection); … … 991 991 *********************************************************************************************************************************/ 992 992 993 UINetworkReply::UINetworkReply( const QNetworkRequest &request, UINetworkRequestType type)994 : m_pReply(new UINetworkReplyPrivate( request, type))993 UINetworkReply::UINetworkReply(UINetworkRequestType type, const QNetworkRequest &request) 994 : m_pReply(new UINetworkReplyPrivate(type, request)) 995 995 { 996 996 /* Prepare network-reply object connections: */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.h
r58422 r58423 84 84 }; 85 85 86 /** Constructs reply for the passed @a request of the passed @a type. */87 UINetworkReply( const QNetworkRequest &request, UINetworkRequestType type);86 /** Constructs network-reply of the passed @a type for the passed @a request. */ 87 UINetworkReply(UINetworkRequestType type, const QNetworkRequest &request); 88 88 /** Destructs reply. */ 89 89 ~UINetworkReply(); -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.cpp
r58422 r58423 35 35 36 36 37 /* Constructor: */ 38 UINetworkRequest::UINetworkRequest(const QNetworkRequest &request, UINetworkRequestType type,37 UINetworkRequest::UINetworkRequest(UINetworkRequestType type, 38 const QList<QNetworkRequest> &requests, 39 39 UINetworkCustomer *pCustomer, 40 40 UINetworkManager *pNetworkManager) 41 41 : QObject(pNetworkManager) 42 , m_uuid(QUuid::createUuid())43 , m_requests(QList<QNetworkRequest>() << request)44 , m_iCurrentRequestIndex(0)45 42 , m_type(type) 46 , m_pCustomer(pCustomer)47 , m_fRunning(false)48 {49 /* Initialize: */50 initialize();51 }52 53 UINetworkRequest::UINetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type,54 UINetworkCustomer *pCustomer,55 UINetworkManager *pNetworkManager)56 : QObject(pNetworkManager)57 43 , m_uuid(QUuid::createUuid()) 58 44 , m_requests(requests) 59 45 , m_iCurrentRequestIndex(0) 60 , m_type(type)61 46 , m_pCustomer(pCustomer) 62 47 , m_fRunning(false) … … 66 51 } 67 52 68 /* Destructor: */69 53 UINetworkRequest::~UINetworkRequest() 70 54 { … … 204 188 { 205 189 /* Make network-request: */ 206 m_pReply = new UINetworkReply(m_ request, m_type);190 m_pReply = new UINetworkReply(m_type, m_request); 207 191 AssertMsg(m_pReply, ("Unable to make network-request!\n")); 208 192 /* Prepare listeners for m_pReply: */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.h
r58394 r58423 57 57 public: 58 58 59 /* Constructor/destructor: */ 60 UINetworkRequest(const QNetworkRequest &request, UINetworkRequestType type, 59 /** Constructs network-request of the passed @a type 60 * on the basis of the @a requests 61 * for the @a pCustomer and @a pNetworkManager specified. */ 62 UINetworkRequest(UINetworkRequestType type, 63 const QList<QNetworkRequest> &requests, 61 64 UINetworkCustomer *pCustomer, 62 65 UINetworkManager *pNetworkManager); 63 UINetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type, 64 UINetworkCustomer *pCustomer, 65 UINetworkManager *pNetworkManager); 66 /** Destructs network request. */ 66 67 ~UINetworkRequest(); 67 68 … … 99 100 100 101 /* Variables: */ 102 UINetworkRequestType m_type; 101 103 QUuid m_uuid; 102 104 QList<QNetworkRequest> m_requests; 103 105 QNetworkRequest m_request; 104 106 int m_iCurrentRequestIndex; 105 UINetworkRequestType m_type;106 107 QString m_strDescription; 107 108 UINetworkCustomer *m_pCustomer; -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp
r58394 r58423 199 199 request.setUrl(url); 200 200 request.setRawHeader("User-Agent", strUserAgent.toAscii()); 201 createNetworkRequest( request, UINetworkRequestType_GET);201 createNetworkRequest(UINetworkRequestType_GET, QList<QNetworkRequest>() << request); 202 202 } 203 203 -
trunk/src/VBox/Frontends/VirtualBox/src/net/tstSSLCertDownloads.cpp
r58365 r58423 46 46 NOREF(hTest); 47 47 QNetworkRequest Dummy; 48 UINetworkReplyPrivateThread TestObj( Dummy, UINetworkRequestType_GET);48 UINetworkReplyPrivateThread TestObj(UINetworkRequestType_GET, Dummy); 49 49 50 50 /*
Note:
See TracChangeset
for help on using the changeset viewer.