Lines Matching refs:request
90 // The URLRequest's destructor will cancel the outstanding request, and
107 void ProxyScriptFetcherImpl::OnResponseCompleted(URLRequest* request) {
108 DCHECK_EQ(request, cur_request_.get());
110 // Use |result_code_| as the request's error if we have already set it to
112 if (result_code_ == OK && !request->status().is_success())
113 result_code_ = request->status().os_error();
121 // It is invalid to call Fetch() while a request is already in progress.
156 // Post a task to timeout this request if it takes too long.
163 // Start the request.
178 void ProxyScriptFetcherImpl::OnAuthRequired(URLRequest* request,
180 DCHECK_EQ(request, cur_request_.get());
184 request->CancelAuth();
187 void ProxyScriptFetcherImpl::OnSSLCertificateError(URLRequest* request,
190 DCHECK_EQ(request, cur_request_.get());
194 request->Cancel();
197 void ProxyScriptFetcherImpl::OnResponseStarted(URLRequest* request) {
198 DCHECK_EQ(request, cur_request_.get());
200 if (!request->status().is_success()) {
201 OnResponseCompleted(request);
206 if (request->url().SchemeIs("http") || request->url().SchemeIs("https")) {
209 if (request->GetResponseCode() != 200) {
211 << request->response_headers()->GetStatusLine();
213 request->Cancel();
228 ReadBody(request);
231 void ProxyScriptFetcherImpl::OnReadCompleted(URLRequest* request,
233 DCHECK_EQ(request, cur_request_.get());
234 if (ConsumeBytesRead(request, num_bytes)) {
236 ReadBody(request);
240 void ProxyScriptFetcherImpl::ReadBody(URLRequest* request) {
244 if (!request->Read(buf_, kBufSize, &num_bytes)) {
246 if (!request->status().is_io_pending())
247 OnResponseCompleted(request);
250 if (!ConsumeBytesRead(request, num_bytes))
255 bool ProxyScriptFetcherImpl::ConsumeBytesRead(URLRequest* request,
259 OnResponseCompleted(request);
267 request->Cancel();