OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 m_host->getResourceList(&webResources); | 220 m_host->getResourceList(&webResources); |
221 for (size_t i = 0; i < webResources.size(); ++i) { | 221 for (size_t i = 0; i < webResources.size(); ++i) { |
222 resources->append(ResourceInfo( | 222 resources->append(ResourceInfo( |
223 webResources[i].url, webResources[i].isMaster, webResources[i].isMan
ifest, webResources[i].isFallback, | 223 webResources[i].url, webResources[i].isMaster, webResources[i].isMan
ifest, webResources[i].isFallback, |
224 webResources[i].isForeign, webResources[i].isExplicit, webResources[
i].size)); | 224 webResources[i].isForeign, webResources[i].isExplicit, webResources[
i].size)); |
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 void ApplicationCacheHost::stopDeferringEvents() | 228 void ApplicationCacheHost::stopDeferringEvents() |
229 { | 229 { |
230 RefPtrWillBeRawPtr<DocumentLoader> protect(documentLoader()); | 230 RawPtr<DocumentLoader> protect(documentLoader()); |
231 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) { | 231 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) { |
232 const DeferredEvent& deferred = m_deferredEvents[i]; | 232 const DeferredEvent& deferred = m_deferredEvents[i]; |
233 dispatchDOMEvent(deferred.eventID, deferred.progressTotal, deferred.prog
ressDone, deferred.errorReason, deferred.errorURL, deferred.errorStatus, deferre
d.errorMessage); | 233 dispatchDOMEvent(deferred.eventID, deferred.progressTotal, deferred.prog
ressDone, deferred.errorReason, deferred.errorURL, deferred.errorStatus, deferre
d.errorMessage); |
234 } | 234 } |
235 m_deferredEvents.clear(); | 235 m_deferredEvents.clear(); |
236 m_defersEvents = false; | 236 m_defersEvents = false; |
237 } | 237 } |
238 | 238 |
239 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int progressTotal, int p
rogressDone, WebApplicationCacheHost::ErrorReason errorReason, const String& err
orURL, int errorStatus, const String& errorMessage) | 239 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int progressTotal, int p
rogressDone, WebApplicationCacheHost::ErrorReason errorReason, const String& err
orURL, int errorStatus, const String& errorMessage) |
240 { | 240 { |
241 if (!m_domApplicationCache) | 241 if (!m_domApplicationCache) |
242 return; | 242 return; |
243 | 243 |
244 const AtomicString& eventType = ApplicationCache::toEventType(id); | 244 const AtomicString& eventType = ApplicationCache::toEventType(id); |
245 if (eventType.isEmpty() || !m_domApplicationCache->getExecutionContext()) | 245 if (eventType.isEmpty() || !m_domApplicationCache->getExecutionContext()) |
246 return; | 246 return; |
247 RefPtrWillBeRawPtr<Event> event = nullptr; | 247 RawPtr<Event> event = nullptr; |
248 if (id == PROGRESS_EVENT) | 248 if (id == PROGRESS_EVENT) |
249 event = ProgressEvent::create(eventType, true, progressDone, progressTot
al); | 249 event = ProgressEvent::create(eventType, true, progressDone, progressTot
al); |
250 else if (id == ERROR_EVENT) | 250 else if (id == ERROR_EVENT) |
251 event = ApplicationCacheErrorEvent::create(errorReason, errorURL, errorS
tatus, errorMessage); | 251 event = ApplicationCacheErrorEvent::create(errorReason, errorURL, errorS
tatus, errorMessage); |
252 else | 252 else |
253 event = Event::create(eventType); | 253 event = Event::create(eventType); |
254 m_domApplicationCache->dispatchEvent(event); | 254 m_domApplicationCache->dispatchEvent(event); |
255 } | 255 } |
256 | 256 |
257 ApplicationCacheHost::Status ApplicationCacheHost::getStatus() const | 257 ApplicationCacheHost::Status ApplicationCacheHost::getStatus() const |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, mess
age); | 304 notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, mess
age); |
305 } | 305 } |
306 | 306 |
307 DEFINE_TRACE(ApplicationCacheHost) | 307 DEFINE_TRACE(ApplicationCacheHost) |
308 { | 308 { |
309 visitor->trace(m_domApplicationCache); | 309 visitor->trace(m_domApplicationCache); |
310 visitor->trace(m_documentLoader); | 310 visitor->trace(m_documentLoader); |
311 } | 311 } |
312 | 312 |
313 } // namespace blink | 313 } // namespace blink |
OLD | NEW |