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

Unified Diff: net/http/disk_cache_based_ssl_host_info.cc

Issue 8670009: SSL Host info: Make sure that we can update certificate chains in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/disk_cache_based_ssl_host_info.h ('k') | net/http/disk_cache_based_ssl_host_info_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/disk_cache_based_ssl_host_info.cc
===================================================================
--- net/http/disk_cache_based_ssl_host_info.cc (revision 111204)
+++ net/http/disk_cache_based_ssl_host_info.cc (working copy)
@@ -44,6 +44,7 @@
&DiskCacheBasedSSLHostInfo::OnIOComplete)),
state_(GET_BACKEND),
ready_(false),
+ found_entry_(false),
hostname_(hostname),
http_cache_(http_cache),
backend_(NULL),
@@ -82,7 +83,7 @@
if (!backend_)
return;
- state_ = CREATE;
+ state_ = CREATE_OR_OPEN;
DoLoop(OK);
}
@@ -132,11 +133,11 @@
case WAIT_FOR_DATA_READY_DONE:
rv = DoWaitForDataReadyDone();
break;
- case CREATE:
- rv = DoCreate();
+ case CREATE_OR_OPEN:
+ rv = DoCreateOrOpen();
break;
- case CREATE_COMPLETE:
- rv = DoCreateComplete(rv);
+ case CREATE_OR_OPEN_COMPLETE:
+ rv = DoCreateOrOpenComplete(rv);
break;
case WRITE:
rv = DoWrite();
@@ -170,6 +171,7 @@
if (rv == OK) {
entry_ = callback_->entry();
state_ = READ;
+ found_entry_ = true;
} else {
state_ = WAIT_FOR_DATA_READY_DONE;
}
@@ -190,7 +192,7 @@
return OK;
}
-int DiskCacheBasedSSLHostInfo::DoCreateComplete(int rv) {
+int DiskCacheBasedSSLHostInfo::DoCreateOrOpenComplete(int rv) {
if (rv != OK) {
state_ = SET_DONE;
} else {
@@ -232,9 +234,12 @@
new_data_.size(), callback_, true /* truncate */);
}
-int DiskCacheBasedSSLHostInfo::DoCreate() {
+int DiskCacheBasedSSLHostInfo::DoCreateOrOpen() {
DCHECK(entry_ == NULL);
- state_ = CREATE_COMPLETE;
+ state_ = CREATE_OR_OPEN_COMPLETE;
+ if (found_entry_)
+ return backend_->OpenEntry(key(), callback_->entry_pointer(), callback_);
+
return backend_->CreateEntry(key(), callback_->entry_pointer(), callback_);
}
@@ -264,7 +269,7 @@
case GET_BACKEND_COMPLETE:
case OPEN_COMPLETE:
case READ_COMPLETE:
- case CREATE_COMPLETE:
+ case CREATE_OR_OPEN_COMPLETE:
case WRITE_COMPLETE:
return true;
default:
« no previous file with comments | « net/http/disk_cache_based_ssl_host_info.h ('k') | net/http/disk_cache_based_ssl_host_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698