OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 344 } |
345 | 345 |
346 void URLRequestHttpJob::StartTransaction() { | 346 void URLRequestHttpJob::StartTransaction() { |
347 if (request_->context() && request_->context()->network_delegate()) { | 347 if (request_->context() && request_->context()->network_delegate()) { |
348 int rv = request_->context()->network_delegate()->NotifyBeforeSendHeaders( | 348 int rv = request_->context()->network_delegate()->NotifyBeforeSendHeaders( |
349 request_, ¬ify_before_headers_sent_callback_, | 349 request_, ¬ify_before_headers_sent_callback_, |
350 &request_info_.extra_headers); | 350 &request_info_.extra_headers); |
351 // If an extension blocks the request, we rely on the callback to | 351 // If an extension blocks the request, we rely on the callback to |
352 // StartTransactionInternal(). | 352 // StartTransactionInternal(). |
353 if (rv == ERR_IO_PENDING) { | 353 if (rv == ERR_IO_PENDING) { |
354 request_->net_log().BeginEvent( | 354 SetBlockedOnDelegate(); |
355 NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); | |
356 return; | 355 return; |
357 } | 356 } |
358 } | 357 } |
359 StartTransactionInternal(); | 358 StartTransactionInternal(); |
360 } | 359 } |
361 | 360 |
362 void URLRequestHttpJob::NotifyBeforeSendHeadersCallback(int result) { | 361 void URLRequestHttpJob::NotifyBeforeSendHeadersCallback(int result) { |
363 request_->net_log().EndEvent( | 362 SetUnblockedOnDelegate(); |
364 NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); | |
365 | 363 |
366 if (result == OK) { | 364 if (result == OK) { |
367 StartTransactionInternal(); | 365 StartTransactionInternal(); |
368 } else { | 366 } else { |
369 request_->net_log().AddEvent(NetLog::TYPE_CANCELLED, | 367 request_->net_log().AddEvent(NetLog::TYPE_CANCELLED, |
370 make_scoped_refptr(new NetLogStringParameter("source", "delegate"))); | 368 make_scoped_refptr(new NetLogStringParameter("source", "delegate"))); |
371 NotifyCanceled(); | 369 NotifyCanceled(); |
372 } | 370 } |
373 } | 371 } |
374 | 372 |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 if (done_) | 1475 if (done_) |
1478 return; | 1476 return; |
1479 done_ = true; | 1477 done_ = true; |
1480 | 1478 |
1481 RecordPerfHistograms(reason); | 1479 RecordPerfHistograms(reason); |
1482 if (reason == FINISHED) | 1480 if (reason == FINISHED) |
1483 RecordCompressionHistograms(); | 1481 RecordCompressionHistograms(); |
1484 } | 1482 } |
1485 | 1483 |
1486 } // namespace net | 1484 } // namespace net |
OLD | NEW |