| 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 if (entry_) | 37 DCHECK(!entry_); |
| 38 entry_->Close(); | |
| 39 callback_->Cancel(); | 38 callback_->Cancel(); |
| 40 } | 39 } |
| 41 | 40 |
| 42 std::string DiskCacheBasedSSLHostInfo::key() const { | 41 std::string DiskCacheBasedSSLHostInfo::key() const { |
| 43 return "sslhostinfo:" + hostname_; | 42 return "sslhostinfo:" + hostname_; |
| 44 } | 43 } |
| 45 | 44 |
| 46 void DiskCacheBasedSSLHostInfo::DoLoop(int rv) { | 45 void DiskCacheBasedSSLHostInfo::DoLoop(int rv) { |
| 47 do { | 46 do { |
| 48 switch (state_) { | 47 switch (state_) { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 221 |
| 223 int DiskCacheBasedSSLHostInfo::SetDone() { | 222 int DiskCacheBasedSSLHostInfo::SetDone() { |
| 224 if (entry_) | 223 if (entry_) |
| 225 entry_->Close(); | 224 entry_->Close(); |
| 226 entry_ = NULL; | 225 entry_ = NULL; |
| 227 state_ = NONE; | 226 state_ = NONE; |
| 228 return OK; | 227 return OK; |
| 229 } | 228 } |
| 230 | 229 |
| 231 } // namespace net | 230 } // namespace net |
| OLD | NEW |