Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Unified Diff: net/http/http_cache.cc

Issue 222009: Replace some net::ERR_FAILED generic error codes with more specific codes.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address wtc's comments Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_cache.h ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
===================================================================
--- net/http/http_cache.cc (revision 26789)
+++ net/http/http_cache.cc (working copy)
@@ -1044,11 +1044,12 @@
DCHECK(mode_ & WRITE || mode_ == NONE);
DCHECK(!network_trans_.get());
- network_trans_.reset(cache_->network_layer_->CreateTransaction());
- if (!network_trans_.get())
- return net::ERR_CACHE_CANNOT_CREATE_NETWORK_TRANSACTION;
+ // Create a network transaction.
+ int rv = cache_->network_layer_->CreateTransaction(&network_trans_);
+ if (rv != OK)
+ return rv;
- int rv = network_trans_->Start(request_, &network_info_callback_, load_log_);
+ rv = network_trans_->Start(request_, &network_info_callback_, load_log_);
if (rv != ERR_IO_PENDING)
OnNetworkInfoAvailable(rv);
return rv;
@@ -1656,7 +1657,7 @@
delete *it;
}
-HttpTransaction* HttpCache::CreateTransaction() {
+int HttpCache::CreateTransaction(scoped_ptr<HttpTransaction>* trans) {
// Do lazy initialization of disk cache if needed.
if (!disk_cache_.get()) {
DCHECK_GE(cache_size_, 0);
@@ -1671,7 +1672,8 @@
disk_cache_dir_.clear(); // Reclaim memory.
}
}
- return new HttpCache::Transaction(this, enable_range_support_);
+ trans->reset(new HttpCache::Transaction(this, enable_range_support_));
+ return OK;
}
HttpCache* HttpCache::GetCache() {
« no previous file with comments | « net/http/http_cache.h ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698