| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/appcache/appcache_request_handler.h" | 5 #include "webkit/appcache/appcache_request_handler.h" |
| 6 | 6 |
| 7 #include "net/url_request/url_request.h" | 7 #include "net/url_request/url_request.h" |
| 8 #include "net/url_request/url_request_job.h" | 8 #include "net/url_request/url_request_job.h" |
| 9 #include "webkit/appcache/appcache.h" | 9 #include "webkit/appcache/appcache.h" |
| 10 #include "webkit/appcache/appcache_url_request_job.h" | 10 #include "webkit/appcache/appcache_url_request_job.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 // We may have to wait for our storage query to complete, but | 180 // We may have to wait for our storage query to complete, but |
| 181 // this query can also complete syncrhonously. | 181 // this query can also complete syncrhonously. |
| 182 job_ = new AppCacheURLRequestJob(request, storage()); | 182 job_ = new AppCacheURLRequestJob(request, storage()); |
| 183 storage()->FindResponseForMainRequest(request->url(), this); | 183 storage()->FindResponseForMainRequest(request->url(), this); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void AppCacheRequestHandler::OnMainResponseFound( | 186 void AppCacheRequestHandler::OnMainResponseFound( |
| 187 const GURL& url, const AppCacheEntry& entry, | 187 const GURL& url, const AppCacheEntry& entry, |
| 188 const AppCacheEntry& fallback_entry, | 188 const AppCacheEntry& fallback_entry, |
| 189 int64 cache_id, const GURL& manifest_url) { | 189 int64 cache_id, const GURL& manifest_url, |
| 190 bool was_blocked_by_policy) { |
| 190 DCHECK(host_); | 191 DCHECK(host_); |
| 191 DCHECK(is_main_request_); | 192 DCHECK(is_main_request_); |
| 192 DCHECK(!entry.IsForeign()); | 193 DCHECK(!entry.IsForeign()); |
| 193 DCHECK(!fallback_entry.IsForeign()); | 194 DCHECK(!fallback_entry.IsForeign()); |
| 194 DCHECK(!(entry.has_response_id() && fallback_entry.has_response_id())); | 195 DCHECK(!(entry.has_response_id() && fallback_entry.has_response_id())); |
| 195 | 196 |
| 197 host_->NotifyContentBlocked(); |
| 198 |
| 196 if (cache_id != kNoCacheId) { | 199 if (cache_id != kNoCacheId) { |
| 197 // AppCacheHost loads and holds a reference to the main resource cache | 200 // AppCacheHost loads and holds a reference to the main resource cache |
| 198 // for two reasons, firstly to preload the cache into the working set | 201 // for two reasons, firstly to preload the cache into the working set |
| 199 // in advance of subresource loads happening, secondly to prevent the | 202 // in advance of subresource loads happening, secondly to prevent the |
| 200 // AppCache from falling out of the working set on frame navigations. | 203 // AppCache from falling out of the working set on frame navigations. |
| 201 host_->LoadMainResourceCache(cache_id); | 204 host_->LoadMainResourceCache(cache_id); |
| 202 } | 205 } |
| 203 | 206 |
| 204 // 6.11.1 Navigating across documents, steps 10 and 14. | 207 // 6.11.1 Navigating across documents, steps 10 and 14. |
| 205 | 208 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 if (!host_->associated_cache() || | 303 if (!host_->associated_cache() || |
| 301 !host_->associated_cache()->is_complete()) { | 304 !host_->associated_cache()->is_complete()) { |
| 302 DeliverNetworkResponse(); | 305 DeliverNetworkResponse(); |
| 303 return; | 306 return; |
| 304 } | 307 } |
| 305 | 308 |
| 306 ContinueMaybeLoadSubResource(); | 309 ContinueMaybeLoadSubResource(); |
| 307 } | 310 } |
| 308 | 311 |
| 309 } // namespace appcache | 312 } // namespace appcache |
| OLD | NEW |