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/web_application_cache_host_impl.h" | 5 #include "webkit/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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 const char* kFormatString = "Application Cache Error event: %s"; | 149 const char* kFormatString = "Application Cache Error event: %s"; |
150 std::string full_message = base::StringPrintf(kFormatString, | 150 std::string full_message = base::StringPrintf(kFormatString, |
151 message.c_str()); | 151 message.c_str()); |
152 OnLogMessage(LOG_ERROR, full_message); | 152 OnLogMessage(LOG_ERROR, full_message); |
153 | 153 |
154 status_ = cache_info_.is_complete ? IDLE : UNCACHED; | 154 status_ = cache_info_.is_complete ? IDLE : UNCACHED; |
155 client_->notifyEventListener(static_cast<EventID>(ERROR_EVENT)); | 155 client_->notifyEventListener(static_cast<EventID>(ERROR_EVENT)); |
156 } | 156 } |
157 | 157 |
158 void WebApplicationCacheHostImpl::willStartMainResourceRequest( | 158 void WebApplicationCacheHostImpl::willStartMainResourceRequest( |
159 WebURLRequest& request) { | 159 WebURLRequest& request, const WebFrame* frame) { |
160 request.setAppCacheHostID(host_id_); | 160 request.setAppCacheHostID(host_id_); |
161 | 161 |
162 original_main_resource_url_ = ClearUrlRef(request.url()); | 162 original_main_resource_url_ = ClearUrlRef(request.url()); |
163 | 163 |
164 std::string method = request.httpMethod().utf8(); | 164 std::string method = request.httpMethod().utf8(); |
165 is_get_method_ = (method == kHttpGETMethod); | 165 is_get_method_ = (method == kHttpGETMethod); |
166 DCHECK(method == StringToUpperASCII(method)); | 166 DCHECK(method == StringToUpperASCII(method)); |
167 | |
michaeln
2011/03/17 21:58:51
i'm gonna run some try jobs with a CHECK(frame) he
| |
168 if (frame) { | |
169 if (WebApplicationCacheHostImpl* parent = FromFrame(frame->parent())) | |
170 backend_->SetSpawningHostId(host_id_, parent->host_id()); | |
171 else if (WebApplicationCacheHostImpl* opener = FromFrame(frame->opener())) | |
172 backend_->SetSpawningHostId(host_id_, opener->host_id()); | |
173 } | |
167 } | 174 } |
168 | 175 |
169 void WebApplicationCacheHostImpl::willStartSubResourceRequest( | 176 void WebApplicationCacheHostImpl::willStartSubResourceRequest( |
170 WebURLRequest& request) { | 177 WebURLRequest& request) { |
171 request.setAppCacheHostID(host_id_); | 178 request.setAppCacheHostID(host_id_); |
172 } | 179 } |
173 | 180 |
174 void WebApplicationCacheHostImpl::selectCacheWithoutManifest() { | 181 void WebApplicationCacheHostImpl::selectCacheWithoutManifest() { |
175 if (was_select_cache_called_) | 182 if (was_select_cache_called_) |
176 return; | 183 return; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 web_resources[i].isExplicit = resource_infos[i].is_explicit; | 309 web_resources[i].isExplicit = resource_infos[i].is_explicit; |
303 web_resources[i].isManifest = resource_infos[i].is_manifest; | 310 web_resources[i].isManifest = resource_infos[i].is_manifest; |
304 web_resources[i].isForeign = resource_infos[i].is_foreign; | 311 web_resources[i].isForeign = resource_infos[i].is_foreign; |
305 web_resources[i].isFallback = resource_infos[i].is_fallback; | 312 web_resources[i].isFallback = resource_infos[i].is_fallback; |
306 web_resources[i].url = resource_infos[i].url; | 313 web_resources[i].url = resource_infos[i].url; |
307 } | 314 } |
308 resources->swap(web_resources); | 315 resources->swap(web_resources); |
309 } | 316 } |
310 | 317 |
311 } // appcache namespace | 318 } // appcache namespace |
OLD | NEW |