Commit cbc0648f authored by Steven Bingler's avatar Steven Bingler Committed by Commit Bot

Changing "trans" to "transaction" to address issue in review 1437696

Change-Id: I2bb4ee0d3676dc29dda4de7424ab418637f59803
Reviewed-on: https://chromium-review.googlesource.com/c/1483450Reviewed-by: default avatarMaks Orlovich <morlovich@chromium.org>
Reviewed-by: default avatarShivani Sharma <shivanisha@chromium.org>
Commit-Queue: Steven Bingler <bingler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635173}
parent 2061fad8
...@@ -166,17 +166,19 @@ struct HttpCache::PendingOp { ...@@ -166,17 +166,19 @@ struct HttpCache::PendingOp {
// information needed to complete that request. // information needed to complete that request.
class HttpCache::WorkItem { class HttpCache::WorkItem {
public: public:
WorkItem(WorkItemOperation operation, Transaction* trans, ActiveEntry** entry) WorkItem(WorkItemOperation operation,
Transaction* transaction,
ActiveEntry** entry)
: operation_(operation), : operation_(operation),
trans_(trans), transaction_(transaction),
entry_(entry), entry_(entry),
backend_(NULL) {} backend_(NULL) {}
WorkItem(WorkItemOperation operation, WorkItem(WorkItemOperation operation,
Transaction* trans, Transaction* transaction,
CompletionOnceCallback callback, CompletionOnceCallback callback,
disk_cache::Backend** backend) disk_cache::Backend** backend)
: operation_(operation), : operation_(operation),
trans_(trans), transaction_(transaction),
entry_(NULL), entry_(NULL),
callback_(std::move(callback)), callback_(std::move(callback)),
backend_(backend) {} backend_(backend) {}
...@@ -187,8 +189,8 @@ class HttpCache::WorkItem { ...@@ -187,8 +189,8 @@ class HttpCache::WorkItem {
DCHECK(!entry || entry->disk_entry); DCHECK(!entry || entry->disk_entry);
if (entry_) if (entry_)
*entry_ = entry; *entry_ = entry;
if (trans_) if (transaction_)
trans_->io_callback().Run(result); transaction_->io_callback().Run(result);
} }
// Notifies the caller about the operation completion. Returns true if the // Notifies the caller about the operation completion. Returns true if the
...@@ -204,18 +206,22 @@ class HttpCache::WorkItem { ...@@ -204,18 +206,22 @@ class HttpCache::WorkItem {
} }
WorkItemOperation operation() { return operation_; } WorkItemOperation operation() { return operation_; }
void ClearTransaction() { trans_ = NULL; } void ClearTransaction() { transaction_ = NULL; }
void ClearEntry() { entry_ = NULL; } void ClearEntry() { entry_ = NULL; }
void ClearCallback() { callback_.Reset(); } void ClearCallback() { callback_.Reset(); }
bool Matches(Transaction* trans) const { return trans == trans_; } bool Matches(Transaction* transaction) const {
bool IsValid() const { return trans_ || entry_ || !callback_.is_null(); } return transaction == transaction_;
}
bool IsValid() const {
return transaction_ || entry_ || !callback_.is_null();
}
// Returns the estimate of dynamically allocated memory in bytes. // Returns the estimate of dynamically allocated memory in bytes.
size_t EstimateMemoryUsage() const { return 0; } size_t EstimateMemoryUsage() const { return 0; }
private: private:
WorkItemOperation operation_; WorkItemOperation operation_;
Transaction* trans_; Transaction* transaction_;
ActiveEntry** entry_; ActiveEntry** entry_;
CompletionOnceCallback callback_; // User callback. CompletionOnceCallback callback_; // User callback.
disk_cache::Backend** backend_; disk_cache::Backend** backend_;
...@@ -227,8 +233,8 @@ class HttpCache::WorkItem { ...@@ -227,8 +233,8 @@ class HttpCache::WorkItem {
// to a given entry. // to a given entry.
class HttpCache::MetadataWriter { class HttpCache::MetadataWriter {
public: public:
explicit MetadataWriter(HttpCache::Transaction* trans) explicit MetadataWriter(HttpCache::Transaction* transaction)
: verified_(false), buf_len_(0), transaction_(trans) {} : verified_(false), buf_len_(0), transaction_(transaction) {}
~MetadataWriter() = default; ~MetadataWriter() = default;
...@@ -430,8 +436,9 @@ void HttpCache::WriteMetadata(const GURL& url, ...@@ -430,8 +436,9 @@ void HttpCache::WriteMetadata(const GURL& url,
CreateBackend(NULL, CompletionOnceCallback()); CreateBackend(NULL, CompletionOnceCallback());
} }
HttpCache::Transaction* trans = new HttpCache::Transaction(priority, this); HttpCache::Transaction* transaction =
MetadataWriter* writer = new MetadataWriter(trans); new HttpCache::Transaction(priority, this);
MetadataWriter* writer = new MetadataWriter(transaction);
// The writer will self destruct when done. // The writer will self destruct when done.
writer->Write(url, expected_response_time, buf, buf_len); writer->Write(url, expected_response_time, buf, buf_len);
...@@ -464,24 +471,25 @@ void HttpCache::OnExternalCacheHit( ...@@ -464,24 +471,25 @@ void HttpCache::OnExternalCacheHit(
disk_cache_->OnExternalCacheHit(key); disk_cache_->OnExternalCacheHit(key);
} }
int HttpCache::CreateTransaction(RequestPriority priority, int HttpCache::CreateTransaction(
std::unique_ptr<HttpTransaction>* trans) { RequestPriority priority,
std::unique_ptr<HttpTransaction>* transaction) {
// Do lazy initialization of disk cache if needed. // Do lazy initialization of disk cache if needed.
if (!disk_cache_.get()) { if (!disk_cache_.get()) {
// We don't care about the result. // We don't care about the result.
CreateBackend(NULL, CompletionOnceCallback()); CreateBackend(NULL, CompletionOnceCallback());
} }
HttpCache::Transaction* transaction = HttpCache::Transaction* new_transaction =
new HttpCache::Transaction(priority, this); new HttpCache::Transaction(priority, this);
if (bypass_lock_for_test_) if (bypass_lock_for_test_)
transaction->BypassLockForTest(); new_transaction->BypassLockForTest();
if (bypass_lock_after_headers_for_test_) if (bypass_lock_after_headers_for_test_)
transaction->BypassLockAfterHeadersForTest(); new_transaction->BypassLockAfterHeadersForTest();
if (fail_conditionalization_for_test_) if (fail_conditionalization_for_test_)
transaction->FailConditionalizationForTest(); new_transaction->FailConditionalizationForTest();
trans->reset(transaction); transaction->reset(new_transaction);
return OK; return OK;
} }
...@@ -576,7 +584,7 @@ int HttpCache::CreateBackend(disk_cache::Backend** backend, ...@@ -576,7 +584,7 @@ int HttpCache::CreateBackend(disk_cache::Backend** backend,
return rv; return rv;
} }
int HttpCache::GetBackendForTransaction(Transaction* trans) { int HttpCache::GetBackendForTransaction(Transaction* transaction) {
if (disk_cache_.get()) if (disk_cache_.get())
return OK; return OK;
...@@ -584,7 +592,7 @@ int HttpCache::GetBackendForTransaction(Transaction* trans) { ...@@ -584,7 +592,7 @@ int HttpCache::GetBackendForTransaction(Transaction* trans) {
return ERR_FAILED; return ERR_FAILED;
std::unique_ptr<WorkItem> item = std::make_unique<WorkItem>( std::unique_ptr<WorkItem> item = std::make_unique<WorkItem>(
WI_CREATE_BACKEND, trans, CompletionOnceCallback(), nullptr); WI_CREATE_BACKEND, transaction, CompletionOnceCallback(), nullptr);
PendingOp* pending_op = GetPendingOp(std::string()); PendingOp* pending_op = GetPendingOp(std::string());
DCHECK(pending_op->writer); DCHECK(pending_op->writer);
pending_op->pending_queue.push_back(std::move(item)); pending_op->pending_queue.push_back(std::move(item));
...@@ -634,15 +642,15 @@ void HttpCache::DoomActiveEntry(const std::string& key) { ...@@ -634,15 +642,15 @@ void HttpCache::DoomActiveEntry(const std::string& key) {
DCHECK_EQ(OK, rv); DCHECK_EQ(OK, rv);
} }
int HttpCache::DoomEntry(const std::string& key, Transaction* trans) { int HttpCache::DoomEntry(const std::string& key, Transaction* transaction) {
// Need to abandon the ActiveEntry, but any transaction attached to the entry // Need to abandon the ActiveEntry, but any transaction attached to the entry
// should not be impacted. Dooming an entry only means that it will no // should not be impacted. Dooming an entry only means that it will no
// longer be returned by FindActiveEntry (and it will also be destroyed once // longer be returned by FindActiveEntry (and it will also be destroyed once
// all consumers are finished with the entry). // all consumers are finished with the entry).
auto it = active_entries_.find(key); auto it = active_entries_.find(key);
if (it == active_entries_.end()) { if (it == active_entries_.end()) {
DCHECK(trans); DCHECK(transaction);
return AsyncDoomEntry(key, trans); return AsyncDoomEntry(key, transaction);
} }
std::unique_ptr<ActiveEntry> entry = std::move(it->second); std::unique_ptr<ActiveEntry> entry = std::move(it->second);
...@@ -661,13 +669,16 @@ int HttpCache::DoomEntry(const std::string& key, Transaction* trans) { ...@@ -661,13 +669,16 @@ int HttpCache::DoomEntry(const std::string& key, Transaction* trans) {
return OK; return OK;
} }
int HttpCache::AsyncDoomEntry(const std::string& key, Transaction* trans) { int HttpCache::AsyncDoomEntry(const std::string& key,
Transaction* transaction) {
PendingOp* pending_op = GetPendingOp(key); PendingOp* pending_op = GetPendingOp(key);
int rv = CreateAndSetWorkItem(nullptr, trans, WI_DOOM_ENTRY, pending_op); int rv =
CreateAndSetWorkItem(nullptr, transaction, WI_DOOM_ENTRY, pending_op);
if (rv != OK) if (rv != OK)
return rv; return rv;
net::RequestPriority priority = trans ? trans->priority() : net::LOWEST; net::RequestPriority priority =
transaction ? transaction->priority() : net::LOWEST;
rv = disk_cache_->DoomEntry(key, priority, rv = disk_cache_->DoomEntry(key, priority,
base::BindOnce(&HttpCache::OnPendingOpComplete, base::BindOnce(&HttpCache::OnPendingOpComplete,
GetWeakPtr(), pending_op)); GetWeakPtr(), pending_op));
...@@ -785,17 +796,17 @@ void HttpCache::DeletePendingOp(PendingOp* pending_op) { ...@@ -785,17 +796,17 @@ void HttpCache::DeletePendingOp(PendingOp* pending_op) {
int HttpCache::OpenOrCreateEntry(const std::string& key, int HttpCache::OpenOrCreateEntry(const std::string& key,
ActiveEntry** entry, ActiveEntry** entry,
Transaction* trans) { Transaction* transaction) {
DCHECK(!FindActiveEntry(key)); DCHECK(!FindActiveEntry(key));
PendingOp* pending_op = GetPendingOp(key); PendingOp* pending_op = GetPendingOp(key);
int rv = int rv = CreateAndSetWorkItem(entry, transaction, WI_OPEN_OR_CREATE_ENTRY,
CreateAndSetWorkItem(entry, trans, WI_OPEN_OR_CREATE_ENTRY, pending_op); pending_op);
if (rv != OK) if (rv != OK)
return rv; return rv;
rv = disk_cache_->OpenOrCreateEntry( rv = disk_cache_->OpenOrCreateEntry(
key, trans->priority(), &(pending_op->disk_entry_struct), key, transaction->priority(), &(pending_op->disk_entry_struct),
base::BindOnce(&HttpCache::OnPendingOpComplete, GetWeakPtr(), base::BindOnce(&HttpCache::OnPendingOpComplete, GetWeakPtr(),
pending_op)); pending_op));
...@@ -811,15 +822,15 @@ int HttpCache::OpenOrCreateEntry(const std::string& key, ...@@ -811,15 +822,15 @@ int HttpCache::OpenOrCreateEntry(const std::string& key,
int HttpCache::OpenEntry(const std::string& key, int HttpCache::OpenEntry(const std::string& key,
ActiveEntry** entry, ActiveEntry** entry,
Transaction* trans) { Transaction* transaction) {
DCHECK(!FindActiveEntry(key)); DCHECK(!FindActiveEntry(key));
PendingOp* pending_op = GetPendingOp(key); PendingOp* pending_op = GetPendingOp(key);
int rv = CreateAndSetWorkItem(entry, trans, WI_OPEN_ENTRY, pending_op); int rv = CreateAndSetWorkItem(entry, transaction, WI_OPEN_ENTRY, pending_op);
if (rv != OK) if (rv != OK)
return rv; return rv;
rv = disk_cache_->OpenEntry(key, trans->priority(), rv = disk_cache_->OpenEntry(key, transaction->priority(),
&(pending_op->disk_entry_struct.entry), &(pending_op->disk_entry_struct.entry),
base::BindOnce(&HttpCache::OnPendingOpComplete, base::BindOnce(&HttpCache::OnPendingOpComplete,
GetWeakPtr(), pending_op)); GetWeakPtr(), pending_op));
...@@ -839,17 +850,18 @@ int HttpCache::OpenEntry(const std::string& key, ...@@ -839,17 +850,18 @@ int HttpCache::OpenEntry(const std::string& key,
int HttpCache::CreateEntry(const std::string& key, int HttpCache::CreateEntry(const std::string& key,
ActiveEntry** entry, ActiveEntry** entry,
Transaction* trans) { Transaction* transaction) {
if (FindActiveEntry(key)) { if (FindActiveEntry(key)) {
return ERR_CACHE_RACE; return ERR_CACHE_RACE;
} }
PendingOp* pending_op = GetPendingOp(key); PendingOp* pending_op = GetPendingOp(key);
int rv = CreateAndSetWorkItem(entry, trans, WI_CREATE_ENTRY, pending_op); int rv =
CreateAndSetWorkItem(entry, transaction, WI_CREATE_ENTRY, pending_op);
if (rv != OK) if (rv != OK)
return rv; return rv;
rv = disk_cache_->CreateEntry(key, trans->priority(), rv = disk_cache_->CreateEntry(key, transaction->priority(),
&(pending_op->disk_entry_struct.entry), &(pending_op->disk_entry_struct.entry),
base::BindOnce(&HttpCache::OnPendingOpComplete, base::BindOnce(&HttpCache::OnPendingOpComplete,
GetWeakPtr(), pending_op)); GetWeakPtr(), pending_op));
...@@ -1253,8 +1265,8 @@ bool HttpCache::IsWritingInProgress(ActiveEntry* entry) const { ...@@ -1253,8 +1265,8 @@ bool HttpCache::IsWritingInProgress(ActiveEntry* entry) const {
} }
LoadState HttpCache::GetLoadStateForPendingTransaction( LoadState HttpCache::GetLoadStateForPendingTransaction(
const Transaction* trans) { const Transaction* transaction) {
auto i = active_entries_.find(trans->key()); auto i = active_entries_.find(transaction->key());
if (i == active_entries_.end()) { if (i == active_entries_.end()) {
// If this is really a pending transaction, and it is not part of // If this is really a pending transaction, and it is not part of
// active_entries_, we should be creating the backend or the entry. // active_entries_, we should be creating the backend or the entry.
...@@ -1265,11 +1277,11 @@ LoadState HttpCache::GetLoadStateForPendingTransaction( ...@@ -1265,11 +1277,11 @@ LoadState HttpCache::GetLoadStateForPendingTransaction(
return !writers ? LOAD_STATE_WAITING_FOR_CACHE : writers->GetLoadState(); return !writers ? LOAD_STATE_WAITING_FOR_CACHE : writers->GetLoadState();
} }
void HttpCache::RemovePendingTransaction(Transaction* trans) { void HttpCache::RemovePendingTransaction(Transaction* transaction) {
auto i = active_entries_.find(trans->key()); auto i = active_entries_.find(transaction->key());
bool found = false; bool found = false;
if (i != active_entries_.end()) if (i != active_entries_.end())
found = RemovePendingTransactionFromEntry(i->second.get(), trans); found = RemovePendingTransactionFromEntry(i->second.get(), transaction);
if (found) if (found)
return; return;
...@@ -1277,22 +1289,22 @@ void HttpCache::RemovePendingTransaction(Transaction* trans) { ...@@ -1277,22 +1289,22 @@ void HttpCache::RemovePendingTransaction(Transaction* trans) {
if (building_backend_) { if (building_backend_) {
auto j = pending_ops_.find(std::string()); auto j = pending_ops_.find(std::string());
if (j != pending_ops_.end()) if (j != pending_ops_.end())
found = RemovePendingTransactionFromPendingOp(j->second, trans); found = RemovePendingTransactionFromPendingOp(j->second, transaction);
if (found) if (found)
return; return;
} }
auto j = pending_ops_.find(trans->key()); auto j = pending_ops_.find(transaction->key());
if (j != pending_ops_.end()) if (j != pending_ops_.end())
found = RemovePendingTransactionFromPendingOp(j->second, trans); found = RemovePendingTransactionFromPendingOp(j->second, transaction);
if (found) if (found)
return; return;
for (auto k = doomed_entries_.begin(); k != doomed_entries_.end() && !found; for (auto k = doomed_entries_.begin(); k != doomed_entries_.end() && !found;
++k) { ++k) {
found = RemovePendingTransactionFromEntry(k->first, trans); found = RemovePendingTransactionFromEntry(k->first, transaction);
} }
DCHECK(found) << "Pending transaction not found"; DCHECK(found) << "Pending transaction not found";
...@@ -1311,9 +1323,10 @@ bool HttpCache::RemovePendingTransactionFromEntry(ActiveEntry* entry, ...@@ -1311,9 +1323,10 @@ bool HttpCache::RemovePendingTransactionFromEntry(ActiveEntry* entry,
return true; return true;
} }
bool HttpCache::RemovePendingTransactionFromPendingOp(PendingOp* pending_op, bool HttpCache::RemovePendingTransactionFromPendingOp(
Transaction* trans) { PendingOp* pending_op,
if (pending_op->writer->Matches(trans)) { Transaction* transaction) {
if (pending_op->writer->Matches(transaction)) {
pending_op->writer->ClearTransaction(); pending_op->writer->ClearTransaction();
pending_op->writer->ClearEntry(); pending_op->writer->ClearEntry();
return true; return true;
...@@ -1321,7 +1334,7 @@ bool HttpCache::RemovePendingTransactionFromPendingOp(PendingOp* pending_op, ...@@ -1321,7 +1334,7 @@ bool HttpCache::RemovePendingTransactionFromPendingOp(PendingOp* pending_op,
WorkItemList& pending_queue = pending_op->pending_queue; WorkItemList& pending_queue = pending_op->pending_queue;
for (auto it = pending_queue.begin(); it != pending_queue.end(); ++it) { for (auto it = pending_queue.begin(); it != pending_queue.end(); ++it) {
if ((*it)->Matches(trans)) { if ((*it)->Matches(transaction)) {
pending_queue.erase(it); pending_queue.erase(it);
return true; return true;
} }
......
...@@ -256,7 +256,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory { ...@@ -256,7 +256,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
// HttpTransactionFactory implementation: // HttpTransactionFactory implementation:
int CreateTransaction(RequestPriority priority, int CreateTransaction(RequestPriority priority,
std::unique_ptr<HttpTransaction>* trans) override; std::unique_ptr<HttpTransaction>* transaction) override;
HttpCache* GetCache() override; HttpCache* GetCache() override;
HttpNetworkSession* GetSession() override; HttpNetworkSession* GetSession() override;
...@@ -402,11 +402,11 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory { ...@@ -402,11 +402,11 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
CompletionOnceCallback callback); CompletionOnceCallback callback);
// Makes sure that the backend creation is complete before allowing the // Makes sure that the backend creation is complete before allowing the
// provided transaction to use the object. Returns an error code. |trans| // provided transaction to use the object. Returns an error code.
// will be notified via its IO callback if this method returns ERR_IO_PENDING. // |transaction| will be notified via its IO callback if this method returns
// The transaction is free to use the backend directly at any time after // ERR_IO_PENDING. The transaction is free to use the backend directly at any
// receiving the notification. // time after receiving the notification.
int GetBackendForTransaction(Transaction* trans); int GetBackendForTransaction(Transaction* transaction);
// Generates the cache key for this request. // Generates the cache key for this request.
std::string GenerateCacheKey(const HttpRequestInfo*); std::string GenerateCacheKey(const HttpRequestInfo*);
...@@ -415,17 +415,17 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory { ...@@ -415,17 +415,17 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
// entries. // entries.
void DoomActiveEntry(const std::string& key); void DoomActiveEntry(const std::string& key);
// Dooms the entry selected by |key|. |trans| will be notified via its IO // Dooms the entry selected by |key|. |transaction| will be notified via its
// callback if this method returns ERR_IO_PENDING. The entry can be // IO callback if this method returns ERR_IO_PENDING. The entry can be
// currently in use or not. If entry is in use and the invoking transaction // currently in use or not. If entry is in use and the invoking transaction is
// is associated with this entry and this entry is already doomed, this API // associated with this entry and this entry is already doomed, this API
// should not be invoked. // should not be invoked.
int DoomEntry(const std::string& key, Transaction* trans); int DoomEntry(const std::string& key, Transaction* transaction);
// Dooms the entry selected by |key|. |trans| will be notified via its IO // Dooms the entry selected by |key|. |transaction| will be notified via its
// callback if this method returns ERR_IO_PENDING. The entry should not // IO callback if this method returns ERR_IO_PENDING. The entry should not be
// be currently in use. // currently in use.
int AsyncDoomEntry(const std::string& key, Transaction* trans); int AsyncDoomEntry(const std::string& key, Transaction* transaction);
// Dooms the entry associated with a GET for a given |url|, loaded from // Dooms the entry associated with a GET for a given |url|, loaded from
// a page with top-level frame at |top_frame_origin|. // a page with top-level frame at |top_frame_origin|.
...@@ -456,27 +456,29 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory { ...@@ -456,27 +456,29 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
void DeletePendingOp(PendingOp* pending_op); void DeletePendingOp(PendingOp* pending_op);
// Opens the disk cache entry associated with |key|, creating the entry if it // Opens the disk cache entry associated with |key|, creating the entry if it
// does not already exist, returning an ActiveEntry in |*entry|. |trans| will // does not already exist, returning an ActiveEntry in |*entry|. |transaction|
// be notified via its IO callback if this method returns ERR_IO_PENDING. This // will be notified via its IO callback if this method returns ERR_IO_PENDING.
// should not be called if there already is an active entry associated with // This should not be called if there already is an active entry associated
// |key|, e.g. you should call FindActiveEntry first. // with |key|, e.g. you should call FindActiveEntry first.
int OpenOrCreateEntry(const std::string& key, int OpenOrCreateEntry(const std::string& key,
ActiveEntry** entry, ActiveEntry** entry,
Transaction* trans); Transaction* transaction);
// Opens the disk cache entry associated with |key|, returning an ActiveEntry // Opens the disk cache entry associated with |key|, returning an ActiveEntry
// in |*entry|. |trans| will be notified via its IO callback if this method // in |*entry|. |transaction| will be notified via its IO callback if this
// returns ERR_IO_PENDING. This should not be called if there already is // method returns ERR_IO_PENDING. This should not be called if there already
// an active entry associated with |key|, e.g. you should call FindActiveEntry // is an active entry associated with |key|, e.g. you should call
// first. // FindActiveEntry first.
int OpenEntry(const std::string& key, ActiveEntry** entry, int OpenEntry(const std::string& key,
Transaction* trans); ActiveEntry** entry,
Transaction* transaction);
// Creates the disk cache entry associated with |key|, returning an // Creates the disk cache entry associated with |key|, returning an
// ActiveEntry in |*entry|. |trans| will be notified via its IO callback if // ActiveEntry in |*entry|. |transaction| will be notified via its IO callback
// this method returns ERR_IO_PENDING. // if this method returns ERR_IO_PENDING.
int CreateEntry(const std::string& key, ActiveEntry** entry, int CreateEntry(const std::string& key,
Transaction* trans); ActiveEntry** entry,
Transaction* transaction);
// Destroys an ActiveEntry (active or doomed). Should only be called if // Destroys an ActiveEntry (active or doomed). Should only be called if
// entry->SafeToDestroy() returns true. // entry->SafeToDestroy() returns true.
...@@ -581,19 +583,20 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory { ...@@ -581,19 +583,20 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
bool IsWritingInProgress(ActiveEntry* entry) const; bool IsWritingInProgress(ActiveEntry* entry) const;
// Returns the LoadState of the provided pending transaction. // Returns the LoadState of the provided pending transaction.
LoadState GetLoadStateForPendingTransaction(const Transaction* trans); LoadState GetLoadStateForPendingTransaction(const Transaction* transaction);
// Removes the transaction |trans|, from the pending list of an entry // Removes the transaction |transaction|, from the pending list of an entry
// (PendingOp, active or doomed entry). // (PendingOp, active or doomed entry).
void RemovePendingTransaction(Transaction* trans); void RemovePendingTransaction(Transaction* transaction);
// Removes the transaction |trans|, from the pending list of |entry|. // Removes the transaction |transaction|, from the pending list of |entry|.
bool RemovePendingTransactionFromEntry(ActiveEntry* entry, bool RemovePendingTransactionFromEntry(ActiveEntry* entry,
Transaction* trans); Transaction* transaction);
// Removes the transaction |trans|, from the pending list of |pending_op|. // Removes the transaction |transaction|, from the pending list of
// |pending_op|.
bool RemovePendingTransactionFromPendingOp(PendingOp* pending_op, bool RemovePendingTransactionFromPendingOp(PendingOp* pending_op,
Transaction* trans); Transaction* transaction);
// Events (called via PostTask) --------------------------------------------- // Events (called via PostTask) ---------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment