| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 m_host->getResourceList(&webResources); | 206 m_host->getResourceList(&webResources); |
| 207 for (size_t i = 0; i < webResources.size(); ++i) { | 207 for (size_t i = 0; i < webResources.size(); ++i) { |
| 208 resources->append(ResourceInfo( | 208 resources->append(ResourceInfo( |
| 209 webResources[i].url, webResources[i].isMaster, webResources[i].isMan
ifest, webResources[i].isFallback, | 209 webResources[i].url, webResources[i].isMaster, webResources[i].isMan
ifest, webResources[i].isFallback, |
| 210 webResources[i].isForeign, webResources[i].isExplicit, webResources[
i].size)); | 210 webResources[i].isForeign, webResources[i].isExplicit, webResources[
i].size)); |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 void ApplicationCacheHost::stopDeferringEvents() | 214 void ApplicationCacheHost::stopDeferringEvents() |
| 215 { | 215 { |
| 216 RefPtrWillBeRawPtr<DocumentLoader> protect(documentLoader()); | 216 RawPtr<DocumentLoader> protect(documentLoader()); |
| 217 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) { | 217 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) { |
| 218 const DeferredEvent& deferred = m_deferredEvents[i]; | 218 const DeferredEvent& deferred = m_deferredEvents[i]; |
| 219 dispatchDOMEvent(deferred.eventID, deferred.progressTotal, deferred.prog
ressDone, deferred.errorReason, deferred.errorURL, deferred.errorStatus, deferre
d.errorMessage); | 219 dispatchDOMEvent(deferred.eventID, deferred.progressTotal, deferred.prog
ressDone, deferred.errorReason, deferred.errorURL, deferred.errorStatus, deferre
d.errorMessage); |
| 220 } | 220 } |
| 221 m_deferredEvents.clear(); | 221 m_deferredEvents.clear(); |
| 222 m_defersEvents = false; | 222 m_defersEvents = false; |
| 223 } | 223 } |
| 224 | 224 |
| 225 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int progressTotal, int p
rogressDone, WebApplicationCacheHost::ErrorReason errorReason, const String& err
orURL, int errorStatus, const String& errorMessage) | 225 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int progressTotal, int p
rogressDone, WebApplicationCacheHost::ErrorReason errorReason, const String& err
orURL, int errorStatus, const String& errorMessage) |
| 226 { | 226 { |
| 227 if (!m_domApplicationCache) | 227 if (!m_domApplicationCache) |
| 228 return; | 228 return; |
| 229 | 229 |
| 230 const AtomicString& eventType = ApplicationCache::toEventType(id); | 230 const AtomicString& eventType = ApplicationCache::toEventType(id); |
| 231 if (eventType.isEmpty() || !m_domApplicationCache->executionContext()) | 231 if (eventType.isEmpty() || !m_domApplicationCache->executionContext()) |
| 232 return; | 232 return; |
| 233 RefPtrWillBeRawPtr<Event> event = nullptr; | 233 RawPtr<Event> event = nullptr; |
| 234 if (id == PROGRESS_EVENT) | 234 if (id == PROGRESS_EVENT) |
| 235 event = ProgressEvent::create(eventType, true, progressDone, progressTot
al); | 235 event = ProgressEvent::create(eventType, true, progressDone, progressTot
al); |
| 236 else if (id == ERROR_EVENT) | 236 else if (id == ERROR_EVENT) |
| 237 event = ApplicationCacheErrorEvent::create(errorReason, errorURL, errorS
tatus, errorMessage); | 237 event = ApplicationCacheErrorEvent::create(errorReason, errorURL, errorS
tatus, errorMessage); |
| 238 else | 238 else |
| 239 event = Event::create(eventType); | 239 event = Event::create(eventType); |
| 240 m_domApplicationCache->dispatchEvent(event); | 240 m_domApplicationCache->dispatchEvent(event); |
| 241 } | 241 } |
| 242 | 242 |
| 243 ApplicationCacheHost::Status ApplicationCacheHost::status() const | 243 ApplicationCacheHost::Status ApplicationCacheHost::status() const |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, mess
age); | 290 notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, mess
age); |
| 291 } | 291 } |
| 292 | 292 |
| 293 DEFINE_TRACE(ApplicationCacheHost) | 293 DEFINE_TRACE(ApplicationCacheHost) |
| 294 { | 294 { |
| 295 visitor->trace(m_domApplicationCache); | 295 visitor->trace(m_domApplicationCache); |
| 296 visitor->trace(m_documentLoader); | 296 visitor->trace(m_documentLoader); |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace blink | 299 } // namespace blink |
| OLD | NEW |