| Index: net/http/http_cache_transaction.cc
|
| diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
|
| index 38da8f3bd7b0fc8a7492cef49a0666fd027c8668..baa68d6e27962f02d7ad17df6fc1bdc7e9f51a75 100644
|
| --- a/net/http/http_cache_transaction.cc
|
| +++ b/net/http/http_cache_transaction.cc
|
| @@ -13,6 +13,7 @@
|
| #include <algorithm>
|
| #include <string>
|
|
|
| +#include "base/trace_event/trace_event.h"
|
| #include "base/bind.h"
|
| #include "base/callback_helpers.h"
|
| #include "base/compiler_specific.h"
|
| @@ -179,6 +180,8 @@ HttpCache::Transaction::Transaction(RequestPriority priority, HttpCache* cache)
|
| }
|
|
|
| HttpCache::Transaction::~Transaction() {
|
| + TRACE_EVENT0("toplevel", "HttpCache::Transaction::~Transaction");
|
| +
|
| // We may have to issue another IO, but we should never invoke the callback_
|
| // after this point.
|
| callback_.Reset();
|
| @@ -867,6 +870,7 @@ int HttpCache::Transaction::DoLoop(int result) {
|
| }
|
|
|
| int HttpCache::Transaction::DoGetBackend() {
|
| + TRACE_EVENT0("toplevel", "HttpCache::Transaction::DoGetBackend");
|
| cache_pending_ = true;
|
| next_state_ = STATE_GET_BACKEND_COMPLETE;
|
| net_log_.BeginEvent(NetLog::TYPE_HTTP_CACHE_GET_BACKEND);
|
| @@ -874,6 +878,7 @@ int HttpCache::Transaction::DoGetBackend() {
|
| }
|
|
|
| int HttpCache::Transaction::DoGetBackendComplete(int result) {
|
| + TRACE_EVENT0("toplevel", "HttpCache::Transaction::DoGetBackendComplete");
|
| DCHECK(result == OK || result == ERR_FAILED);
|
| net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HTTP_CACHE_GET_BACKEND,
|
| result);
|
| @@ -939,6 +944,7 @@ int HttpCache::Transaction::DoGetBackendComplete(int result) {
|
| }
|
|
|
| int HttpCache::Transaction::DoInitEntry() {
|
| + TRACE_EVENT0("toplevel", "HttpCache::Transaction::DoInitEntry");
|
| DCHECK(!new_entry_);
|
|
|
| if (!cache_.get())
|
| @@ -954,6 +960,7 @@ int HttpCache::Transaction::DoInitEntry() {
|
| }
|
|
|
| int HttpCache::Transaction::DoOpenEntry() {
|
| + TRACE_EVENT0("toplevel", "HttpCache::Transaction::DoOpenEntry");
|
| DCHECK(!new_entry_);
|
| next_state_ = STATE_OPEN_ENTRY_COMPLETE;
|
| cache_pending_ = true;
|
| @@ -963,6 +970,7 @@ int HttpCache::Transaction::DoOpenEntry() {
|
| }
|
|
|
| int HttpCache::Transaction::DoOpenEntryComplete(int result) {
|
| + TRACE_EVENT0("toplevel", "HttpCache::Transaction::DoOpenEntryComplete");
|
| // It is important that we go to STATE_ADD_TO_ENTRY whenever the result is
|
| // OK, otherwise the cache will end up with an active entry without any
|
| // transaction attached.
|
| @@ -1060,6 +1068,7 @@ int HttpCache::Transaction::DoCreateEntryComplete(int result) {
|
| }
|
|
|
| int HttpCache::Transaction::DoAddToEntry() {
|
| + TRACE_EVENT0("toplevel", "HttpCache::Transaction::DoAddToEntry");
|
| DCHECK(new_entry_);
|
| cache_pending_ = true;
|
| next_state_ = STATE_ADD_TO_ENTRY_COMPLETE;
|
| @@ -1101,6 +1110,7 @@ int HttpCache::Transaction::DoAddToEntry() {
|
| }
|
|
|
| int HttpCache::Transaction::DoAddToEntryComplete(int result) {
|
| + TRACE_EVENT0("toplevel", "HttpCache::Transaction::DoAddToEntryComplete");
|
| net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HTTP_CACHE_ADD_TO_ENTRY,
|
| result);
|
| const TimeDelta entry_lock_wait =
|
| @@ -1151,6 +1161,7 @@ int HttpCache::Transaction::DoAddToEntryComplete(int result) {
|
| }
|
|
|
| int HttpCache::Transaction::DoCacheReadResponse() {
|
| + TRACE_EVENT0("toplevel", "HttpCache::Transaction::DoCacheReadResponse");
|
| DCHECK(entry_);
|
| next_state_ = STATE_CACHE_READ_RESPONSE_COMPLETE;
|
|
|
| @@ -1163,6 +1174,8 @@ int HttpCache::Transaction::DoCacheReadResponse() {
|
| }
|
|
|
| int HttpCache::Transaction::DoCacheReadResponseComplete(int result) {
|
| + TRACE_EVENT0("toplevel",
|
| + "HttpCache::Transaction::DoCacheReadResponseComplete");
|
| net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HTTP_CACHE_READ_INFO, result);
|
| if (result != io_buf_len_ ||
|
| !HttpCache::ParseResponseInfo(read_buf_->data(), io_buf_len_, &response_,
|
|
|