OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/http_cache_transaction.h" | 5 #include "net/http/http_cache_transaction.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_POSIX) | 9 #if defined(OS_POSIX) |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2629 // content with cert errors either. This is to prevent not reporting net | 2629 // content with cert errors either. This is to prevent not reporting net |
2630 // errors when loading a resource from the cache. When we load a page over | 2630 // errors when loading a resource from the cache. When we load a page over |
2631 // HTTPS with a cert error we show an SSL blocking page. If the user clicks | 2631 // HTTPS with a cert error we show an SSL blocking page. If the user clicks |
2632 // proceed we reload the resource ignoring the errors. The loaded resource | 2632 // proceed we reload the resource ignoring the errors. The loaded resource |
2633 // is then cached. If that resource is subsequently loaded from the cache, | 2633 // is then cached. If that resource is subsequently loaded from the cache, |
2634 // no net error is reported (even though the cert status contains the actual | 2634 // no net error is reported (even though the cert status contains the actual |
2635 // errors) and no SSL blocking page is shown. An alternative would be to | 2635 // errors) and no SSL blocking page is shown. An alternative would be to |
2636 // reverse-map the cert status to a net error and replay the net error. | 2636 // reverse-map the cert status to a net error and replay the net error. |
2637 if ((cache_->mode() != RECORD && | 2637 if ((cache_->mode() != RECORD && |
2638 response_.headers->HasHeaderValue("cache-control", "no-store")) || | 2638 response_.headers->HasHeaderValue("cache-control", "no-store")) || |
2639 net::IsCertStatusError(response_.ssl_info.cert_status)) { | 2639 (net::IsCertStatusError(response_.ssl_info.cert_status) && |
| 2640 !net::IsCertStatusMinorError(response_.ssl_info.cert_status))) { |
2640 DoneWritingToEntry(false); | 2641 DoneWritingToEntry(false); |
2641 if (net_log_.IsLogging()) | 2642 if (net_log_.IsLogging()) |
2642 net_log_.EndEvent(NetLog::TYPE_HTTP_CACHE_WRITE_INFO); | 2643 net_log_.EndEvent(NetLog::TYPE_HTTP_CACHE_WRITE_INFO); |
2643 return OK; | 2644 return OK; |
2644 } | 2645 } |
2645 | 2646 |
2646 // cert_cache() will be null if the CertCacheTrial field trial is disabled. | 2647 // cert_cache() will be null if the CertCacheTrial field trial is disabled. |
2647 if (cache_->cert_cache() && response_.ssl_info.is_valid()) | 2648 if (cache_->cert_cache() && response_.ssl_info.is_valid()) |
2648 WriteCertChain(); | 2649 WriteCertChain(); |
2649 | 2650 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2896 default: | 2897 default: |
2897 NOTREACHED(); | 2898 NOTREACHED(); |
2898 } | 2899 } |
2899 } | 2900 } |
2900 | 2901 |
2901 void HttpCache::Transaction::OnIOComplete(int result) { | 2902 void HttpCache::Transaction::OnIOComplete(int result) { |
2902 DoLoop(result); | 2903 DoLoop(result); |
2903 } | 2904 } |
2904 | 2905 |
2905 } // namespace net | 2906 } // namespace net |
OLD | NEW |