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

Side by Side Diff: content/browser/appcache/appcache_update_job.cc

Issue 1099453005: Switch web API/permission code to use IsOriginSecure() instead of SchemeIsSecure(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nhiroki's comment. Created 5 years, 8 months 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 unified diff | Download patch
OLDNEW
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"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/thread_task_runner_handle.h" 12 #include "base/thread_task_runner_handle.h"
13 #include "chrome/common/origin_util.h"
jww 2015/04/23 18:24:02 Given what's used below, you're not using this hea
lgarron 2015/04/23 23:05:51 Done.
13 #include "content/browser/appcache/appcache_group.h" 14 #include "content/browser/appcache/appcache_group.h"
14 #include "content/browser/appcache/appcache_histograms.h" 15 #include "content/browser/appcache/appcache_histograms.h"
15 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
16 #include "net/base/io_buffer.h" 17 #include "net/base/io_buffer.h"
17 #include "net/base/load_flags.h" 18 #include "net/base/load_flags.h"
18 #include "net/base/net_errors.h" 19 #include "net/base/net_errors.h"
19 #include "net/base/request_priority.h" 20 #include "net/base/request_priority.h"
20 #include "net/http/http_request_headers.h" 21 #include "net/http/http_request_headers.h"
21 #include "net/http/http_response_headers.h" 22 #include "net/http/http_response_headers.h"
22 #include "net/url_request/url_request_context.h" 23 #include "net/url_request/url_request_context.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 163
163 if ((response_code / 100) != 2) { 164 if ((response_code / 100) != 2) {
164 if (response_code > 0) 165 if (response_code > 0)
165 result_ = SERVER_ERROR; 166 result_ = SERVER_ERROR;
166 else 167 else
167 result_ = NETWORK_ERROR; 168 result_ = NETWORK_ERROR;
168 OnResponseCompleted(); 169 OnResponseCompleted();
169 return; 170 return;
170 } 171 }
171 172
172 if (url_.SchemeIsSecure()) { 173 if (url_.SchemeIsCryptographic()) {
jww 2015/04/23 18:24:02 Why this check? Why not OriginIsSecure()?
lgarron 2015/04/23 23:05:51 There's a comment in the first patch. The code bel
173 // Do not cache content with cert errors. 174 // Do not cache content with cert errors.
174 // Also, we willfully violate the HTML5 spec at this point in order 175 // Also, we willfully violate the HTML5 spec at this point in order
175 // to support the appcaching of cross-origin HTTPS resources. 176 // to support the appcaching of cross-origin HTTPS resources.
176 // We've opted for a milder constraint and allow caching unless 177 // We've opted for a milder constraint and allow caching unless
177 // the resource has a "no-store" header. A spec change has been 178 // the resource has a "no-store" header. A spec change has been
178 // requested on the whatwg list. 179 // requested on the whatwg list.
179 // See http://code.google.com/p/chromium/issues/detail?id=69594 180 // See http://code.google.com/p/chromium/issues/detail?id=69594
180 // TODO(michaeln): Consider doing this for cross-origin HTTP too. 181 // TODO(michaeln): Consider doing this for cross-origin HTTP too.
181 const net::HttpNetworkSession::Params* session_params = 182 const net::HttpNetworkSession::Params* session_params =
182 request->context()->GetNetworkSessionParams(); 183 request->context()->GetNetworkSessionParams();
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 1616
1616 // Break the connection with the group so the group cannot call delete 1617 // 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. 1618 // on this object after we've posted a task to delete ourselves.
1618 group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); 1619 group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE);
1619 group_ = NULL; 1620 group_ = NULL;
1620 1621
1621 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); 1622 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
1622 } 1623 }
1623 1624
1624 } // namespace content 1625 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698