equal
deleted
inserted
replaced
128 Page *page = frame->page(); |
128 Page *page = frame->page(); |
129 // If we are no longer attached to a Page, this must be an attempted load from an |
129 // If we are no longer attached to a Page, this must be an attempted load from an |
130 // onUnload handler, so let's just block it. |
130 // onUnload handler, so let's just block it. |
131 if (!page) |
131 if (!page) |
132 return false; |
132 return false; |
133 |
|
134 if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) { |
|
135 // If credentials were specified for this request, add them to the url, |
|
136 // so that they will be passed to QNetworkRequest. |
|
137 KURL urlWithCredentials(d->m_request.url()); |
|
138 urlWithCredentials.setUser(d->m_user); |
|
139 urlWithCredentials.setPass(d->m_pass); |
|
140 d->m_request.setURL(urlWithCredentials); |
|
141 } |
|
142 |
133 |
143 getInternal()->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame(); |
134 getInternal()->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame(); |
144 #if QT_VERSION < 0x040400 |
135 #if QT_VERSION < 0x040400 |
145 return QWebNetworkManager::self()->add(this, getInternal()->m_frame->page()->d->networkInterface); |
136 return QWebNetworkManager::self()->add(this, getInternal()->m_frame->page()->d->networkInterface); |
146 #else |
137 #else |
211 error = ResourceError(String(), -1, String(), String()); |
202 error = ResourceError(String(), -1, String(), String()); |
212 return; |
203 return; |
213 } |
204 } |
214 #else |
205 #else |
215 ResourceHandleInternal *d = handle.getInternal(); |
206 ResourceHandleInternal *d = handle.getInternal(); |
216 if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) { |
|
217 // If credentials were specified for this request, add them to the url, |
|
218 // so that they will be passed to QNetworkRequest. |
|
219 KURL urlWithCredentials(d->m_request.url()); |
|
220 urlWithCredentials.setUser(d->m_user); |
|
221 urlWithCredentials.setPass(d->m_pass); |
|
222 d->m_request.setURL(urlWithCredentials); |
|
223 } |
|
224 d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame(); |
207 d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame(); |
225 d->m_job = new QNetworkReplyHandler(&handle, QNetworkReplyHandler::LoadNormal); |
208 d->m_job = new QNetworkReplyHandler(&handle, QNetworkReplyHandler::LoadNormal); |
226 #endif |
209 #endif |
227 |
210 |
228 syncLoader.waitForCompletion(); |
211 syncLoader.waitForCompletion(); |