| Index: net/http/http_cache.cc
|
| diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
|
| index f572c14f56968b846720d4b05ce2cfd1c107fe28..87f2d7964a3fb8ca2abaf47fe383f541043dede6 100644
|
| --- a/net/http/http_cache.cc
|
| +++ b/net/http/http_cache.cc
|
| @@ -7,6 +7,7 @@
|
| #include <algorithm>
|
| #include <utility>
|
|
|
| +#include "base/trace_event/trace_event.h"
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| #include "base/callback.h"
|
| @@ -390,6 +391,7 @@ disk_cache::Backend* HttpCache::GetCurrentBackend() const {
|
| bool HttpCache::ParseResponseInfo(const char* data, int len,
|
| HttpResponseInfo* response_info,
|
| bool* response_truncated) {
|
| + TRACE_EVENT0("toplevel", "HttpCache::ParseResponseInfo");
|
| base::Pickle pickle(data, len);
|
| return response_info->InitFromPickle(pickle, response_truncated);
|
| }
|
| @@ -717,11 +719,13 @@ void HttpCache::DeletePendingOp(PendingOp* pending_op) {
|
|
|
| int HttpCache::OpenEntry(const std::string& key, ActiveEntry** entry,
|
| Transaction* trans) {
|
| + TRACE_EVENT0("toplevel", "HttpCache::OpenEntry::A");
|
| ActiveEntry* active_entry = FindActiveEntry(key);
|
| if (active_entry) {
|
| *entry = active_entry;
|
| return OK;
|
| }
|
| + TRACE_EVENT0("toplevel", "HttpCache::OpenEntry::B");
|
|
|
| WorkItem* item = new WorkItem(WI_OPEN_ENTRY, trans, entry);
|
| PendingOp* pending_op = GetPendingOp(key);
|
| @@ -729,15 +733,19 @@ int HttpCache::OpenEntry(const std::string& key, ActiveEntry** entry,
|
| pending_op->pending_queue.push_back(item);
|
| return ERR_IO_PENDING;
|
| }
|
| + TRACE_EVENT0("toplevel", "HttpCache::OpenEntry::C");
|
|
|
| DCHECK(pending_op->pending_queue.empty());
|
|
|
| pending_op->writer = item;
|
| pending_op->callback = base::Bind(&HttpCache::OnPendingOpComplete,
|
| GetWeakPtr(), pending_op);
|
| + TRACE_EVENT0("toplevel", "HttpCache::OpenEntry::D");
|
|
|
| int rv = disk_cache_->OpenEntry(key, &(pending_op->disk_entry),
|
| pending_op->callback);
|
| + TRACE_EVENT0("toplevel", "HttpCache::OpenEntry::E");
|
| +
|
| if (rv != ERR_IO_PENDING) {
|
| item->ClearTransaction();
|
| pending_op->callback.Run(rv);
|
| @@ -824,6 +832,7 @@ int HttpCache::AddTransactionToEntry(ActiveEntry* entry, Transaction* trans) {
|
|
|
| void HttpCache::DoneWithEntry(ActiveEntry* entry, Transaction* trans,
|
| bool cancel) {
|
| + TRACE_EVENT0("toplevel", "HttpCache::DoneWithEntry");
|
| // If we already posted a task to move on to the next transaction and this was
|
| // the writer, there is nothing to cancel.
|
| if (entry->will_process_pending_queue && entry->readers.empty())
|
| @@ -915,6 +924,8 @@ LoadState HttpCache::GetLoadStateForPendingTransaction(
|
| }
|
|
|
| void HttpCache::RemovePendingTransaction(Transaction* trans) {
|
| + TRACE_EVENT0("toplevel", "HttpCache::RemovePendingTransaction");
|
| +
|
| ActiveEntriesMap::const_iterator i = active_entries_.find(trans->key());
|
| bool found = false;
|
| if (i != active_entries_.end())
|
|
|