| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/disk_cache_based_ssl_host_info.h" | 5 #include "net/http/disk_cache_based_ssl_host_info.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 void DiskCacheBasedSSLHostInfo::Start() { | 29 void DiskCacheBasedSSLHostInfo::Start() { |
| 30 DCHECK(CalledOnValidThread()); | 30 DCHECK(CalledOnValidThread()); |
| 31 DCHECK_EQ(GET_BACKEND, state_); | 31 DCHECK_EQ(GET_BACKEND, state_); |
| 32 DoLoop(OK); | 32 DoLoop(OK); |
| 33 } | 33 } |
| 34 | 34 |
| 35 DiskCacheBasedSSLHostInfo::~DiskCacheBasedSSLHostInfo() { | 35 DiskCacheBasedSSLHostInfo::~DiskCacheBasedSSLHostInfo() { |
| 36 DCHECK(!user_callback_); | 36 DCHECK(!user_callback_); |
| 37 DCHECK(!entry_); | 37 if (entry_) |
| 38 entry_->Close(); |
| 38 callback_->Cancel(); | 39 callback_->Cancel(); |
| 39 } | 40 } |
| 40 | 41 |
| 41 std::string DiskCacheBasedSSLHostInfo::key() const { | 42 std::string DiskCacheBasedSSLHostInfo::key() const { |
| 42 return "sslhostinfo:" + hostname_; | 43 return "sslhostinfo:" + hostname_; |
| 43 } | 44 } |
| 44 | 45 |
| 45 void DiskCacheBasedSSLHostInfo::DoLoop(int rv) { | 46 void DiskCacheBasedSSLHostInfo::DoLoop(int rv) { |
| 46 do { | 47 do { |
| 47 switch (state_) { | 48 switch (state_) { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 222 |
| 222 int DiskCacheBasedSSLHostInfo::SetDone() { | 223 int DiskCacheBasedSSLHostInfo::SetDone() { |
| 223 if (entry_) | 224 if (entry_) |
| 224 entry_->Close(); | 225 entry_->Close(); |
| 225 entry_ = NULL; | 226 entry_ = NULL; |
| 226 state_ = NONE; | 227 state_ = NONE; |
| 227 return OK; | 228 return OK; |
| 228 } | 229 } |
| 229 | 230 |
| 230 } // namespace net | 231 } // namespace net |
| OLD | NEW |