| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/child/appcache/web_application_cache_host_impl.h" | 5 #include "content/child/appcache/web_application_cache_host_impl.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 void WebApplicationCacheHostImpl::willStartMainResourceRequest( | 162 void WebApplicationCacheHostImpl::willStartMainResourceRequest( |
| 163 WebURLRequest& request, const WebApplicationCacheHost* spawning_host) { | 163 WebURLRequest& request, const WebApplicationCacheHost* spawning_host) { |
| 164 request.setAppCacheHostID(host_id_); | 164 request.setAppCacheHostID(host_id_); |
| 165 | 165 |
| 166 original_main_resource_url_ = ClearUrlRef(request.url()); | 166 original_main_resource_url_ = ClearUrlRef(request.url()); |
| 167 | 167 |
| 168 std::string method = request.httpMethod().utf8(); | 168 std::string method = request.httpMethod().utf8(); |
| 169 is_get_method_ = (method == kHttpGETMethod); | 169 is_get_method_ = (method == kHttpGETMethod); |
| 170 DCHECK(method == base::StringToUpperASCII(method)); | 170 DCHECK(method == StringToUpperASCII(method)); |
| 171 | 171 |
| 172 const WebApplicationCacheHostImpl* spawning_host_impl = | 172 const WebApplicationCacheHostImpl* spawning_host_impl = |
| 173 static_cast<const WebApplicationCacheHostImpl*>(spawning_host); | 173 static_cast<const WebApplicationCacheHostImpl*>(spawning_host); |
| 174 if (spawning_host_impl && (spawning_host_impl != this) && | 174 if (spawning_host_impl && (spawning_host_impl != this) && |
| 175 (spawning_host_impl->status_ != APPCACHE_STATUS_UNCACHED)) { | 175 (spawning_host_impl->status_ != APPCACHE_STATUS_UNCACHED)) { |
| 176 backend_->SetSpawningHostId(host_id_, spawning_host_impl->host_id()); | 176 backend_->SetSpawningHostId(host_id_, spawning_host_impl->host_id()); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 void WebApplicationCacheHostImpl::willStartSubResourceRequest( | 180 void WebApplicationCacheHostImpl::willStartSubResourceRequest( |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 web_resources[i].isExplicit = resource_infos[i].is_explicit; | 314 web_resources[i].isExplicit = resource_infos[i].is_explicit; |
| 315 web_resources[i].isManifest = resource_infos[i].is_manifest; | 315 web_resources[i].isManifest = resource_infos[i].is_manifest; |
| 316 web_resources[i].isForeign = resource_infos[i].is_foreign; | 316 web_resources[i].isForeign = resource_infos[i].is_foreign; |
| 317 web_resources[i].isFallback = resource_infos[i].is_fallback; | 317 web_resources[i].isFallback = resource_infos[i].is_fallback; |
| 318 web_resources[i].url = resource_infos[i].url; | 318 web_resources[i].url = resource_infos[i].url; |
| 319 } | 319 } |
| 320 resources->swap(web_resources); | 320 resources->swap(web_resources); |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace content | 323 } // namespace content |
| OLD | NEW |