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 "content/browser/appcache/appcache_update_job.h" | 5 #include "content/browser/appcache/appcache_update_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 if ((response_code / 100) != 2) { | 163 if ((response_code / 100) != 2) { |
164 if (response_code > 0) | 164 if (response_code > 0) |
165 result_ = SERVER_ERROR; | 165 result_ = SERVER_ERROR; |
166 else | 166 else |
167 result_ = NETWORK_ERROR; | 167 result_ = NETWORK_ERROR; |
168 OnResponseCompleted(); | 168 OnResponseCompleted(); |
169 return; | 169 return; |
170 } | 170 } |
171 | 171 |
172 if (url_.SchemeIsSecure()) { | 172 if (url_.SchemeIsCryptographic()) { |
173 // Do not cache content with cert errors. | 173 // Do not cache content with cert errors. |
174 // Also, we willfully violate the HTML5 spec at this point in order | 174 // Also, we willfully violate the HTML5 spec at this point in order |
175 // to support the appcaching of cross-origin HTTPS resources. | 175 // to support the appcaching of cross-origin HTTPS resources. |
176 // We've opted for a milder constraint and allow caching unless | 176 // We've opted for a milder constraint and allow caching unless |
177 // the resource has a "no-store" header. A spec change has been | 177 // the resource has a "no-store" header. A spec change has been |
178 // requested on the whatwg list. | 178 // requested on the whatwg list. |
179 // See http://code.google.com/p/chromium/issues/detail?id=69594 | 179 // See http://code.google.com/p/chromium/issues/detail?id=69594 |
180 // TODO(michaeln): Consider doing this for cross-origin HTTP too. | 180 // TODO(michaeln): Consider doing this for cross-origin HTTP too. |
181 const net::HttpNetworkSession::Params* session_params = | 181 const net::HttpNetworkSession::Params* session_params = |
182 request->context()->GetNetworkSessionParams(); | 182 request->context()->GetNetworkSessionParams(); |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 | 1615 |
1616 // Break the connection with the group so the group cannot call delete | 1616 // Break the connection with the group so the group cannot call delete |
1617 // on this object after we've posted a task to delete ourselves. | 1617 // on this object after we've posted a task to delete ourselves. |
1618 group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); | 1618 group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); |
1619 group_ = NULL; | 1619 group_ = NULL; |
1620 | 1620 |
1621 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 1621 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
1622 } | 1622 } |
1623 | 1623 |
1624 } // namespace content | 1624 } // namespace content |
OLD | NEW |