| Index: net/url_request/url_request_http_job.cc
|
| diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
|
| index 6204faa4d2abc55ccade5d7314c87c8baac2dcb2..c617017303b14abb5f7fd2bf7a47a2381d6727e8 100644
|
| --- a/net/url_request/url_request_http_job.cc
|
| +++ b/net/url_request/url_request_http_job.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "net/url_request/url_request_http_job.h"
|
|
|
| +#include "base/trace_event/trace_event.h"
|
| #include "base/base_switches.h"
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| @@ -242,6 +243,7 @@ void URLRequestHttpJob::SetPriority(RequestPriority priority) {
|
| }
|
|
|
| void URLRequestHttpJob::Start() {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::Start");
|
| // TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed.
|
| tracked_objects::ScopedTracker tracking_profile(
|
| FROM_HERE_WITH_EXPLICIT_FUNCTION("456327 URLRequestHttpJob::Start"));
|
| @@ -288,6 +290,7 @@ void URLRequestHttpJob::Start() {
|
| }
|
|
|
| void URLRequestHttpJob::Kill() {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::Kill");
|
| weak_factory_.InvalidateWeakPtrs();
|
| if (transaction_)
|
| DestroyTransaction();
|
| @@ -315,6 +318,7 @@ void URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback(
|
| }
|
|
|
| void URLRequestHttpJob::NotifyBeforeNetworkStart(bool* defer) {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::NotifyBeforeNetworkStart");
|
| if (!request_)
|
| return;
|
| if (backoff_manager_) {
|
| @@ -333,6 +337,7 @@ void URLRequestHttpJob::NotifyBeforeNetworkStart(bool* defer) {
|
| }
|
|
|
| void URLRequestHttpJob::NotifyHeadersComplete() {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::NotifyHeadersComplete");
|
| DCHECK(!response_info_);
|
|
|
| response_info_ = transaction_->GetResponseInfo();
|
| @@ -427,6 +432,8 @@ void URLRequestHttpJob::NotifyHeadersComplete() {
|
| }
|
|
|
| void URLRequestHttpJob::DestroyTransaction() {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::DestroyTransaction");
|
| +
|
| DCHECK(transaction_.get());
|
|
|
| DoneWithRequest(ABORTED);
|
| @@ -435,7 +442,11 @@ void URLRequestHttpJob::DestroyTransaction() {
|
| transaction_->GetTotalReceivedBytes();
|
| total_sent_bytes_from_previous_transactions_ +=
|
| transaction_->GetTotalSentBytes();
|
| - transaction_.reset();
|
| + {
|
| + TRACE_EVENT0("toplevel",
|
| + "URLRequestHttpJob::DestroyTransaction::ResetHttpTransaction");
|
| + transaction_.reset();
|
| + }
|
| response_info_ = NULL;
|
| receive_headers_end_ = base::TimeTicks();
|
| }
|
| @@ -486,6 +497,7 @@ void URLRequestHttpJob::MaybeStartTransactionInternal(int result) {
|
| }
|
|
|
| void URLRequestHttpJob::StartTransactionInternal() {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::StartTransactionInternal");
|
| // This should only be called while the request's status is IO_PENDING.
|
| DCHECK_EQ(URLRequestStatus::IO_PENDING, request_->status().status());
|
|
|
| @@ -661,6 +673,8 @@ void URLRequestHttpJob::AddExtraHeaders() {
|
| }
|
|
|
| void URLRequestHttpJob::AddCookieHeaderAndStart() {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::AddCookieHeaderAndStart");
|
| +
|
| // If the request was destroyed, then there is no more work to do.
|
| if (!request_)
|
| return;
|
| @@ -705,6 +719,7 @@ void URLRequestHttpJob::SetCookieHeaderAndStart(const CookieList& cookie_list) {
|
| }
|
|
|
| void URLRequestHttpJob::DoStartTransaction() {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::DoStartTransaction");
|
| // We may have been canceled while retrieving cookies.
|
| if (GetStatus().is_success()) {
|
| StartTransaction();
|
| @@ -714,6 +729,8 @@ void URLRequestHttpJob::DoStartTransaction() {
|
| }
|
|
|
| void URLRequestHttpJob::SaveCookiesAndNotifyHeadersComplete(int result) {
|
| + TRACE_EVENT0("toplevel",
|
| + "URLRequestHttpJob::SaveCookiesAndNotifyHeadersComplete");
|
| // End of the call started in OnStartCompleted.
|
| OnCallToDelegateComplete();
|
|
|
| @@ -851,6 +868,7 @@ void URLRequestHttpJob::ProcessPublicKeyPinsHeader() {
|
| }
|
|
|
| void URLRequestHttpJob::OnStartCompleted(int result) {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::OnStartCompleted");
|
| RecordTimer();
|
|
|
| // If the request was destroyed, then there is no more work to do.
|
| @@ -946,6 +964,7 @@ void URLRequestHttpJob::OnStartCompleted(int result) {
|
| }
|
|
|
| void URLRequestHttpJob::OnHeadersReceivedCallback(int result) {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::OnHeadersReceivedCallback");
|
| awaiting_callback_ = false;
|
|
|
| // Check that there are no callbacks to already canceled requests.
|
| @@ -1188,6 +1207,7 @@ void URLRequestHttpJob::SetAuth(const AuthCredentials& credentials) {
|
| }
|
|
|
| void URLRequestHttpJob::CancelAuth() {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::CancelAuth");
|
| // Proxy gets set first, then WWW.
|
| if (proxy_auth_state_ == AUTH_STATE_NEED_AUTH) {
|
| proxy_auth_state_ = AUTH_STATE_CANCELED;
|
| @@ -1218,6 +1238,7 @@ void URLRequestHttpJob::CancelAuth() {
|
| void URLRequestHttpJob::ContinueWithCertificate(
|
| X509Certificate* client_cert,
|
| SSLPrivateKey* client_private_key) {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::ContinueWithCertificate");
|
| DCHECK(transaction_.get());
|
|
|
| DCHECK(!response_info_) << "should not have a response yet";
|
| @@ -1238,6 +1259,7 @@ void URLRequestHttpJob::ContinueWithCertificate(
|
| }
|
|
|
| void URLRequestHttpJob::ContinueDespiteLastError() {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::ContinueDespiteLastError");
|
| // If the transaction was destroyed, then the job was cancelled.
|
| if (!transaction_.get())
|
| return;
|
| @@ -1499,6 +1521,7 @@ void URLRequestHttpJob::RecordPerfHistograms(CompletionCause reason) {
|
| }
|
|
|
| void URLRequestHttpJob::DoneWithRequest(CompletionCause reason) {
|
| + TRACE_EVENT0("toplevel", "URLRequestHttpJob::DoneWithRequest");
|
| if (done_)
|
| return;
|
| done_ = true;
|
|
|