OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/browser/appcache/appcache_host.h" | 5 #include "webkit/browser/appcache/appcache_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 if (!manifest_url.is_empty() && | 109 if (!manifest_url.is_empty() && |
110 (manifest_url.GetOrigin() == document_url.GetOrigin())) { | 110 (manifest_url.GetOrigin() == document_url.GetOrigin())) { |
111 DCHECK(!first_party_url_.is_empty()); | 111 DCHECK(!first_party_url_.is_empty()); |
112 AppCachePolicy* policy = service()->appcache_policy(); | 112 AppCachePolicy* policy = service()->appcache_policy(); |
113 if (policy && | 113 if (policy && |
114 !policy->CanCreateAppCache(manifest_url, first_party_url_)) { | 114 !policy->CanCreateAppCache(manifest_url, first_party_url_)) { |
115 FinishCacheSelection(NULL, NULL); | 115 FinishCacheSelection(NULL, NULL); |
116 std::vector<int> host_ids(1, host_id_); | 116 std::vector<int> host_ids(1, host_id_); |
117 frontend_->OnEventRaised(host_ids, CHECKING_EVENT); | 117 frontend_->OnEventRaised(host_ids, CHECKING_EVENT); |
118 frontend_->OnErrorEventRaised( | 118 frontend_->OnErrorEventRaised( |
119 host_ids, "Cache creation was blocked by the content policy"); | 119 host_ids, |
120 "Cache creation was blocked by the content policy", | |
121 "Policy", | |
michaeln
2014/02/27 23:16:05
ah... an outlier error type, good find!
| |
122 GURL(), | |
123 0); | |
120 frontend_->OnContentBlocked(host_id_, manifest_url); | 124 frontend_->OnContentBlocked(host_id_, manifest_url); |
121 return; | 125 return; |
122 } | 126 } |
123 | 127 |
124 // Note: The client detects if the document was not loaded using HTTP GET | 128 // Note: The client detects if the document was not loaded using HTTP GET |
125 // and invokes SelectCache without a manifest url, so that detection step | 129 // and invokes SelectCache without a manifest url, so that detection step |
126 // is also skipped here. See WebApplicationCacheHostImpl.cc | 130 // is also skipped here. See WebApplicationCacheHostImpl.cc |
127 set_preferred_manifest_url(manifest_url); | 131 set_preferred_manifest_url(manifest_url); |
128 new_master_entry_url_ = document_url; | 132 new_master_entry_url_ = document_url; |
129 LoadOrCreateGroup(manifest_url); | 133 LoadOrCreateGroup(manifest_url); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 associated_cache_info_pending_ = cache && !cache->is_complete(); | 535 associated_cache_info_pending_ = cache && !cache->is_complete(); |
532 AppCacheInfo info; | 536 AppCacheInfo info; |
533 if (cache) | 537 if (cache) |
534 cache->AssociateHost(this); | 538 cache->AssociateHost(this); |
535 | 539 |
536 FillCacheInfo(cache, manifest_url, GetStatus(), &info); | 540 FillCacheInfo(cache, manifest_url, GetStatus(), &info); |
537 frontend_->OnCacheSelected(host_id_, info); | 541 frontend_->OnCacheSelected(host_id_, info); |
538 } | 542 } |
539 | 543 |
540 } // namespace appcache | 544 } // namespace appcache |
OLD | NEW |