| 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 ErrorDetails("Cache creation was blocked by the content policy", |
| 121 POLICY_ERROR, |
| 122 GURL(), |
| 123 0, |
| 124 false /*is_cross_origin*/)); |
| 120 frontend_->OnContentBlocked(host_id_, manifest_url); | 125 frontend_->OnContentBlocked(host_id_, manifest_url); |
| 121 return; | 126 return; |
| 122 } | 127 } |
| 123 | 128 |
| 124 // Note: The client detects if the document was not loaded using HTTP GET | 129 // 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 | 130 // and invokes SelectCache without a manifest url, so that detection step |
| 126 // is also skipped here. See WebApplicationCacheHostImpl.cc | 131 // is also skipped here. See WebApplicationCacheHostImpl.cc |
| 127 set_preferred_manifest_url(manifest_url); | 132 set_preferred_manifest_url(manifest_url); |
| 128 new_master_entry_url_ = document_url; | 133 new_master_entry_url_ = document_url; |
| 129 LoadOrCreateGroup(manifest_url); | 134 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(); | 536 associated_cache_info_pending_ = cache && !cache->is_complete(); |
| 532 AppCacheInfo info; | 537 AppCacheInfo info; |
| 533 if (cache) | 538 if (cache) |
| 534 cache->AssociateHost(this); | 539 cache->AssociateHost(this); |
| 535 | 540 |
| 536 FillCacheInfo(cache, manifest_url, GetStatus(), &info); | 541 FillCacheInfo(cache, manifest_url, GetStatus(), &info); |
| 537 frontend_->OnCacheSelected(host_id_, info); | 542 frontend_->OnCacheSelected(host_id_, info); |
| 538 } | 543 } |
| 539 | 544 |
| 540 } // namespace appcache | 545 } // namespace appcache |
| OLD | NEW |